Bench restart error (spawn error)

This is a new installation and in production mode.
All is done and I can see the nginx default page.
But when bench restart I got:

frappe-bench-web:frappe-bench-node-socketio: stopped
frappe-bench-web:frappe-bench-frappe-web: stopped
frappe-bench-workers:frappe-bench-frappe-schedule: ERROR (spawn error)
frappe-bench-workers:frappe-bench-frappe-default-worker-0: ERROR (spawn error)
frappe-bench-workers:frappe-bench-frappe-short-worker-0: ERROR (spawn error)
frappe-bench-workers:frappe-bench-frappe-long-worker-0: ERROR (spawn error)
frappe-bench-web:frappe-bench-frappe-web: started
frappe-bench-web:frappe-bench-node-socketio: started

Why?
And how to solve?
Thank you

1 Like

Could you try the following:

sudo supervisorctl restart all

(based on: [solved] production server - redis spawn error )

2 Likes

Run sudo supervisorctl restart all and got this:

frappe-bench-redis:frappe-bench-redis-cache: stopped
frappe-bench-redis:frappe-bench-redis-queue: stopped
frappe-bench-redis:frappe-bench-redis-socketio: stopped
frappe-bench-web:frappe-bench-node-socketio: stopped
frappe-bench-web:frappe-bench-frappe-web: stopped
frappe-bench-workers:frappe-bench-frappe-schedule: ERROR (spawn error)
frappe-bench-workers:frappe-bench-frappe-default-worker-0: ERROR (spawn error)
frappe-bench-workers:frappe-bench-frappe-short-worker-0: ERROR (spawn error)
frappe-bench-workers:frappe-bench-frappe-long-worker-0: ERROR (spawn error)
frappe-bench-redis:frappe-bench-redis-cache: started
frappe-bench-redis:frappe-bench-redis-queue: started
frappe-bench-redis:frappe-bench-redis-socketio: started
frappe-bench-web:frappe-bench-frappe-web: started
frappe-bench-web:frappe-bench-node-socketio: started

It’s the workers that are error.
The pause-scheduler in common_site_config.json has been set to 0.

Run sudo supervisorctl status:

frappe-bench-redis:frappe-bench-redis-cache                 RUNNING   pid 7102, uptime 0:01:27
frappe-bench-redis:frappe-bench-redis-queue                 RUNNING   pid 7103, uptime 0:01:27
frappe-bench-redis:frappe-bench-redis-socketio              RUNNING   pid 7104, uptime 0:01:27
frappe-bench-web:frappe-bench-frappe-web                    RUNNING   pid 7105, uptime 0:01:27
frappe-bench-web:frappe-bench-node-socketio                 RUNNING   pid 7106, uptime 0:01:27
frappe-bench-workers:frappe-bench-frappe-default-worker-0   FATAL     Exited too quickly (process log may have details)
frappe-bench-workers:frappe-bench-frappe-default-worker-1   FATAL     Exited too quickly (process log may have details)
frappe-bench-workers:frappe-bench-frappe-default-worker-2   FATAL     Exited too quickly (process log may have details)
frappe-bench-workers:frappe-bench-frappe-long-worker-0      FATAL     Exited too quickly (process log may have details)
frappe-bench-workers:frappe-bench-frappe-long-worker-1      FATAL     Exited too quickly (process log may have details)
frappe-bench-workers:frappe-bench-frappe-long-worker-2      FATAL     Exited too quickly (process log may have details)
frappe-bench-workers:frappe-bench-frappe-schedule           FATAL     Exited too quickly (process log may have details)
frappe-bench-workers:frappe-bench-frappe-short-worker-0     FATAL     Exited too quickly (process log may have details)
frappe-bench-workers:frappe-bench-frappe-short-worker-1     FATAL     Exited too quickly (process log may have details)
frappe-bench-workers:frappe-bench-frappe-short-worker-2     FATAL     Exited too quickly (process log may have details)

From the logs/worker.error.log gets a lot of this:

supervisor: couldn't exec /root/.local/bin/bench: EACCES
supervisor: child process was not spawned

Run bench src:

/home/punia/.local/lib/python3.6/site-packages

Run which bench:

~/.local/bin/bench

Run sudo which bench:

/root/.local/bin/bench

Now when bench restart I get this (the error is no file)

$ supervisorctl restart frappe-bench-workers: frappe-bench-web:
frappe-bench-web: frappe-bench-node-socketio: stopped
frappe-bench-web: frappe-bench-frappe-web: stopped
frappe-bench-workers: frappe-bench-frappe-schedule: ERROR (no such file)
frappe-bench-workers: frappe-bench-frappe-default-worker-0: ERROR (no such file)
frappe-bench-workers: frappe-bench-frappe-default-worker-1: ERROR (no such file)
frappe-bench-workers: frappe-bench-frappe-default-worker-2: ERROR (no such file)
frappe-bench-workers: frappe-bench-frappe-short-worker-0: ERROR (no such file)
frappe-bench-workers: frappe-bench-frappe-short-worker-1: ERROR (no such file)
frappe-bench-workers: frappe-bench-frappe-short-worker-2: ERROR (no such file)
frappe-bench-workers: frappe-bench-frappe-long-worker-0: ERROR (no such file)
frappe-bench-workers: frappe-bench-frappe-long-worker-1: ERROR (no such file)
frappe-bench-workers: frappe-bench-frappe-long-worker-2: ERROR (no such file)
frappe-bench-web: frappe-bench-frappe-web: started
frappe-bench-web: frappe-bench-node-socketio: started

I don’t know if this is related, but I run sudo systemctl status *
and get these:

Unit apps.service could not be found.
Unit archived_sites.service could not be found.
Unit config.service could not be found.
Unit env.service could not be found.
Unit logs.service could not be found.
Unit patches.txt.service could not be found.
Unit Procfile.service could not be found.
Unit sites.service could not be found.

I wonder how you have resolved this, as I’m facing the same problem.

I forgot. But I think I enabled and started each services one by one manually with
sudo systemctl enable (or start) servicename

1 Like

@aymangabir Hi… how did you solved this error, I have the same error. Do you have any idea?

These commands helped me

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

Worked for me. Thanks.

1 Like

I am also facing same issue.

tried these command but not working.

This worked for me too. Thanks

Are you still facing the issue?

I am also facing the same issue.

While doing bench restart getting bellow error.

ERROR: supervisorctl restart frappe-bench-workers: frappe-bench-web:

subprocess.CalledProcessError: Command 'supervisorctl restart frappe-bench-workers: frappe-bench-web:' returned non-zero exit status 7.

bench --site all list-apps

ModuleNotFoundError: No module named 'hospitality'

It has worked for me. Execute above all 4 commands inside erpnext installation directory with erpnext (user using which it has been setup) user.

14 Likes

Love you man! Thanks it worked for me

2 Likes

Still facing this issue.