sccache "failed to store" cache object in CI
sccache compiled successfully but could not write the result to its cache backend. Builds still pass, but nothing is persisted, so subsequent runs get no hits and rebuild from scratch.
What this error means
Logs show "sccache: error: failed to store" or write errors, and sccache --show-stats reports "Cache writes errors" climbing while hits stay flat across runs.
Cache hits 0
Cache misses 812
Cache write errors 812
Failed distributed compilations 0Common causes
The backend denies writes
A read-only token, a bucket policy without PutObject, or a full/expired backend prevents storing results even when reads work.
The GHA cache write was skipped
On the GitHub Actions backend, writes only persist when the job succeeds and the token is valid; a missing token drops writes silently.
How to fix it
Grant write access to the backend
- Confirm the token/key allows writes (PutObject, SET, cache upload).
- Check for a full or quota-limited backend.
- Re-run and watch "Cache write errors" drop to zero in stats.
sccache --show-stats | grep -Ei 'write|store'Ensure the GHA token is present for writes
For the Actions cache backend, keep the runtime token exposed so end-of-job writes are accepted.
env:
SCCACHE_GHA_ENABLED: "true"How to prevent it
- Give the cache token write scope, not just read.
- Watch "Cache write errors" in
sccache --show-statsas a CI signal. - Keep the backend within quota and the GHA token valid.