ERPNext Docker issue - Queues and Scheduler containers fail after installing app [FIXED]

Hi,

I’m using frappe_docker pwd.yml compose file to run ERPNext containers on Windows 11.
When I install additional apps (eg. Frappe HR, Frappe Desk), queue-default, queue-long, queue-short and scheduler stop running giving a ModuleNotFoundError:

Traceback (most recent call last):
File “/usr/local/lib/python3.10/runpy.py”, line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/local/lib/python3.10/runpy.py”, line 86, in _run_code
exec(code, run_globals)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 109, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=“bench”)
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 829, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 782, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/scheduler.py”, line 201, in start_worker
start_worker(
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 216, in start_worker
with frappe.init_site():
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 341, in enter
init(self.site)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 248, in init
setup_module_map()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1538, in setup_module_map
for module in get_module_list(app):
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1378, in get_module_list
return get_file_items(os.path.join(os.path.dirname(get_module(app_name).file), “modules.txt”))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1327, in get_module
return importlib.import_module(modulename)
File “/usr/local/lib/python3.10/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1050, in _gcd_import
File “”, line 1027, in _find_and_load
File “”, line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘hrms’

Steps I did to install Frappe HR:

Connect to docker backend terminal, I then run commands:

  • bench get-app hrms
  • bench install-app hrms
  • Restart docker containers

All containers startup ok, except the queue containers and scheduler that fail with the same ModuleNotFoundError. I also ran command bench migrate after installing but I get the same error.

Is there a way to fix this?

So, I figured it out. For anyone else that may encounter this issue:

Adding additional apps to the Official ERPNext Docker Image will not work, you have to build your own custom image:
https://github.com/frappe/frappe_docker/blob/main/docs/custom-apps.md

The documentation should really be clearer, that you cannot install additional apps using the standalone ERPNext docker image. Using frappe_docker with pwd.yml compose file won’t work either, you MUST build a custom image if you wish to install more apps (HR, Frappedesk, etc.)

4 Likes

Here is my custom docker image with ERPNext and Frappe HR (v14) for anyone who is interested:

https://hub.docker.com/r/ellicodan/erpnext-hrms

2 Likes

Thank you so much for your sharing after you solved it! I spent a full day trying to figure this one out, and your reply pointed out the right direction. Glad to finally have the scheduler working!

I had the same problem.
Then i started to build my own images.
The big advantage is, that you can install also some tools you need on linux.
Also you can install your apps from different branches.
In the compose file you can issue the bench – site frontend install-app . So your setup is jumpstart-ready.
For a newbie it is something of learning, but it is worth to take the effort.

Installing things in the docker-container seems to be a bad habbit. :slight_smile: