MacOS- Issue with bench start

I am almost about to start my frappe dev site, but I am facing this issue on bench start:

(env) chrisford@Chriss-MBP-2 frappe-bench % bench start
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: pip install frappe-bench

/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py:844: RuntimeWarning: line buffering (buffering=1) isn’t supported in binary mode, the default buffer size will be used
self.stdout = io.open(c2pread, ‘rb’, bufsize)
/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py:844: RuntimeWarning: line buffering (buffering=1) isn’t supported in binary mode, the default buffer size will be used
self.stdout = io.open(c2pread, ‘rb’, bufsize)
/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py:844: RuntimeWarning: line buffering (buffering=1) isn’t supported in binary mode, the default buffer size will be used
self.stdout = io.open(c2pread, ‘rb’, bufsize)
/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py:844: RuntimeWarning: line buffering (buffering=1) isn’t supported in binary mode, the default buffer size will be used
self.stdout = io.open(c2pread, ‘rb’, bufsize)
21:14:30 system | redis_queue.1 started (pid=74414)
21:14:30 system | redis_cache.1 started (pid=74413)
21:14:30 system | redis_socketio.1 started (pid=74415)
/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py:844: RuntimeWarning: line buffering (buffering=1) isn’t supported in binary mode, the default buffer size will be used
self.stdout = io.open(c2pread, ‘rb’, bufsize)
/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py:844: RuntimeWarning: line buffering (buffering=1) isn’t supported in binary mode, the default buffer size will be used
self.stdout = io.open(c2pread, ‘rb’, bufsize)
/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py:844: RuntimeWarning: line buffering (buffering=1) isn’t supported in binary mode, the default buffer size will be used
self.stdout = io.open(c2pread, ‘rb’, bufsize)
21:14:30 redis_cache.1 | 74413:C 28 Aug 2020 21:14:30.490 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
21:14:30 redis_cache.1 | 74413:C 28 Aug 2020 21:14:30.490 # Redis version=6.0.6, bits=64, commit=00000000, modified=0, pid=74413, just started
21:14:30 redis_cache.1 | 74413:C 28 Aug 2020 21:14:30.490 # Configuration loaded
21:14:30 redis_cache.1 | 74413:M 28 Aug 2020 21:14:30.492 * Increased maximum number of open files to 10032 (it was originally set to 2560).
21:14:30 redis_cache.1 | 74413:M 28 Aug 2020 21:14:30.494 * Running mode=standalone, port=13000.
21:14:30 redis_cache.1 | 74413:M 28 Aug 2020 21:14:30.494 # Server initialized
21:14:30 redis_cache.1 | 74413:M 28 Aug 2020 21:14:30.494 * Ready to accept connections
21:14:30 redis_queue.1 | 74414:C 28 Aug 2020 21:14:30.490 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
21:14:30 redis_queue.1 | 74414:C 28 Aug 2020 21:14:30.490 # Redis version=6.0.6, bits=64, commit=00000000, modified=0, pid=74414, just started
21:14:30 redis_queue.1 | 74414:C 28 Aug 2020 21:14:30.490 # Configuration loaded
21:14:30 redis_queue.1 | 74414:M 28 Aug 2020 21:14:30.492 * Increased maximum number of open files to 10032 (it was originally set to 2560).
21:14:30 redis_queue.1 | 74414:M 28 Aug 2020 21:14:30.494 * Running mode=standalone, port=11000.
21:14:30 redis_queue.1 | 74414:M 28 Aug 2020 21:14:30.494 # Server initialized
21:14:30 redis_queue.1 | 74414:M 28 Aug 2020 21:14:30.494 * Ready to accept connections
21:14:30 redis_socketio.1 | 74415:C 28 Aug 2020 21:14:30.492 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
21:14:30 redis_socketio.1 | 74415:C 28 Aug 2020 21:14:30.492 # Redis version=6.0.6, bits=64, commit=00000000, modified=0, pid=74415, just started
21:14:30 redis_socketio.1 | 74415:C 28 Aug 2020 21:14:30.492 # Configuration loaded
21:14:30 redis_socketio.1 | 74415:M 28 Aug 2020 21:14:30.494 * Increased maximum number of open files to 10032 (it was originally set to 2560).
21:14:30 redis_socketio.1 | 74415:M 28 Aug 2020 21:14:30.496 * Running mode=standalone, port=12000.
21:14:30 redis_socketio.1 | 74415:M 28 Aug 2020 21:14:30.496 # Server initialized
21:14:30 redis_socketio.1 | 74415:M 28 Aug 2020 21:14:30.496 * Ready to accept connections
21:14:30 system | socketio.1 started (pid=74418)
21:14:30 socketio.1 | /bin/sh: None: command not found
21:14:30 system | socketio.1 stopped (rc=127)
21:14:30 system | web.1 started (pid=74417)
21:14:30 system | watch.1 started (pid=74419)
21:14:30 system | schedule.1 started (pid=74416)
/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py:844: RuntimeWarning: line buffering (buffering=1) isn’t supported in binary mode, the default buffer size will be used
self.stdout = io.open(c2pread, ‘rb’, bufsize)
/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py:844: RuntimeWarning: line buffering (buffering=1) isn’t supported in binary mode, the default buffer size will be used
self.stdout = io.open(c2pread, ‘rb’, bufsize)
21:14:30 system | worker_short.1 started (pid=74420)
21:14:30 system | worker_long.1 started (pid=74421)
/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py:844: RuntimeWarning: line buffering (buffering=1) isn’t supported in binary mode, the default buffer size will be used
self.stdout = io.open(c2pread, ‘rb’, bufsize)
21:14:30 system | worker_default.1 started (pid=74424)
21:14:30 system | sending SIGTERM to redis_cache.1 (pid 74413)
21:14:30 system | sending SIGTERM to redis_socketio.1 (pid 74415)
21:14:30 system | sending SIGTERM to redis_queue.1 (pid 74414)
21:14:30 system | sending SIGTERM to web.1 (pid 74417)
21:14:30 system | sending SIGTERM to watch.1 (pid 74419)
21:14:30 system | sending SIGTERM to schedule.1 (pid 74416)
21:14:30 system | sending SIGTERM to worker_short.1 (pid 74420)
21:14:30 system | sending SIGTERM to worker_long.1 (pid 74421)
21:14:30 system | sending SIGTERM to worker_default.1 (pid 74424)
21:14:30 redis_queue.1 | 74414:signal-handler (1598667270) Received SIGTERM scheduling shutdown…
21:14:30 redis_socketio.1 | 74415:signal-handler (1598667270) Received SIGTERM scheduling shutdown…
21:14:30 redis_cache.1 | 74413:signal-handler (1598667270) Received SIGTERM scheduling shutdown…
21:14:30 system | worker_long.1 stopped (rc=-15)
21:14:30 system | schedule.1 stopped (rc=-15)
21:14:30 system | watch.1 stopped (rc=-15)
21:14:30 system | worker_short.1 stopped (rc=-15)
21:14:30 system | web.1 stopped (rc=-15)
21:14:30 system | worker_default.1 stopped (rc=-15)
21:14:30 redis_queue.1 | 74414:M 28 Aug 2020 21:14:30.596 # User requested shutdown…
21:14:30 redis_cache.1 | 74413:M 28 Aug 2020 21:14:30.596 # User requested shutdown…
21:14:30 redis_queue.1 | 74414:M 28 Aug 2020 21:14:30.596 * Removing the pid file.
21:14:30 redis_socketio.1 | 74415:M 28 Aug 2020 21:14:30.596 # User requested shutdown…
21:14:30 redis_cache.1 | 74413:M 28 Aug 2020 21:14:30.596 * Removing the pid file.
21:14:30 redis_cache.1 | 74413:M 28 Aug 2020 21:14:30.596 # Redis is now ready to exit, bye bye…
21:14:30 redis_socketio.1 | 74415:M 28 Aug 2020 21:14:30.596 * Removing the pid file.
21:14:30 redis_queue.1 | 74414:M 28 Aug 2020 21:14:30.596 # Redis is now ready to exit, bye bye…
21:14:30 redis_socketio.1 | 74415:M 28 Aug 2020 21:14:30.596 # Redis is now ready to exit, bye bye…
21:14:30 system | redis_cache.1 stopped (rc=0)
21:14:30 system | redis_socketio.1 stopped (rc=0)
21:14:30 system | redis_queue.1 stopped (rc=0)

try this…and then restart bench…

echo fs.inotify.max_user_watches=262144 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p;

If it still fails, up the max_user_watches=262144 to max_user_watches=524288 and do it again

This is the error I get on that script:
fs.inotify.max_user_watches=524288
sysctl: illegal option – p
usage: sysctl [-bdehiNnoqx] name[=value] …
sysctl [-bdehNnoqx] -a

I am doing some research on what causes this.

@christopher,
What version of MacOS?
What version of Bench?

In my case, the ports were used and it worked after killing the process running on the port.

Command to kill the process running on the port:
sudo lsof -t -i tcp:12000 -s tcp:listen | sudo xargs kill

[Replace the port number with the one from the error]