ERPNext v12 bench manager install error

I have clear installation of ERPNext 12 on ubuntu 18.4.

ERPNext: v12.5.0 (version-12)
Frappe Framework: v12.3.0 (version-12)

I’m installing bench manager using instructions on this page Bench Manager

$ bench new-site b-m.local
$ bench get-app bench_manager GitHub - frappe/bench_manager: Frappe app for managing bench
$ bench --site b-m.local install-app bench_manager

There is no errors during execution of that commands.
But after refreshing screen of ERPNext desktop I’m getting error:

Traceback (most recent call last):
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 48, in render
data = render_page_by_language(path)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 152, in render_page_by_language
return render_page(path)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 168, in render_page
return build(path)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 175, in build
return build_page(path)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 188, in build_page
context = get_context(path)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/context.py”, line 28, in get_context
context = build_context(context)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/context.py”, line 75, in build_context
context.update(get_website_settings())
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/doctype/website_settings/website_settings.py”, line 76, in get_website_settings
{“label”: _(“My Account”), “url”: “/me”},
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/init.py”, line 71, in _
return get_full_dict(lang).get(msg) or non_translated_msg
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/translate.py”, line 192, in get_full_dict
frappe.local.lang_full_dict = load_lang(lang)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/translate.py”, line 217, in load_lang
path = os.path.join(frappe.get_pymodule_path(app), “translations”, lang + “.csv”)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/init.py”, line 861, in get_pymodule_path
return os.path.join(os.path.dirname(get_module(scrub(modulename)).file), *joins)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/init.py”, line 823, in get_module
return importlib.import_module(modulename)
File “/usr/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import

File “”, line 971, in _find_and_load

File “”, line 953, in _find_and_load_unlocked

ModuleNotFoundError: No module named ‘bench_manager’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/app.py”, line 69, in application
response = frappe.website.render.render()
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 78, in render
data = render_page(path)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 168, in render_page
return build(path)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 175, in build
return build_page(path)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 188, in build_page
context = get_context(path)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/context.py”, line 28, in get_context
context = build_context(context)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/context.py”, line 75, in build_context
context.update(get_website_settings())
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/doctype/website_settings/website_settings.py”, line 76, in get_website_settings
{“label”: _(“My Account”), “url”: “/me”},
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/init.py”, line 71, in _
return get_full_dict(lang).get(msg) or non_translated_msg
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/translate.py”, line 192, in get_full_dict
frappe.local.lang_full_dict = load_lang(lang)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/translate.py”, line 217, in load_lang
path = os.path.join(frappe.get_pymodule_path(app), “translations”, lang + “.csv”)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/init.py”, line 861, in get_pymodule_path
return os.path.join(os.path.dirname(get_module(scrub(modulename)).file), *joins)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/init.py”, line 823, in get_module
return importlib.import_module(modulename)
File “/usr/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import

File “”, line 971, in _find_and_load

File “”, line 953, in _find_and_load_unlocked

ModuleNotFoundError: No module named ‘bench_manager’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 48, in render
data = render_page_by_language(path)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 152, in render_page_by_language
return render_page(path)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 168, in render_page
return build(path)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 175, in build
return build_page(path)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 188, in build_page
context = get_context(path)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/context.py”, line 28, in get_context
context = build_context(context)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/context.py”, line 75, in build_context
context.update(get_website_settings())
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/doctype/website_settings/website_settings.py”, line 76, in get_website_settings
{“label”: _(“My Account”), “url”: “/me”},
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/init.py”, line 71, in _
return get_full_dict(lang).get(msg) or non_translated_msg
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/translate.py”, line 192, in get_full_dict
frappe.local.lang_full_dict = load_lang(lang)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/translate.py”, line 217, in load_lang
path = os.path.join(frappe.get_pymodule_path(app), “translations”, lang + “.csv”)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/init.py”, line 861, in get_pymodule_path
return os.path.join(os.path.dirname(get_module(scrub(modulename)).file), *joins)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/init.py”, line 823, in get_module
return importlib.import_module(modulename)
File “/usr/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import

File “”, line 971, in _find_and_load

File “”, line 953, in _find_and_load_unlocked

ModuleNotFoundError: No module named ‘bench_manager’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/middlewares.py”, line 16, in call
return super(StaticDataMiddleware, self).call(environ, start_response)
File “/home/vivas-frappe/frappe-bench/env/lib/python3.6/site-packages/werkzeug/middleware/shared_data.py”, line 220, in call
return self.app(environ, start_response)
File “/home/vivas-frappe/frappe-bench/env/lib/python3.6/site-packages/werkzeug/middleware/shared_data.py”, line 220, in call
return self.app(environ, start_response)
File “/home/vivas-frappe/frappe-bench/env/lib/python3.6/site-packages/werkzeug/local.py”, line 231, in application
return ClosingIterator(app(environ, start_response), self.cleanup)
File “/home/vivas-frappe/frappe-bench/env/lib/python3.6/site-packages/werkzeug/wrappers/base_request.py”, line 237, in application
resp = f(*args[:-2] + (request,))
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/app.py”, line 81, in application
response = handle_exception(e)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/app.py”, line 191, in handle_exception
http_status_code=http_status_code)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 78, in render
data = render_page(path)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 168, in render_page
return build(path)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 175, in build
return build_page(path)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 188, in build_page
context = get_context(path)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/context.py”, line 28, in get_context
context = build_context(context)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/context.py”, line 75, in build_context
context.update(get_website_settings())
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/website/doctype/website_settings/website_settings.py”, line 76, in get_website_settings
{“label”: _(“My Account”), “url”: “/me”},
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/init.py”, line 71, in _
return get_full_dict(lang).get(msg) or non_translated_msg
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/translate.py”, line 192, in get_full_dict
frappe.local.lang_full_dict = load_lang(lang)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/translate.py”, line 217, in load_lang
path = os.path.join(frappe.get_pymodule_path(app), “translations”, lang + “.csv”)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/init.py”, line 861, in get_pymodule_path
return os.path.join(os.path.dirname(get_module(scrub(modulename)).file), *joins)
File “/home/vivas-frappe/frappe-bench/apps/frappe/frappe/init.py”, line 823, in get_module
return importlib.import_module(modulename)
File “/usr/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import

File “”, line 971, in _find_and_load

File “”, line 953, in _find_and_load_unlocked

ModuleNotFoundError: No module named ‘bench_manager’

After that I can’t do anything unless I remove bench_manager app from sites/apps.txt
Result is ERPNext works fine, but bench manager is absent

What I’m doing wrong ?

Can anyone help me? I looked through maybe all topics related with this, but there is nothing to solve it

For some reason, it looks like the python module corresponding to the app did not get installed.
Try running from frappe-bench directory:

env/bin/pip install -e apps/bench_manager/

tried, result of its run is shown below, but gui result hasn’t changed (I mean, that ERPNext crashes with error ModuleNotFoundError)

Installing collected packages: bench-manager
Attempting uninstall: bench-manager
Found existing installation: bench-manager 0.0.1
Uninstalling bench-manager-0.0.1:
Successfully uninstalled bench-manager-0.0.1
Running setup.py develop for bench-manager
Successfully installed bench-manager

Please ensure that your app is up to date.
For some reason, Python failed to import the bench_manager module.
Ensure that frappe-bench/apps/bench_manager/bench_manager/__init__.py exists.

I’ve lauched ‘bench update’ to check app and received such message

Cannot proceed with update: You have local changes in app “erpnext” that are not committed.

Here are your choices:

  1. Merge the erpnext app manually with “git pull” / “git pull --rebase” and fix conflicts.
  2. Temporarily remove your changes with “git stash” or discard them completely
    with “bench update --reset” or for individual repositries “git reset --hard”
  3. If your changes are helpful for others, send in a pull request via GitHub and
    wait for them to be merged in the core.

init_.py exists and it contains:

-- coding: utf-8 --

version = ‘0.0.1’

also after bench update I get the message in gui:

Updating

Your system is being updated. Please refresh again after a few moments

You’ve accidentally or otherwise changed the code in erpnext app (Not recommended). To undo this, you can run:

bench update --reset

did it and during the process there was a message

ERROR: bench 4.1.0 has requirement GitPython==2.1.11, but you’ll have gitpython 2.1.15 which is incompatible.

but no more errors and in the end

Done in 62.71s.

site is not parked and there is no error message about ModuleNotFoudError

can you tell me , where can I found installed Bench Manager App?
I can’t see any shortcuts or smth like that )

Hmm, it seems like you’re still accessing your main site and not b-m.local.
You need to setup multitenancy. If this is a developer setup, it means you need to:

  • Run:
bench config dns_multitenant on
  • Add following to /etc/hosts:
127.0.0.1    (your current site name)
127.0.0.1    b-m.local

You can access respective site like so:

http://<site name>:8000/

oups.
I connect to ubuntu server via ssh (putty) and I don’t have there X environment
I have modified hosts file and I go to frappe gui via external ip address.
can you tell me, how can I go to b-m site in such situation ?

If it’s a production setup, you must update nginx config. See “DNS based multitenancy” in the guide I linked above (you can skip the “create a new site” step).

Edited:
You must also point it to a domain/subdomain. Alternatively, go with port based multitenancy in above guide.

Ok, than you a lot :slightly_smiling_face:,
I’ll look the guide you provided and let you know the result!

I did port-based multitenancy and have such result
sorry for maybe stupid question - how else it can work if there is no nginx ?

sudo ps -l -all |grep nginx
returns nothing

bench setup nginx
Port configuration list:

Site site1.local assigned port: 8000

Site bench-manager.local assigned port: 8002
nginx.conf already exists and this will overwrite it. Do you want to continue? [y/N]: y
vivas-frappe@andy-KVM:~/frappe-bench$ sudo service nginx reload
[sudo] password for vivas-frappe:
nginx: unrecognized service
vivas-frappe@andy-KVM:~/frappe-bench$

Maybe you have a developer setup? Nginx is only installed on a production setup. If you need to execute bench start, you have a developer setup. Also depends on whether this is a production or development server.

yes, this is developer setup
this is my “learning server”
what in this case I have to do ?

You can:

  • switch between your current site by executing bench use sitename

OR

  • run bench setup production

I launched command
bench use bench-manager
and after that going to my site address (192.168.xx.xx:8000)
but nothing was changed, I came againg to site1.local
I’ll try once again

Don’t post your IP publicly. You must restart bench after running this command.

It was local ip-address :slightly_smiling_face: but thanx for remind
finally it is working !!!
thank you very much, I wouldn’t be able to solve this Rubik’s Cube without your help

I thought that I have nginx launched cause of that I have launched bench start and closed term session.
but it was running all the time and everything I did to restart (bench restart) it was seamless
Only shutdown -r is helped.
And you !