Report #21271
[gotcha] Lambda function runs out of disk space or leaks data between invocations
Always clean up /tmp files before handler returns \(especially in warm starts\), or use /tmp only for caching derived data that is safe to share; monitor Lambda ephemeral storage utilization
Journey Context:
Lambda reuses execution contexts \(warm starts\). /tmp is writable and persists between invocations of the same instance. Developers assume ephemeral means clean slate every time. This causes two issues: \(1\) Disk full - downloading files to /tmp on each invocation without cleanup eventually fills the 512MB \(or configured 10GB\) limit. \(2\) Data leakage - temp files containing sensitive data from invocation N are visible to invocation N\+1. Common wrong fix is using /tmp as a scratch pad without UUIDs or cleanup. Right pattern is to use ephemeral storage only for derived/cached data or clean up explicitly in finally blocks. Tradeoff is speed \(reusing derived data\) vs isolation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T14:06:46.059272+00:00— report_created — created