Trying to setup a frappe website facing issues with bench

Whenever I try to run bench start I get this issue, I have been trying to set up this website since 2-3 weeks but getting a lot of errors here is the error:

I am running this on my windows machine using WSL

(myvenv) pentangletech@DESKTOP-2C5H4RB:~/gsod-test/gsod-test-bench$ bench start
09:38:13 system | redis_queue.1 started (pid=32774)
09:38:13 system | web.1 started (pid=32778)
09:38:13 system | redis_cache.1 started (pid=32771)
09:38:13 system | schedule.1 started (pid=32783)
09:38:13 system | socketio.1 started (pid=32782)
09:38:13 system | watch.1 started (pid=32784)
09:38:13 system | worker.1 started (pid=32788)
09:38:14 redis_cache.1 | 32789:C 06 Mar 2025 09:38:14.047 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
09:38:14 redis_cache.1 | 32789:C 06 Mar 2025 09:38:14.047 # Redis version=7.0.15, bits=64, commit=00000000, modified=0, pid=32789, just started
09:38:14 redis_cache.1 | 32789:C 06 Mar 2025 09:38:14.047 # Configuration loaded
09:38:14 redis_cache.1 | 32789:M 06 Mar 2025 09:38:14.048 * Increased maximum number of open files to 10032 (it was originally set to 1024).
09:38:14 redis_cache.1 | 32789:M 06 Mar 2025 09:38:14.048 * monotonic clock: POSIX clock_gettime
09:38:14 redis_cache.1 | 32789:M 06 Mar 2025 09:38:14.048 # Warning: Could not create server TCP listening socket 127.0.0.1:13000: bind: Address already in use
09:38:14 redis_cache.1 | 32789:M 06 Mar 2025 09:38:14.048 # Failed listening on port 13000 (TCP), aborting.
09:38:14 redis_queue.1 | 32792:C 06 Mar 2025 09:38:14.060 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
09:38:14 redis_queue.1 | 32792:C 06 Mar 2025 09:38:14.060 # Redis version=7.0.15, bits=64, commit=00000000, modified=0, pid=32792, just started
09:38:14 redis_queue.1 | 32792:C 06 Mar 2025 09:38:14.060 # Configuration loaded
09:38:14 redis_queue.1 | 32792:M 06 Mar 2025 09:38:14.061 * Increased maximum number of open files to 10032 (it was originally set to 1024).
09:38:14 redis_queue.1 | 32792:M 06 Mar 2025 09:38:14.061 * monotonic clock: POSIX clock_gettime
09:38:14 redis_queue.1 | 32792:M 06 Mar 2025 09:38:14.061 # Warning: Could not create server TCP listening socket 127.0.0.1:11000: bind: Address already in use
09:38:14 redis_queue.1 | 32792:M 06 Mar 2025 09:38:14.061 # Failed listening on port 11000 (TCP), aborting.
09:38:14 system | redis_cache.1 stopped (rc=1)
09:38:14 system | sending SIGTERM to redis_queue.1 (pid 32774)
09:38:14 system | sending SIGTERM to web.1 (pid 32778)
09:38:14 system | sending SIGTERM to socketio.1 (pid 32782)
09:38:14 system | sending SIGTERM to watch.1 (pid 32784)
09:38:14 system | sending SIGTERM to schedule.1 (pid 32783)
09:38:14 system | sending SIGTERM to worker.1 (pid 32788)
09:38:14 system | redis_queue.1 stopped (rc=1)
09:38:14 system | web.1 stopped (rc=-15)
09:38:14 system | worker.1 stopped (rc=-15)
09:38:14 system | schedule.1 stopped (rc=-15)
09:38:14 system | socketio.1 stopped (rc=-15)
09:38:14 system | watch.1 stopped (rc=-15)

Have you tried restarting your PC? It seems like there’s an issue with your Redis.

Thank you for the suggestion, the restart didn’t help but I started everything from scratch it is now working. But when I try to set it up for production I am getting this error:

(myvenv) pentangletech@DESKTOP-2C5H4RB:~/gsod-test/gsod-bench$ sudo …/myvenv/bin/bench setup production $(whoami)
Setting Up prerequisites…
$ sudo /home/pentangletech/gsod-test/myvenv/bin/python -m pip install ansible
Collecting ansible
Downloading ansible-11.3.0-py3-none-any.whl.metadata (8.0 kB)
Collecting ansible-core~=2.18.3 (from ansible)
Downloading ansible_core-2.18.3-py3-none-any.whl.metadata (7.7 kB)
Requirement already satisfied: jinja2>=3.0.0 in /home/pentangletech/gsod-test/myvenv/lib/python3.12/site-packages (from ansible-core~=2.18.3->ansible) (3.1.6)
Collecting PyYAML>=5.1 (from ansible-core~=2.18.3->ansible)
Downloading PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.1 kB)
Collecting cryptography (from ansible-core~=2.18.3->ansible)
Downloading cryptography-44.0.2-cp39-abi3-manylinux_2_34_x86_64.whl.metadata (5.7 kB)
Collecting packaging (from ansible-core~=2.18.3->ansible)
Downloading packaging-24.2-py3-none-any.whl.metadata (3.2 kB)
Collecting resolvelib<1.1.0,>=0.5.3 (from ansible-core~=2.18.3->ansible)
Downloading resolvelib-1.0.1-py2.py3-none-any.whl.metadata (4.0 kB)
Requirement already satisfied: MarkupSafe>=2.0 in /home/pentangletech/gsod-test/myvenv/lib/python3.12/site-packages (from jinja2>=3.0.0->ansible-core~=2.18.3->ansible) (3.0.2)
Collecting cffi>=1.12 (from cryptography->ansible-core~=2.18.3->ansible)
Downloading cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (1.5 kB)
Collecting pycparser (from cffi>=1.12->cryptography->ansible-core~=2.18.3->ansible)
Downloading pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
Downloading ansible-11.3.0-py3-none-any.whl (54.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.2/54.2 MB 9.0 MB/s eta 0:00:00
Downloading ansible_core-2.18.3-py3-none-any.whl (2.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.2/2.2 MB 10.3 MB/s eta 0:00:00
Downloading PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (767 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 767.5/767.5 kB 9.7 MB/s eta 0:00:00
Downloading resolvelib-1.0.1-py2.py3-none-any.whl (17 kB)
Downloading cryptography-44.0.2-cp39-abi3-manylinux_2_34_x86_64.whl (4.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.2/4.2 MB 11.0 MB/s eta 0:00:00
Downloading packaging-24.2-py3-none-any.whl (65 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.5/65.5 kB 4.3 MB/s eta 0:00:00
Downloading cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (479 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 479.4/479.4 kB 9.1 MB/s eta 0:00:00
Downloading pycparser-2.22-py3-none-any.whl (117 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117.6/117.6 kB 7.0 MB/s eta 0:00:00
Installing collected packages: resolvelib, PyYAML, pycparser, packaging, cffi, cryptography, ansible-core, ansible
Successfully installed PyYAML-6.0.2 ansible-11.3.0 ansible-core-2.18.3 cffi-1.17.1 cryptography-44.0.2 packaging-24.2 pycparser-2.22 resolvelib-1.0.1
$ bench setup role fail2ban
ERROR: [Errno 2] No such file or directory: ‘bench’
Traceback (most recent call last):
File “/home/pentangletech/gsod-test/gsod-bench/…/myvenv/bin/bench”, line 8, in
sys.exit(cli())
^^^^^
File “/home/pentangletech/gsod-test/myvenv/lib/python3.12/site-packages/bench/cli.py”, line 132, in cli
bench_command()
File “/home/pentangletech/gsod-test/myvenv/lib/python3.12/site-packages/click/core.py”, line 1161, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/pentangletech/gsod-test/myvenv/lib/python3.12/site-packages/click/core.py”, line 1082, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File “/home/pentangletech/gsod-test/myvenv/lib/python3.12/site-packages/click/core.py”, line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/pentangletech/gsod-test/myvenv/lib/python3.12/site-packages/click/core.py”, line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/pentangletech/gsod-test/myvenv/lib/python3.12/site-packages/click/core.py”, line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/pentangletech/gsod-test/myvenv/lib/python3.12/site-packages/click/core.py”, line 788, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/pentangletech/gsod-test/myvenv/lib/python3.12/site-packages/bench/commands/setup.py”, line 110, in setup_production
setup_production(user=user, yes=yes)
File “/home/pentangletech/gsod-test/myvenv/lib/python3.12/site-packages/bench/config/production_setup.py”, line 37, in setup_production
setup_production_prerequisites()
File “/home/pentangletech/gsod-test/myvenv/lib/python3.12/site-packages/bench/config/production_setup.py”, line 28, in setup_production_prerequisites
exec_cmd(“bench setup role fail2ban”)
File “/home/pentangletech/gsod-test/myvenv/lib/python3.12/site-packages/bench/utils/init.py”, line 177, in exec_cmd
return_code = subprocess.call(spl_cmd, cwd=cwd, universal_newlines=True, env=env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.12/subprocess.py”, line 389, in call
with Popen(*popenargs, **kwargs) as p:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.12/subprocess.py”, line 1026, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File “/usr/lib/python3.12/subprocess.py”, line 1955, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: ‘bench’

Hi,

Please describe the hosting environment and instructions followed to install Frappe bench.

**try to kill the port **
sudo kill -9 $(sudo lsof -t -i:11000)
in my case it’s 11000 and 13000
sudo kill -9 $(sudo lsof -t -i:13000)

Address already in use
like this"
bench start
18:36:25 system | redis_cache.1 started (pid=387526)
18:36:25 system | redis_queue.1 started (pid=387528)
18:36:25 system | web.1 started (pid=387532)
18:36:25 system | watch.1 started (pid=387535)
18:36:25 system | socketio.1 started (pid=387537)
18:36:25 system | schedule.1 started (pid=387542)
18:36:25 system | worker.1 started (pid=387547)
18:36:25 redis_cache.1 | 387531:C 10 Mar 2025 18:36:25.823 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
18:36:25 redis_cache.1 | 387531:C 10 Mar 2025 18:36:25.823 # Redis version=6.0.16, bits=64, commit=00000000, modified=0, pid=387531, just started
18:36:25 redis_cache.1 | 387531:C 10 Mar 2025 18:36:25.823 # Configuration loaded
18:36:25 redis_queue.1 | 387534:C 10 Mar 2025 18:36:25.823 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
18:36:25 redis_queue.1 | 387534:C 10 Mar 2025 18:36:25.824 # Redis version=6.0.16, bits=64, commit=00000000, modified=0, pid=387534, just started
18:36:25 redis_queue.1 | 387534:C 10 Mar 2025 18:36:25.824 # Configuration loaded
18:36:25 redis_cache.1 | 387531:M 10 Mar 2025 18:36:25.824 * Increased maximum number of open files to 10032 (it was originally set to 1024).
18:36:25 redis_cache.1 | 387531:M 10 Mar 2025 18:36:25.824 # Could not create server TCP listening socket 127.0.0.1:13000: bind: Address already in use
18:36:25 redis_queue.1 | 387534:M 10 Mar 2025 18:36:25.825 * Increased maximum number of open files to 10032 (it was originally set to 1024).
18:36:25 redis_queue.1 | 387534:M 10 Mar 2025 18:36:25.825 # Could not create server TCP listening socket 127.0.0.1:11000: bind: Address already in use
18:36:25 system | redis_cache.1 stopped (rc=1)
18:36:25 system | sending SIGTERM to redis_queue.1 (pid 387528)
18:36:25 system | sending SIGTERM to web.1 (pid 387532)
18:36:25 system | sending SIGTERM to socketio.1 (pid 387537)
18:36:25 system | sending SIGTERM to watch.1 (pid 387535)
18:36:25 system | sending SIGTERM to schedule.1 (pid 387542)
18:36:25 system | sending SIGTERM to worker.1 (pid 387547)
18:36:25 system | worker.1 stopped (rc=-15)
18:36:25 system | watch.1 stopped (rc=-15)
18:36:25 system | redis_queue.1 stopped (rc=-15)
18:36:25 system | web.1 stopped (rc=-15)
18:36:25 system | schedule.1 stopped (rc=-15)
18:36:25 system | socketio.1 stopped (rc=-15)
frappe-bench$ sudo kill -9 $(sudo lsof -t -i:11000)