Skip to main content
← Back to list
01Issue
BugOpenExtensionsPublic
AssigneesNone

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

  1. S3 emulator (ministack), bucket created.
  2. swamp repo init --tool none, then swamp datastore setup extension @swamp/s3-datastore --config '<bucket/endpoint/forcePathStyle config>' --namespace images.
  3. Delete the local cache dir (destinationPath from setup --json) to match a fresh checkout.
  4. swamp datastore migrate-index, then swamp 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).

02Bog Flow
◉OPEN○TRIAGED○IN PROGRESS○SHIPPED

Open

10/12/2026, 10:26:35 AM

No activity in this phase yet.

03Sludge Pulse
Editable. Press Enter to edit.

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.