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 0The WAL checkpoint succeeds, but the subsequent VACUUM operation is skipped entirely.
Steps to Reproduce
- Have a repo configured with
@swamp/s3-datastore - Run
swamp datastore compact - 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:29Environment
- 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.
Shipped
Click a lifecycle step above to view its details.
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.
Sign in to post a ripple.