Error on bench setup production

Hi everyone, im trying to set up ERPNext and i’ve an error with this…

First of all im trying with:

$ bench update

And i had this error:

frappe: ERROR (no such group)
frappe: ERROR (no such group)
________________________________________________________________________________
Bench: Open source installer + admin for Frappe and ERPNext (https://erpnext.com)

i searched here and found that i have to “bench setup production” and i tried:

$ sudo bench setup production

and i’d this error:

Usage: bench setup production [OPTIONS] USER

Error: Missing argument “user”.

and found here too that the syntax is:

$ bench setup production frappe

well here is the result:

$ sudo bench setup production myuser
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.0.0’, ‘console_scripts’, ‘bench’)()
File “/Developers/bench-repo/bench/cli.py”, line 60, in cli
bench()
File “/Library/Python/2.7/site-packages/click/core.py”, line 716, in call
**return self.main(*args, kwargs)
File “/Library/Python/2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/Library/Python/2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Library/Python/2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Library/Python/2.7/site-packages/click/core.py”, line 889, in invoke
**return ctx.invoke(self.callback, ctx.params)
File “/Library/Python/2.7/site-packages/click/core.py”, line 534, in invoke
**return callback(*args, kwargs)
File “/Developers/bench-repo/bench/cli.py”, line 456, in setup_production
_setup_production(user=user)
File “/Developers/bench-repo/bench/production_setup.py”, line 55, in setup_production
fix_prod_setup_perms(frappe_user=user)
File “/Developers/bench-repo/bench/utils.py”, line 446, in fix_prod_setup_perms
gid = grp.getgrnam(frappe_user).gr_gid
KeyError: ‘getgrnam(): name not found: frappe’

Can you help my guys ??..

Thank you!

1 Like

Not an expert

Seems to me that the user groups were not setup properly. Did you install using the script on the Github? You could manually create the UNIX group frappe, but I am not sure what permissions you would need to setup to have the correct access. Also, if the group isn’t setup, then I would imagine the user that frappe needs isn’t created as well.

I would do a reinstall using the script with the “production” flag.

hi!.. thanks for the answer, i do everything manual because im in OS X. i’ll try making the user and group frappe and i’ll share the results

1 Like

Instead of using frappe user, use your current user in setup production for Mac OS X

1 Like

as in this line?
replace frappe with the current user?

Yes .

1 Like

Hi @anand, thanks for answer:

$ sudo bench setup production gvargas
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.0.0’, ‘console_scripts’, ‘bench’)()
File “/Developers/bench-repo/bench/cli.py”, line 60, in cli
bench()
File “/Library/Python/2.7/site-packages/click/core.py”, line 716, in call
**return self.main(*args, kwargs)
File “/Library/Python/2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/Library/Python/2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Library/Python/2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Library/Python/2.7/site-packages/click/core.py”, line 889, in invoke
**return ctx.invoke(self.callback, ctx.params)
File “/Library/Python/2.7/site-packages/click/core.py”, line 534, in invoke
**return callback(*args, kwargs)
File “/Developers/bench-repo/bench/cli.py”, line 456, in setup_production
_setup_production(user=user)
File “/Developers/bench-repo/bench/production_setup.py”, line 55, in setup_production
fix_prod_setup_perms(frappe_user=user)
File “/Developers/bench-repo/bench/utils.py”, line 446, in fix_prod_setup_perms
gid = grp.getgrnam(frappe_user).gr_gid
KeyError: ‘getgrnam(): name not found: gvargas’

I tried with my user and is the same error

one new think… when i put the erpnext on Developer mode… it works!!.

$ bench start
16:23:16 system | workerbeat.1 started (pid=39996)
16:23:16 system | async_worker.1 started (pid=40001)
16:23:16 system | worker.1 started (pid=39998)
16:23:16 system | web.1 started (pid=40000)
16:23:16 system | redis_cache.1 started (pid=40004)
16:23:16 system | socketio.1 started (pid=40002)
16:23:16 system | redis_async_broker.1 started (pid=40003)
16:23:16 system | longjob_worker.1 started (pid=40005)

but i need it on Production mode, what can i do ?

1 Like

Playing a little bit with my problem i found if i try to an update of bench with root i have the same error:

root# bench update
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.0.0’, ‘console_scripts’, ‘bench’)()
File “/Developers/bench-repo/bench/cli.py”, line 44, in cli
change_uid()
File “/Developers/bench-repo/bench/cli.py”, line 79, in change_uid
drop_privileges(uid_name=frappe_user, gid_name=frappe_user)
File “/Developers/bench-repo/bench/utils.py”, line 412, in drop_privileges
running_gid = grp.getgrnam(gid_name).gr_gid
KeyError: ‘getgrnam(): name not found: gvargas’

if i make exactly the same thing with my user this happens:

gvargas$ bench update
INFO:bench.utils:setting up sudoers
Already up-to-date.

this means that as I type the command “sudo bench setup production gvargas” it will look for the user with was compiled and the error: KeyError: ‘getgrnam(): name not found: gvargas’ appers, is there any way to know with what user was compiled ?

this are simply speculations…

i resolved my own problem… just add user and group frappe on OS X. Now i’ve a new one problem:

$ sudo bench setup production frappe
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.0.0’, ‘console_scripts’, ‘bench’)()
File “/Developers/bench-repo/bench/cli.py”, line 60, in cli
bench()
File “/Library/Python/2.7/site-packages/click/core.py”, line 716, in call
**return self.main(*args, kwargs)
File “/Library/Python/2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/Library/Python/2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Library/Python/2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Library/Python/2.7/site-packages/click/core.py”, line 889, in invoke
**return ctx.invoke(self.callback, ctx.params)
File “/Library/Python/2.7/site-packages/click/core.py”, line 534, in invoke
**return callback(*args, kwargs)
File “/Developers/bench-repo/bench/cli.py”, line 456, in setup_production
_setup_production(user=user)
File “/Developers/bench-repo/bench/production_setup.py”, line 67, in setup_production
(os.path.abspath(os.path.join(bench, ‘config’, ‘supervisor.conf’)), os.path.join(get_supervisor_confdir(), supervisor_conf_filename)),
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py”, line 70, in join
elif path == ‘’ or path.endswith(‘/’):
AttributeError: ‘NoneType’ object has no attribute ‘endswith’

I think this will be only a configuration problem with the path of supervisor.conf… i hope.

Thanks to @anand and @Brandon_Fox for try to help me.

Just a thought … shouldn’t it be

–setup-production

I’m on OS X and the flag –setup-production is for the script of Linux Distributions but thanks!.

to not open a new topic, I will continue this that’s already open.

Now I have a new problem with the setup of production, now I have this last error:

$ sudo bench setup production frappe
Restarted supervisord
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.0.0’, ‘console_scripts’, ‘bench’)()
File “/Developers/bench-repo/bench/cli.py”, line 60, in cli
bench()
File “/Library/Python/2.7/site-packages/click/core.py”, line 716, in call
**return self.main(*args, kwargs)
File “/Library/Python/2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/Library/Python/2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Library/Python/2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Library/Python/2.7/site-packages/click/core.py”, line 889, in invoke
**return ctx.invoke(self.callback, ctx.params)
File “/Library/Python/2.7/site-packages/click/core.py”, line 534, in invoke
**return callback(*args, kwargs)
File “/Developers/bench-repo/bench/cli.py”, line 456, in setup_production
_setup_production(user=user)
File “/Developers/bench-repo/bench/production_setup.py”, line 77, in setup_production
restart_service(‘nginx’)
File “/Developers/bench-repo/bench/production_setup.py”, line 21, in restart_service
raise Exception, ‘No service manager found’
Exception: No service manager found

i know the error is can’t restart nginx, but if a type
“$ sudo nginx -s reload”
it’s works

I’m installed nginx with MacPorts and that’s why it don’t have a systemctl. How can i add a systemctl for nginx on OS X ?

Thank you guys in advance.

actually I think you should open a new topic.

Mainly because let’s say someone else has the same problem (as your new problem) this person would be able to find your new topic an participate in you solution.

A drastic example would be be that everybody just opens one topic for all his problems … that would provide 0 value to the rest of the community and that’s not the purpose of such a forum. It’s topic centered, not user centered

ok, i will

is there a solution to this endswitch issue while switching to production?

1 Like

You must install the supervisor and nginx.

sudo apt-get install supervisor
sudo apt-get install nginx

and then rerun the sudo bench setup production frappe

3 Likes

Guys, is this resolved somehow? I’ve been trying to install on an Ubuntu 16.04LTS server for nearly a year and just recently was able to install on Ubuntu 14LTS.
However production setup cannot commence:
frappe@erp:~$ sudo bench setup production
Usage: bench setup production [OPTIONS] USER

Error: Missing argument “user”.

earliest reply will be appreciated

somehow made it work by just running the same command under frappe-bench directory. Was this so hard to mention somewhere?

1 Like

Can this be pinned as the answer or something? Took me way too long to find this, but it solved the issue!

1 Like