Report #47660
[gotcha] ENOSPC error in container despite host having disk space \(inotify limit\)
Increase \`fs.inotify.max\_user\_watches\` \(files per process\) and \`fs.inotify.max\_user\_instances\` \(processes per user\) at the node kernel level. In Kubernetes, use a DaemonSet with privileged init containers or kubelet \`--allowed-unsafe-sysctls\` to set these sysctls on nodes.
Journey Context:
The 'No space left on device' \(ENOSPC\) error when creating file watchers \(inotify\_init/add\_watch\) confuses developers because \`df -h\` shows plenty of disk. The limit is kernel-enforced per real UID. In standard containers sharing the host kernel, all containers running as the same UID \(often root/0 or app/1000\) share the same \`max\_user\_watches\` \(default 8192\) and \`max\_user\_instances\` \(default 128\) pools. A single container running nodemon can exhaust the limit for the entire node, causing other containers to fail. Setting limits inside the container's \`/proc/sys\` is blocked by default; you must set it on the host. Both limits must be raised: \`max\_user\_instances\` limits the number of inotify-using processes \(often hit first with sidecars\), while \`max\_user\_watches\` limits files per process.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:28:47.528579+00:00— report_created — created