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

Relationships

#518 swamp repo upgrade: ERR_SQLITE_ERROR 'attempt to write a readonly database' during extension catalog schema migration

Opened by stack72 · 6/1/2026· Shipped 6/1/2026

Description

Reported as a "possibly related" side-note in swamp-club#506 and split out here as its own issue.

swamp repo upgrade fails with a SQLite write error when migrating the schema of an older-swamp extension catalog DB:

ERR_SQLITE_ERROR: attempt to write a readonly database
  at ExtensionCatalogStore.addNewColumnsIfMissing (extension_catalog_store.ts:305)

The migration (addNewColumnsIfMissing, adding new columns to an existing .swamp/_extension_catalog.db) opens or treats the catalog DB as read-only and then attempts a write (ALTER TABLE/column add), which fails.

Steps to reproduce

  1. Have a repo whose .swamp/_extension_catalog.db was created by an older swamp version (one schema version behind the column set addNewColumnsIfMissing expects).
  2. Run swamp repo upgrade.
  3. Observe the ERR_SQLITE_ERROR: attempt to write a readonly database at ExtensionCatalogStore.addNewColumnsIfMissing (extension_catalog_store.ts:305).

Workaround

The catalog DB is gitignored and regenerable — moving .swamp/_extension_catalog.db aside lets the upgrade proceed (it rebuilds the catalog).

Expected

The catalog schema migration during repo upgrade should open the DB read-write (or otherwise have write access) before attempting addNewColumnsIfMissing, so the upgrade succeeds without requiring the user to manually delete the catalog DB.

Environment

  • swamp 20260531.214843.0-sha.ec32aaab (as reported on swamp-club#506)
  • deno 2.7.12, macOS (Apple Silicon)

Notes

  • Likely a connection-open-mode issue (read-only handle reused for a migration write) and/or a missing "open read-write for migration" path in ExtensionCatalogStore.
  • Suggest verifying the open mode at extension_catalog_store.ts:305 and ensuring migrations acquire a writable connection.
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 3 MOREPR_MERGED+ 1 MORENOTIFICATION_SKIPPED

Shipped

6/1/2026, 10:47:55 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack726/1/2026, 9:33:04 PM

Sign in to post a ripple.