Error while switching to production mode

Hi there,
While executing the following function:

sudo bench setup production username

Error occurred:

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/ujjawal/.bench/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/ujjawal/.bench/bench/commands/setup.py”, line 56, in setup_production
setup_production(user=user)
File “/home/ujjawal/.bench/bench/config/production_setup.py”, line 17, in setup_production
bench_name=bench_name, extn=supervisor_conf_extn))
File “/usr/lib/python2.7/posixpath.py”, line 77, in join
elif path == ‘’ or path.endswith(‘/’):
AttributeError: ‘NoneType’ object has no attribute ‘endswith’

How to solve it?

bench setup production <user_name> (user_name = frappe)

If you have setup your EPRNext using setup_frappe script.

I used the easy install method.
and I installed for the user ujjawal

python install.py --develop --user ujjawal

So to switch to production mode:
sudo bench setup production user_name=ujjawal

Should this be the script?

sudo bench setup production ujjawal

This should work.

So i tried the same for the first time and got that error.
I ll paste the error again for the reference.:

ujjawal@proderp:~/frappe-bench$ sudo bench setup production ujjawal

supervisor.conf already exists and this will overwrite it. Do you want to continue? [y/N]: y
Port configuration list:

Site rkerp.dev assigned port: 80

nginx.conf already exists and this will overwrite it. Do you want to continue? [y/N]: y

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/ujjawal/.bench/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/ujjawal/.bench/bench/commands/setup.py”, line 56, in setup_production
setup_production(user=user)
File “/home/ujjawal/.bench/bench/config/production_setup.py”, line 17, in setup_production
bench_name=bench_name, extn=supervisor_conf_extn))
File “/usr/lib/python2.7/posixpath.py”, line 77, in join
elif path == ‘’ or path.endswith(‘/’):
AttributeError: ‘NoneType’ object has no attribute ‘endswith’

Any update on this?

2 Likes

https://discuss.frappe.io/t/multi-tenant-setup-on-bench/22366/6

This line seems to resolve this issue.

frappe@erpnext:~/frappe-bench$ sudo supervisorctl reload
Restarted supervisord
frappe@erpnext:~/frappe-bench$ sudo service nginx start

which requires supervisor to be installed, which for some reason, I missed.

sudo apt install supervisor