Bench start command does not work

I already deleted a site and created a new site again
But the bench start command doesn’t work and I get the following error

yawar-frappe@yict:~/frappe-bench$ bench start
14:50:51 system | redis_cache.1 started (pid=20442)
14:50:51 system | redis_queue.1 started (pid=20445)
14:50:51 system | web.1 started (pid=20449)
14:50:51 redis_cache.1 | 20447:C 01 Feb 2024 14:50:51.430 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
14:50:51 redis_cache.1 | 20447:C 01 Feb 2024 14:50:51.430 # Redis version=6.0.16, bits=64, commit=00000000, modified=0, pid=20447, just started
14:50:51 redis_cache.1 | 20447:C 01 Feb 2024 14:50:51.430 # Configuration loaded
14:50:51 redis_cache.1 | 20447:M 01 Feb 2024 14:50:51.431 * Increased maximum number of open files to 10032 (it was originally set to 1024).
14:50:51 redis_queue.1 | 20450:C 01 Feb 2024 14:50:51.432 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
14:50:51 redis_queue.1 | 20450:C 01 Feb 2024 14:50:51.432 # Redis version=6.0.16, bits=64, commit=00000000, modified=0, pid=20450, just started
14:50:51 redis_queue.1 | 20450:C 01 Feb 2024 14:50:51.432 # Configuration loaded
14:50:51 redis_cache.1 | 20447:M 01 Feb 2024 14:50:51.432 * Running mode=standalone, port=13000.14:50:51 redis_cache.1 | 20447:M 01 Feb 2024 14:50:51.433 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
14:50:51 redis_queue.1 | 20450:M 01 Feb 2024 14:50:51.433 * Increased maximum number of open files to 10032 (it was originally set to 1024).
14:50:51 redis_cache.1 | 20447:M 01 Feb 2024 14:50:51.434 # Server initialized
14:50:51 redis_cache.1 | 20447:M 01 Feb 2024 14:50:51.434 * Ready to accept connections
14:50:51 redis_queue.1 | 20450:M 01 Feb 2024 14:50:51.435 * Running mode=standalone, port=11000.14:50:51 redis_queue.1 | 20450:M 01 Feb 2024 14:50:51.435 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
14:50:51 redis_queue.1 | 20450:M 01 Feb 2024 14:50:51.436 # Server initialized
14:50:51 redis_queue.1 | 20450:M 01 Feb 2024 14:50:51.436 * Ready to accept connections
14:50:51 system | schedule.1 started (pid=20457)
14:50:51 system | worker.1 started (pid=20456)
14:50:51 worker.1 | /bin/sh: 1: cannot create logs/worker.log: Permission denied
14:50:51 system | worker.1 stopped (rc=2)
14:50:51 system | watch.1 started (pid=20455)
14:50:51 system | socketio.1 started (pid=20462)
14:50:51 system | sending SIGTERM to redis_cache.1 (pid 20442)
14:50:51 system | sending SIGTERM to redis_queue.1 (pid 20445)
14:50:51 system | sending SIGTERM to web.1 (pid 20449)
14:50:51 system | sending SIGTERM to socketio.1 (pid 20462)
14:50:51 system | sending SIGTERM to watch.1 (pid 20455)
14:50:51 system | sending SIGTERM to schedule.1 (pid 20457)
14:50:51 redis_cache.1 | 20447:signal-handler (1706799051) Received SIGTERM scheduling shutdown…
14:50:51 redis_queue.1 | 20450:signal-handler (1706799051) Received SIGTERM scheduling shutdown…
14:50:51 system | socketio.1 stopped (rc=-15)
14:50:51 system | web.1 stopped (rc=-15)
14:50:51 system | schedule.1 stopped (rc=-15)
14:50:51 system | watch.1 stopped (rc=-15)
14:50:51 redis_cache.1 | 20447:M 01 Feb 2024 14:50:51.534 # User requested shutdown…
14:50:51 redis_cache.1 | 20447:M 01 Feb 2024 14:50:51.534 * Removing the pid file.
14:50:51 redis_cache.1 | 20447:M 01 Feb 2024 14:50:51.534 # Redis is now ready to exit, bye bye…
14:50:51 system | redis_cache.1 stopped (rc=-15)
14:50:51 redis_queue.1 | 20450:M 01 Feb 2024 14:50:51.537 # User requested shutdown…
14:50:51 redis_queue.1 | 20450:M 01 Feb 2024 14:50:51.537 * Removing the pid file.
14:50:51 redis_queue.1 | 20450:M 01 Feb 2024 14:50:51.538 # Redis is now ready to exit, bye bye…
14:50:51 system | redis_queue.1 stopped (rc=-15)

Hi @omid try this:

bench use yoursite
bench start

This command did not solve the problem

yawar-frappe@yict:~/frappe-bench$ bench use yawarerp.com
Current Site set to yawarerp.com
yawar-frappe@yict:~/frappe-bench$ bench start
15:03:37 system | redis_cache.1 started (pid=21078)
15:03:37 system | redis_queue.1 started (pid=21083)
15:03:37 system | web.1 started (pid=21084)
15:03:37 redis_cache.1 | 21082:C 01 Feb 2024 15:03:37.785 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
15:03:37 redis_cache.1 | 21082:C 01 Feb 2024 15:03:37.785 # Redis version=6.0.16, bits=64, commit=00000000, modified=0, pid=21082, just started
15:03:37 redis_cache.1 | 21082:C 01 Feb 2024 15:03:37.786 # Configuration loaded
15:03:37 redis_cache.1 | 21082:M 01 Feb 2024 15:03:37.787 * Increased maximum number of open files to 10032 (it was originally set to 1024).
15:03:37 redis_queue.1 | 21088:C 01 Feb 2024 15:03:37.787 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
15:03:37 redis_queue.1 | 21088:C 01 Feb 2024 15:03:37.787 # Redis version=6.0.16, bits=64, commit=00000000, modified=0, pid=21088, just started
15:03:37 redis_queue.1 | 21088:C 01 Feb 2024 15:03:37.787 # Configuration loaded
15:03:37 redis_queue.1 | 21088:M 01 Feb 2024 15:03:37.788 * Increased maximum number of open files to 10032 (it was originally set to 1024).
15:03:37 redis_cache.1 | 21082:M 01 Feb 2024 15:03:37.788 * Running mode=standalone, port=13000.15:03:37 redis_cache.1 | 21082:M 01 Feb 2024 15:03:37.788 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
15:03:37 redis_cache.1 | 21082:M 01 Feb 2024 15:03:37.789 # Server initialized
15:03:37 redis_queue.1 | 21088:M 01 Feb 2024 15:03:37.789 * Running mode=standalone, port=11000.15:03:37 redis_cache.1 | 21082:M 01 Feb 2024 15:03:37.789 * Ready to accept connections
15:03:37 redis_queue.1 | 21088:M 01 Feb 2024 15:03:37.789 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
15:03:37 redis_queue.1 | 21088:M 01 Feb 2024 15:03:37.790 # Server initialized
15:03:37 redis_queue.1 | 21088:M 01 Feb 2024 15:03:37.791 * Ready to accept connections
15:03:37 system | socketio.1 started (pid=21102)
15:03:37 system | worker.1 started (pid=21091)
15:03:37 system | watch.1 started (pid=21101)
15:03:37 worker.1 | /bin/sh: 1: cannot create logs/worker.log: Permission denied
15:03:37 system | worker.1 stopped (rc=2)
15:03:37 system | schedule.1 started (pid=21095)
15:03:37 system | sending SIGTERM to redis_cache.1 (pid 21078)
15:03:37 system | sending SIGTERM to redis_queue.1 (pid 21083)
15:03:37 system | sending SIGTERM to web.1 (pid 21084)
15:03:37 system | sending SIGTERM to socketio.1 (pid 21102)
15:03:37 system | sending SIGTERM to watch.1 (pid 21101)
15:03:37 system | sending SIGTERM to schedule.1 (pid 21095)
15:03:37 redis_cache.1 | 21082:signal-handler (1706799817) Received SIGTERM scheduling shutdown…
15:03:37 redis_queue.1 | 21088:signal-handler (1706799817) Received SIGTERM scheduling shutdown…
15:03:37 system | web.1 stopped (rc=-15)
15:03:37 system | socketio.1 stopped (rc=-15)
15:03:37 system | schedule.1 stopped (rc=-15)
15:03:37 system | watch.1 stopped (rc=-15)
15:03:37 redis_cache.1 | 21082:M 01 Feb 2024 15:03:37.891 # User requested shutdown…
15:03:37 redis_cache.1 | 21082:M 01 Feb 2024 15:03:37.891 * Removing the pid file.
15:03:37 redis_cache.1 | 21082:M 01 Feb 2024 15:03:37.891 # Redis is now ready to exit, bye bye…
15:03:37 redis_queue.1 | 21088:M 01 Feb 2024 15:03:37.891 # User requested shutdown…
15:03:37 redis_queue.1 | 21088:M 01 Feb 2024 15:03:37.891 * Removing the pid file.
15:03:37 redis_queue.1 | 21088:M 01 Feb 2024 15:03:37.891 # Redis is now ready to exit, bye bye…
15:03:37 system | redis_cache.1 stopped (rc=-15)
15:03:37 system | redis_queue.1 stopped (rc=-15)

15:03:37 worker.1 | /bin/sh: 1: cannot create logs/worker.log: Permission denied

Is this running in a sudo user or a user with permission to create and delete files?

Maybe try sudo chmod -R 777 “home/folder/where/bench/is/located”

I ran the command with sudo bench start but it doesn’t have permission

yawar-frappe@yict:~/frappe-bench$ bench find
/home/yawar-frappe/frappe-bench found!
yawar-frappe@yict:~/frappe-bench$ sudo chmod -R 777 “/home/yawar-frappe/frappe-bench”
yawar-frappe@yict:~/frappe-bench$

The port is still busy :
socket 127.0.0.1:13000: bind: Address already in use
socket 127.0.0.1:11000: bind: Address already in use

I tried this but this solution also not working:
cd frappe-bench #or whatever your bench directory is
git clone GitHub - proenterprise/bench-stop: Script to stop development bench started with bench start
mv ./bench-stop/stop.py .
sudo rm -r ./bench-stop

I used any command to free the port
But Bench start Not working :

yawar-frappe@yict:~/frappe-bench$ bench start
17:13:32 system | redis_cache.1 started (pid=2302)
17:13:32 system | redis_queue.1 started (pid=2303)
17:13:32 system | web.1 started (pid=2307)
17:13:32 redis_cache.1 | 2308:C 01 Feb 2024 17:13:32.436 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
17:13:32 system | socketio.1 started (pid=2315)
17:13:32 redis_queue.1 | 2309:C 01 Feb 2024 17:13:32.439 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
17:13:32 redis_queue.1 | 2309:C 01 Feb 2024 17:13:32.439 # Redis version=6.0.16, bits=64, commit=00000000, modified=0, pid=2309, just started
17:13:32 redis_queue.1 | 2309:C 01 Feb 2024 17:13:32.439 # Configuration loaded
17:13:32 redis_queue.1 | 2309:M 01 Feb 2024 17:13:32.440 * Increased maximum number of open files to 10032 (it was originally set to 1024).
17:13:32 redis_cache.1 | 2308:C 01 Feb 2024 17:13:32.440 # Redis version=6.0.16, bits=64, commit=00000000, modified=0, pid=2308, just started
17:13:32 redis_cache.1 | 2308:C 01 Feb 2024 17:13:32.440 # Configuration loaded
17:13:32 redis_cache.1 | 2308:M 01 Feb 2024 17:13:32.441 * Increased maximum number of open files to 10032 (it was originally set to 1024).
17:13:32 redis_queue.1 | 2309:M 01 Feb 2024 17:13:32.441 # Could not create server TCP listening socket 127.0.0.1:11000: bind: Address already in use
17:13:32 system | redis_queue.1 stopped (rc=1)
17:13:32 system | schedule.1 started (pid=2317)
17:13:32 system | worker.1 started (pid=2314)
17:13:32 redis_cache.1 | 2308:M 01 Feb 2024 17:13:32.444 # Could not create server TCP listening socket 127.0.0.1:13000: bind: Address already in use
17:13:32 system | redis_cache.1 stopped (rc=1)
17:13:32 system | watch.1 started (pid=2319)
17:13:32 system | sending SIGTERM to web.1 (pid 2307)
17:13:32 system | sending SIGTERM to socketio.1 (pid 2315)
17:13:32 system | sending SIGTERM to watch.1 (pid 2319)
17:13:32 system | sending SIGTERM to schedule.1 (pid 2317)
17:13:32 system | sending SIGTERM to worker.1 (pid 2314)
17:13:32 system | watch.1 stopped (rc=-15)
17:13:32 system | worker.1 stopped (rc=-15)
17:13:32 system | socketio.1 stopped (rc=-15)
17:13:32 system | web.1 stopped (rc=-15)
17:13:32 system | schedule.1 stopped (rc=-15)