Unable to access sites and not able to execute any bench commands

Tried installing a new app which failed. After that all the sites were throwing “Internal Server Error” and in the console I am getting the following error for whatever bench command I try to run.

The command seems to be checking for the india-compliance module, which was already working fine.

$ bench --site set-maintenance-mode off
Traceback (most recent call last):
File “/usr/lib/python3.10/runpy.py”, line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.10/runpy.py”, line 86, in _run_code
exec(code, run_globals)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 109, in
main()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=“bench”)
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 829, in call
return self.main(*args, **kwargs)
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 782, in main
rv = self.invoke(ctx)
File “/home/ubuntu/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/ubuntu/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/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/decorators.py”, line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands/init.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands/scheduler.py”, line 119, in set_maintenance_mode
frappe.init(site=site)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 248, in init
setup_module_map()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 1530, in setup_module_map
for module in get_module_list(app):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 1388, in get_module_list
return get_file_items(os.path.join(os.path.dirname(get_module(app_name).file), “modules.txt”))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 1337, in get_module
return importlib.import_module(modulename)
File “/usr/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 'india-compliance’

Under sites folder you have apps.txt. So take out or comment India-compliance and run the bench commands.

Thank You.
Though the india-compliance is mentioned in the error message, the actual culprit was the new app I added. Probably the new app is checking for a particular version of india-compliance. I am on v14 and so many new changes and the new app is looking for a previous version of india-compliance.

I manually deleted the folder of the new app which I tried to install and everything started working fine.

A false positive case… :slight_smile: