Relationships
#3280 s3-datastore: first push on a fresh cache prints 'Index merge failed' for a missing local .datastore-index.json
Opened by stack72 · 10/12/2026
What happens
On a fresh local cache (a checkout that has never written data), swamp datastore sync --push against an @swamp/s3-datastore datastore prints:
Pushed 0 files
[s3-sync] Index merge failed, fast path stays unarmed: NotFound: No such file or directory (os error 2): readfile '~/.swamp/repos/<repoId>/.datastore-index.json'The push succeeds. Only the message is wrong.
Cause
@swamp/s3-datastore 2026.10.08.1, datastores/_lib/s3_cache_sync.ts (index writeback, around line 2309). When the in-memory index is partial, the writeback merges into the on-disk .datastore-index.json. In a fresh cache that file does not exist yet, so Deno.readTextFile throws NotFound and the catch prints the warning.
Leaving the fast path unarmed is the correct outcome here: with no complete on-disk baseline there is nothing to merge. Only the warning is wrong.
Suggested fix
In the merge branch, treat Deno.errors.NotFound on the on-disk index as "nothing to merge": return false without printing. Keep the warning for other errors (corrupt JSON, permission denied).
Steps to reproduce
- S3 emulator (ministack), bucket created.
swamp repo init --tool none, thenswamp datastore setup extension @swamp/s3-datastore --config '<bucket/endpoint/forcePathStyle config>' --namespace images.- Delete the local cache dir (
destinationPathfrom setup --json) to match a fresh checkout. swamp datastore migrate-index, thenswamp datastore sync --push.
Seen with both the released swamp (20261011.154850.0-sha.d650cb70) and the swamp-club#3277 branch build. Found while verifying swamp-club#3277 (catalog export ENOENT on the same first push).
Open
No activity in this phase yet.
system commented 10/12/2026, 10:26:35 AM
Classified automatically when this issue was filed.
- Source: Extensions
If you feel this classification is incorrect, add a ripple to tell us so.
Sign in to post a ripple.