Bench start immediately stops again

Hi all,

after a current update in a development system, when we try to start

$ bench start

the bench starts up, but after building css/js, it throws this error

16:53:25 watch.1          | Wrote js/erpnext.min.js - 169.56 KB
16:53:25 watch.1          | Wrote js/item-dashboard.min.js - 8.22 KB
16:53:29 watch.1          | events.js:160
16:53:29 watch.1          |       throw er; // Unhandled 'error' event
16:53:29 watch.1          |       ^
16:53:29 watch.1          | 
16:53:29 watch.1          | Error: watch /home/frappe/frappe-bench/apps/erpnext/erpnext/docs/user/manual/es/projects/articles ENOSPC
16:53:29 watch.1          |     at exports._errnoException (util.js:1020:11)
16:53:29 watch.1          |     at FSWatcher.start (fs.js:1451:19)
16:53:29 watch.1          |     at Object.fs.watch (fs.js:1478:11)
16:53:29 watch.1          |     at createFsWatchInstance (/home/frappe/frappe-bench/node_modules/chokidar/lib/nodefs-handler.js:37:15)
16:53:29 watch.1          |     at setFsWatchListener (/home/frappe/frappe-bench/node_modules/chokidar/lib/nodefs-handler.js:80:15)
16:53:29 watch.1          |     at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/frappe/frappe-bench/node_modules/chokidar/lib/nodefs-handler.js:228:14)
16:53:29 watch.1          |     at FSWatcher.NodeFsHandler._handleDir (/home/frappe/frappe-bench/node_modules/chokidar/lib/nodefs-handler.js:407:19)
16:53:29 watch.1          |     at FSWatcher.<anonymous> (/home/frappe/frappe-bench/node_modules/chokidar/lib/nodefs-handler.js:455:19)
16:53:29 watch.1          |     at FSWatcher.<anonymous> (/home/frappe/frappe-bench/node_modules/chokidar/lib/nodefs-handler.js:460:16)
16:53:29 watch.1          |     at FSReqWrap.oncomplete (fs.js:123:15)
16:53:29 system           | watch.1 stopped (rc=0)
16:53:29 system           | sending SIGTERM to redis_socketio.1 (pid 3971)
16:53:29 system           | sending SIGTERM to worker_long.1 (pid 3988)

and shuts down again. bench migrate/bench update work fine (no errors), nodejs is on the current version. Any clues?

Edit: the affected file in the “error” is not always the same… also seen it on

Error: watch /home/frappe/frappe-bench/apps/erpnext/erpnext/docs/user/manual/es/schools/student

Hi @achillesrasquinha,

thanks for pointing me in the right direction. Altough space was sufficient, it was an access issue. The manuals were owned by another user than frappe and this has cased the watch process to fail

$ sudo chown -R frappe:frappe *

resolved the issue, bench start works fine again :wink:

Edit: Actual long term solution:

$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
$ sudo sysctl --system
3 Likes