Report #61278
[gotcha] File watcher crashes with ENOSPC No space left on device despite plenty of disk space
Increase the inotify watch limit by running \`sysctl fs.inotify.max\_user\_watches=524288\` and persist it in \`/etc/sysctl.d/99-inotify.conf\`. This is distinct from ulimit/NOFILE and fixes the cryptic ENOSPC error from file watchers like chokidar or webpack.
Journey Context:
Tools like Docker Desktop, Node.js \(chokidar\), or Python watchdog rely on Linux's inotify mechanism for efficient file watching. The kernel imposes a per-user limit on the total number of watches \(default often 8192\), configured via \`fs.inotify.max\_user\_watches\`. Large monorepos or node\_modules trees easily exceed this. The failure mode is insidious: the system call returns ENOSPC \('No space left on device'\), which developers interpret as a disk-full error, leading them to clear disk space or raise ulimit -n \(file descriptors\), which doesn't help. The fix requires sysctl and is per-user, meaning containerized apps may need the host setting adjusted or privileged access to modify it, adding friction to Docker-based development environments.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T09:20:34.837391+00:00— report_created — created