[DEV] bench start Error: ENOSPC: System limit for number of file watchers reached

Error

08:27:52 watch.1          | Watching...
08:27:53 watch.1          | Browserslist: caniuse-lite is outdated. Please run:
08:27:53 watch.1          | npx browserslist@latest --update-db
08:27:53 watch.1          | Error in: undefined
08:27:53 watch.1          | Error: ENOSPC: System limit for number of file watchers reached, watch '/home/xxx/frappe-bench/apps/frappe/frappe/public/less/variables.less'
08:27:53 watch.1          |     at FSWatcher.start (internal/fs/watchers.js:210:26)
08:27:53 watch.1          |     at Object.watch (fs.js:1444:11)
08:27:53 watch.1          |     at new FileWatcher (/home/xxx/frappe-bench/apps/frappe/node_modules/rollup/dist/rollup.js:37956:33)
08:27:53 watch.1          |     at addTask (/home/xxx/frappe-bench/apps/frappe/node_modules/rollup/dist/rollup.js:37890:36)
08:27:53 watch.1          |     at Task.watchFile (/home/xxx/frappe-bench/apps/frappe/node_modules/rollup/dist/rollup.js:38209:9)
08:27:53 watch.1          |     at /home/xxx/frappe-bench/apps/frappe/node_modules/rollup/dist/rollup.js:38188:39
08:27:53 watch.1          |     at Array.forEach (<anonymous>)
08:27:53 watch.1          |     at /home/xxx/frappe-bench/apps/frappe/node_modules/rollup/dist/rollup.js:38187:58
08:27:53 watch.1          |     at Array.forEach (<anonymous>)
08:27:53 watch.1          |     at /home/xxx/frappe-bench/apps/frappe/node_modules/rollup/dist/rollup.js:38185:41

Solution:

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

Verify updated limit

cat /proc/sys/fs/inotify/max_user_watches
2 Likes