You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Snapshot cleanup fails forever and leaks tmp_pack_* after project gc prunes shared objects #46034
The hourly snapshot cleanup (git gc --prune=7.days) started failing with fatal: unable to read <sha> / fatal: failed to run repack and never recovered. The snapshot repo shares the project object database via objects/info/alternates (the seed() mechanism). After running git gc (history rewrite) in the project, objects the snapshot still referenced were pruned from the project object store. Every hourly gc attempt now dies on the same missing object and leaves an orphaned tmp_pack_* (~90MB each) in objects/pack/. cleanup() logs "cleanup failed" and returns without removing anything, so the repo never recovers. My snapshot folder reached 62GB: 699 tmp_pack files, 699 identical "cleanup failed" log entries, git count-objects shows garbage: 699 / size-garbage: 61.69 GiB. This is a second failure mode of the known tmp_pack leak (#14811, #10034, #8749): those report interrupted gc; this one is a deterministic, permanent failure.
Plugins
none
OpenCode version
1.18.25
Steps to reproduce
Open a project and let the snapshot seed its alternates from the project .git/objects
Run git gc in the project (or rewrite history / force-push) so old objects are pruned
Keep an opencode session running — the hourly snapshot cleanup fails every time
Check the log for repeated "cleanup failed" and count tmp_pack_* files growing in ~/.local/share/opencode/snapshot/<hash>/objects/pack/
This issue fails with exitCode=128 and fatal: unable to read <sha> / failed to run repack: gc runs and dies on objects the project's own git gc pruned from the shared object database (via the seed() alternates). Each failed repack leaves a tmp_pack_* behind — 699 files / 61.7GB on my machine.
PR #46037 addresses this issue's mode: prune stale tmp_pack_* after every gc run (success or failure) and rebuild the snapshot store when gc fails on missing objects. It intentionally does not fire on the spawn-error case — there the store is not corrupted, so deleting it would be wrong.
Activity
github-actions commentedon Aug 28, 2026
This issue might be a duplicate of or related to existing issues. Please check:
arthurjd commentedon Aug 29, 2026
#43877 is related but not a duplicate — it's a different failure mode with a different fix:
exitCode=1and aChildProcess.spawnerror: the gc process never starts, so no repack temp files are produced (the bloat there is loose objects that gc never gets to prune).exitCode=128andfatal: unable to read <sha>/failed to run repack: gc runs and dies on objects the project's owngit gcpruned from the shared object database (via theseed()alternates). Each failed repack leaves atmp_pack_*behind — 699 files / 61.7GB on my machine.PR #46037 addresses this issue's mode: prune stale
tmp_pack_*after every gc run (success or failure) and rebuild the snapshot store when gc fails on missing objects. It intentionally does not fire on the spawn-error case — there the store is not corrupted, so deleting it would be wrong.thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊