[SOLVED] BENCH cant find path - commands not working

Hi all,

long time no see
just setup a testserver (blank dedicated old Laptop) to prep for upgrade from version 7.
It got throug the install.py and runs fine but unfortunately bench commands dont seem to work.
looks like the bench_path is not comming through
mine is…
home/frappe/.bench
and
home/frappe/frappe-bench for the apps and sites

OS: Debian 9.4 amd64
ERPNext: v10.1.18 (master)
Frappe Framework: v10.1.16 (master)

    frappe@erp2:~$ bench config dns_multitenant on
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/frappe/.bench/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/.bench/bench/commands/config.py", line 40, in config_dns_multitenant
    update_config({'dns_multitenant': state})
  File "/home/frappe/.bench/bench/config/common_site_config.py", line 46, in update_config
    put_config(config, bench_path=bench_path)
  File "/home/frappe/.bench/bench/config/common_site_config.py", line 40, in put_config
    with open(config_path, 'w') as f:
IOError: [Errno 2] No such file or directory: './sites/common_site_config.json'

also I have this one

frappe@erp2:~$ bench restart
INFO:bench.utils:sudo supervisorctl restart frappe:
frappe: ERROR (no such group)
frappe: ERROR (no such group)

and this one

frappe@erp2:~$ bench setup nginx
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/frappe/.bench/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/.bench/bench/commands/setup.py", line 20, in setup_nginx
    make_nginx_conf(bench_path=".", yes=yes)
  File "/home/frappe/.bench/bench/config/nginx.py", line 13, in make_nginx_conf
    sites = prepare_sites(config, bench_path)
  File "/home/frappe/.bench/bench/config/nginx.py", line 61, in prepare_sites
    sites_configs = get_sites_with_config(bench_path=bench_path)
  File "/home/frappe/.bench/bench/config/nginx.py", line 146, in get_sites_with_config
    sites = get_sites(bench_path=bench_path)
  File "/home/frappe/.bench/bench/utils.py", line 229, in get_sites
    sites = [site for site in os.listdir(sites_dir)
OSError: [Errno 2] No such file or directory: '/home/frappe/sites'

Have I maybe screwed up installing via install.py?
please advise :astonished:

cheers

Perhaps you forgot bench commands must be run from the frappe-bench directory?

1 Like

:scream:
ja, a perfect example of how silly one can be
…the bug sitting in front of the computer

thank you very much for your patience @clarkej

works just fine

thank you again

1 Like

Welcome back

Glad to help

Have fun!