Sudo Setup Bench Production

Hi Guys,

I have followed the easy install instructions

After which, I followed this to setup.

https://frappe.io/docs/user/en/bench/guides/setup-production.html

I am getting the below thrown out to me. Can anyone shed any light?
New user here.

coffee-user@ip:/home/ubuntu$ sudo bench setup production coffee-user
WARN: Command not being executed in bench directory
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/coffee-user/.bench/bench/cli.py”, line 41, in cli
bench_command()
File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/coffee-user/.bench/bench/commands/setup.py”, line 73, in setup_production
setup_production(user=user, yes=yes)
File “/home/coffee-user/.bench/bench/config/production_setup.py”, line 15, in setup_production
generate_supervisor_config(bench_path=bench_path, user=user, yes=yes)
File “/home/coffee-user/.bench/bench/config/supervisor.py”, line 41, in generate_supervisor_config
with open(conf_path, ‘w’) as f:
FileNotFoundError: [Errno 2] No such file or directory: ‘./config/supervisor.conf’
coffee-user@ip:/home/ubuntu$ sudo bench setup production
WARN: Command not being executed in bench directory
Usage: bench setup production [OPTIONS] USER
Try “bench setup production --help” for help.

The first line tells you:

WARN: Command not being executed in bench directory

The last line tells you:

FileNotFoundError: [Errno 2] No such file or directory: ‘./config/supervisor.conf’

It’s looking for /home/ubuntu/config/supervisor.conf but can’t find it because you arn’t in a bench directory.

4 Likes

Run the command from the frappe-bench directory and check.

2 Likes

Thanks Martin! it worked.

Thanks Kenneth! yes, that did it

I’m running this command in frappe-bench directory. it is giving me error
sudo: bench: command not found

when I ran without sudo bench setup production sri it is giving me warning : WARN: superuser privileges required for this command

what should I do?

Thank you

Hi,

What does sudo pip3 show frappe-bench return?

check for bench version
in frappe-bench directory run
bench --version

it should give you the bench version.

5.14.4

this is the bench version

bench --version
it gives result : 5.14.4

but when I ran sudo bench setup production sri in the same directory, It gives following result:
sudo: bench: command not found

Why this happened?