Bench Errors when restarting

When I run bench setup requirements I get the below errors

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
lms 2.4.0 requires cairocffi~=1.6.1, but you have cairocffi 1.5.1 which is incompatible.
lms 2.4.0 requires razorpay~=1.4.1, but you have razorpay 1.2.0 which is incompatible.

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
frappe 15.40.5 requires cairocffi==1.5.1, but you have cairocffi 1.6.1 which is incompatible.
payments 0.0.1 requires razorpay~=1.2.0, but you have razorpay 1.4.2 which is incompatible.

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
lms 2.4.0 requires razorpay~=1.4.1, but you have razorpay 1.2.0 which is incompatible.

bench restart

$ sudo supervisorctl restart frappe-bench-web:
frappe-bench-web:frappe-bench-frappe-web: stopped
frappe-bench-web:frappe-bench-frappe-web: started
frappe-bench-web:frappe-bench-node-socketio: ERROR (spawn error)
ERROR: sudo supervisorctl restart frappe-bench-web:
subprocess.CalledProcessError: Command 'sudo supervisorctl restart frappe-bench-web:' returned non-zero exit status 7.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/bench", line 8, in <module>
    sys.exit(cli())
  File "/home/erpnextadmin/.local/lib/python3.10/site-packages/bench/cli.py", line 132, in cli
    bench_command()
  File "/home/erpnextadmin/.local/lib/python3.10/site-packages/bench/commands/utils.py", line 41, in restart
    Bench(".").reload(web, supervisor, systemd)
  File "/home/erpnextadmin/.local/lib/python3.10/site-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
  File "/home/erpnextadmin/.local/lib/python3.10/site-packages/bench/bench.py", line 154, in reload
    restart_supervisor_processes(bench_path=self.name, web_workers=web, _raise=_raise)
  File "/home/erpnextadmin/.local/lib/python3.10/site-packages/bench/utils/bench.py", line 342, in restart_supervisor_processes
    failure = bench.run(f"{sudo}supervisorctl restart {group}", _raise=_raise)
  File "/home/erpnextadmin/.local/lib/python3.10/site-packages/bench/bench.py", line 48, in run
    return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise)
  File "/home/erpnextadmin/.local/lib/python3.10/site-packages/bench/utils/__init__.py", line 178, in exec_cmd
    raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: sudo supervisorctl restart frappe-bench-web:

Hi,

It may help to describe the operating environment and whether this is a new installation or if Frappe bench and the apps were installed and working beforehand.

If this is a new installation , please describe the instructions being followed to install.

If things were working before this happened, try using pip to upgrade the cairocffi and razorpay manually.

OS: Ubuntu 22.04

It was fine and not a new install just that a conflict between Frappe and LMS sing different versions.

Try this comand

bench setup socketio
bench setup supervisor
bench setup redis
sudo supervisorctl reload

Or check this thread
https://discuss.frappe.io/t/bench-restart-socket-io-spawn-error/124271/8?u=vipul_kumar

Thank you the commands worked.

When I tried to run bench update I got a couple of git error and had to manually run git stash for each of the app affected.

Secondly, I am getting an error

find: cannot delete ‘./helpdesk/www/helpdesk/__pycache__/index.cpython-310.pyc’: Permission denied
find: cannot delete ‘./helpdesk/www/helpdesk/__pycache__/__init__.cpython-310.pyc’: Permission denied
find: cannot delete ‘./helpdesk/www/__pycache__/__init__.cpython-310.pyc’: Permission denied
find: cannot delete ‘./helpdesk/api/__pycache__/permission.cpython-310.pyc’: Permission denied
ERROR: find . -name "*.pyc" -delete
subprocess.CalledProcessError: Command 'find . -name "*.pyc" -delete' returned non-zero exit status 1.

Thirdly, I get the below warning

WARN: shallow_clone is set in your bench config.
However without passing the --reset flag, your repositories will be unshallowed.
To avoid this, cancel this operation and run `bench update --reset`.

Consider the consequences of `git reset --hard` on your apps before you run that.
To avoid seeing this warning, set shallow_clone to false in your common_site_config.json

My question is:

  • How do I know the apps that there’re changes to run git stash for all at once?
  • How do I permanent resolve the .pyc error not having to manually delete when updating?
  • The warning, how do I resolve it too?

Thank you very much.

I also get this error while updating

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
lms 2.4.0 requires cairocffi~=1.6.1, but you have cairocffi 1.5.1 which is incompatible.
lms 2.4.0 requires razorpay~=1.4.1, but you have razorpay 1.2.0 which is incompatible.

DEPRECATION: Legacy editable install of helpdesk==0.10.0 from file:///home/erpnextadmin/frappe-bench/apps/helpdesk (setup.py develop) is deprecated. pip 25.0 will enforce this behaviour change. A possible replacement is to add a pyproject.toml or enable --use-pep517, and use setuptools >= 64. If the resulting installation is not behaving as expected, try using --config-settings editable_mode=compat. Please consult the setuptools documentation for more information. Discussion can be found at https://github.com/pypa/pip/issues/11457
$ yarn install --check-files