Skip to content
Latchkey

CI /tmp Directory Full (ENOSPC on tmpfs)

A write to /tmp failed with ENOSPC. Either the temp directory accumulated files or /tmp is a small tmpfs (RAM-backed) mount that filled quickly.

What this error means

A step fails writing to /tmp with No space left on device, often during compression, test fixtures, or a downloaded installer. Clearing /tmp or redirecting TMPDIR fixes it with no code change.

shell
gzip: stdout: No space left on device
mktemp: failed to create file via template '/tmp/build.XXXXXX': No space left on device

Common causes

Temp files accumulated across steps

Tools leave behind temp files; on a reused runner /tmp can fill before a job cleans up.

/tmp is a small tmpfs

When /tmp is RAM-backed and sized small, a large temp write exhausts it even with disk free.

How to fix it

Clear /tmp or point TMPDIR at a bigger path

Reclaim temp space, or redirect temporary writes to the work disk.

shell
df -h /tmp
rm -rf /tmp/* 2>/dev/null
export TMPDIR="$RUNNER_TEMP"

Reduce temp usage per step

  1. Stream large data instead of staging it in /tmp.
  2. Clean up temp files within the step that creates them.
  3. Use a runner with a larger disk for temp-heavy work.

How to prevent it

  • Set TMPDIR to the work volume for temp-heavy jobs.
  • Clean temp files within each step.
  • Right-size disk and tmpfs for the workload.

Frequently asked questions

What causes "/tmp directory full"?
Tools leave behind temp files; on a reused runner /tmp can fill before a job cleans up.
How do I fix /tmp directory full?
Reclaim temp space, or redirect temporary writes to the work disk.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card