Skip to main content
← Back to list
01Issue
BugShippedSwamp CLI
Assigneesstack72

Relationships

#494 datastore compact VACUUM fails with ERR_SQLITE_ERROR

Opened by webframp · 5/30/2026· Shipped 5/31/2026

Description

swamp datastore compact fails during the VACUUM step with:

WRN swamp·persistence·catalog VACUUM skipped: Error: too many attached databases - max 0

The WAL checkpoint succeeds, but the subsequent VACUUM operation is skipped entirely.

Steps to Reproduce

  1. Have a repo configured with @swamp/s3-datastore
  2. Run swamp datastore compact
  3. Observe the VACUUM warning in output

Expected Behavior

VACUUM should complete successfully after WAL checkpoint, reclaiming space in the SQLite catalog.

Actual Behavior

VACUUM is skipped with ERR_SQLITE_ERROR — the error message references "too many attached databases - max 0", suggesting the SQLite connection has attached databases that prevent VACUUM, or the max_attached limit is set to 0 in the Deno compile environment.

Stack Trace

at CatalogStore.vacuum (catalog_store.ts:584:15)
at Object.vacuum (datastore_compact.ts:77:34)
at compact.ts:63:29

Environment

  • swamp version: 20260530.005533.0-sha.1c117111
  • Platform: macOS Darwin 24.6.0 (arm64)
  • Datastore: @swamp/s3-datastore (S3 bucket: webframp-s3-swampdata, us-east-1)

Notes

The WAL checkpoint still reclaims some space, so this is not data-loss. But the full VACUUM (which rewrites the SQLite file to reclaim fragmented pages) never runs.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 5 MOREREVIEW+ 3 MOREPR_MERGED+ 1 MORECONTRIBUTOR_NOTIFIED

Shipped

5/31/2026, 9:41:25 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack725/31/2026, 8:57:13 PM
Editable. Press Enter to edit.

webframp commented 5/30/2026, 10:42:40 PM

Additional context: the VACUUM failure happens specifically on the catalog_store SQLite database used by the S3 datastore adapter. WAL checkpoint completes successfully (as evidenced by the 'checkpointed X pages' message just before the error), but the subsequent VACUUM call fails. The 'max 0' in the error suggests the internal SQLite connection may have SQLITE_LIMIT_ATTACHED set to 0, preventing VACUUM from creating its temporary attached database.

stack72 commented 5/31/2026, 9:41:31 PM

Thanks @webframp for reporting this! The fix has been merged and a release is on its way. We appreciate your contribution to swamp.

Sign in to post a ripple.