Problem in bench command

When i try to execute bench --site [sitename] clear-cache it throws an error. Please someone help me it is in production server.

Traceback (most recent call last):
File “/home/erp/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 73, in get_app_commands
app_command_module = importlib.import_module(app + “.commands”)
File “/usr/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 848, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/home/erp/frappe-bench/apps/frappe/frappe/commands/init.py”, line 119, in
commands = get_commands()
File “/home/erp/frappe-bench/apps/frappe/frappe/commands/init.py”, line 112, in get_commands
from .site import commands as site_commands
File “/home/erp/frappe-bench/apps/frappe/frappe/commands/site.py”, line 639, in
def uninstall(context, app, dry_run, yes, no_backup, force):
File “/home/erp/frappe-bench/env/lib/python3.8/site-packages/click/decorators.py”, line 308, in decorator
_param_memo(f, OptionClass(param_decls, **option_attrs))
File “/home/erp/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 2495, in init
super().init(param_decls, type=type, multiple=multiple, **attrs)
File “/home/erp/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 2112, in init
raise ValueError(
ValueError: ‘default’ must be a list when ‘multiple’ is true.
Traceback (most recent call last):
File “/home/erp/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 73, in get_app_commands
app_command_module = importlib.import_module(app + “.commands”)
File “/usr/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 848, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/home/erp/frappe-bench/apps/erpnext/erpnext/commands/init.py”, line 6, in
from frappe.commands import get_site, pass_context
File “/home/erp/frappe-bench/apps/frappe/frappe/commands/init.py”, line 119, in
commands = get_commands()
File “/home/erp/frappe-bench/apps/frappe/frappe/commands/init.py”, line 112, in get_commands
from .site import commands as site_commands
File “/home/erp/frappe-bench/apps/frappe/frappe/commands/site.py”, line 639, in
def uninstall(context, app, dry_run, yes, no_backup, force):
File “/home/erp/frappe-bench/env/lib/python3.8/site-packages/click/decorators.py”, line 308, in decorator
_param_memo(f, OptionClass(param_decls, **option_attrs))
File “/home/erp/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 2495, in init
super().init(param_decls, type=type, multiple=multiple, **attrs)
File “/home/erp/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 2112, in init
raise ValueError(
ValueError: ‘default’ must be a list when ‘multiple’ is true.
Usage: bench frappe [OPTIONS] COMMAND [ARGS]…
Try ‘bench frappe --help’ for help.

Error: No such command ‘clear-cache’.

Hi @niraj_regmi,

Command is right but why does not apply :thinking:

Can you enter the site name on [sitename] like

bench --site sitename.com clear-cache
// here sitename.com is my site name.

If you haven’t checked then check the Bench Commands Cheatsheet.

Thank You!

it’s not the only problem with clear-cache apart from bench --help it is not recognizing other commands.

Please update the version and then check it.

bench update

Maybe resolve your issue.

Thank You!

this is in the production server so I cannot update it without taking permission from senior officer. This was working a day before suddenly this happens.
should I try bench setup requirement. Will it work?

Hi @niraj_regmi,

If needed then apply it.

bench setup requirements is a command used to install system-level dependencies required by the applications.

For More Information:
When you create a new Frappe app or install an existing app, it may have dependencies on certain libraries, packages, or system-level tools that need to be installed before the app can be used. These dependencies are listed in the requirements.txt file of the app.

Running the bench setup requirements command installs these dependencies on the system. This command reads the requirements.txt file of the app and installs all the dependencies listed in the file.

Thank You!

hi @NCP,
all bench commands are not working i cannot do bench setup requirements also. anything starts with bench is not working except bench --help.

Hi,

It may help to say the operating environment , versions of frappe and if this is a new installation or one that was working. Have you tried sudo pip3 install frappe-bench --upgrade ? It looks like your python3 version is 3.8, 3.10 is recommended.