SECURITY WARNING: Never run commands you don't understand. Always review code before execution. Use at your own risk.
System New Added 8 September 2026

bash: fork: retry: Resource temporarily unavailable

The kernel refused to create another process because a limit was reached: the per user process count, the cgroup's pids.max, or the system wide thread maximum. The shell cannot even fork the command that would diagnose it, which is what makes it feel like the machine has locked up.

Quick fix

Read the commands before running them. Anything that restarts a service, deletes data or changes permissions should be tried on a non-production system first.

Quick fix
# Shell builtins still work when fork does not
ulimit -u
cat /proc/sys/kernel/threads-max
cat /sys/fs/cgroup/pids.max

# Who is using them?
ps -eLf | awk '{print $1}' | sort | uniq -c | sort -rn | head

# Raise the per user limit
# /etc/security/limits.d/90-app.conf
app  soft  nproc  8192
app  hard  nproc  16384
# systemd units ignore limits.conf
sudo systemctl edit myapp   # [Service] TasksMax=8192

# Usually a leak: threads or zombies never reaped by the parent

How to diagnose System errors

System-level errors are usually a resource limit being hit: disk, inodes, file descriptors, memory or process count. Two traps recur. "No space left on device" can mean inodes are exhausted while df -h shows free space. And a process that vanished without an error in its own log was almost certainly killed by the OOM killer, which logs to the kernel ring buffer rather than to the application.

If the quick fix above does not resolve it, work through these steps. They apply to this whole class of error, not just to this one message, which is usually what saves the time.

  1. Check both space and inodes: df -h and df -i. Millions of tiny files exhaust inodes long before bytes.
  2. For processes that disappear, search the kernel log: dmesg -T | grep -i -E 'oom|killed process' or journalctl -k.
  3. For systemd units, systemctl status unit then journalctl -u unit -n 200 --no-pager. The status output truncates the useful part.
  4. For "too many open files", check both the limit and the usage: ulimit -n, cat /proc/<pid>/limits, and ls /proc/<pid>/fd | wc -l. systemd services need LimitNOFILE, not a shell ulimit.
  5. For cron jobs that work manually but not scheduled, remember cron has a minimal environment and no PATH. Use absolute paths and log stdout and stderr to a file.

Tools worth reaching for

  • df -h / df -i
  • dmesg -T
  • journalctl -u
  • lsof / ss
  • systemd-analyze blame
  • ncdu

Authoritative references

Primary documentation for this error, worth reading before applying any fix in production.

man7.org

Related System errors

See all 26 System errors →

Browse other categories

Something missing or wrong?

This entry is maintained by hand. If the fix is out of date, incomplete, or you have a better one, email a correction and it will be reviewed.