Skip to main content
← Back to list
01Issue
BugOpenSwamp CLIPublic
AssigneesNone

Relationships

#2671 Concurrent first runs in a fresh repo log 'Catalog migration to per-extension-aggregate-v3 failed (database is locked)'

Opened by stack72 · 9/29/2026

When several swamp processes start at the same moment in a freshly initialized repo, one can log a warning at startup while opening the extension catalog:

[WRN] swamp·persistence·extension-catalog: Catalog migration to per-extension-aggregate-v3 failed (Error: database is locked at ExtensionCatalogStore.runDataMigrationTransaction (src/infrastructure/persistence/extension_catalog_store.ts) at ExtensionCatalogStore.migrateSchema at ExtensionCatalogStore.initializeWithRetry at new ExtensionCatalogStore at configureStartupExtensions (src/cli/mod.ts) code: ERR_SQLITE_ERROR

Seen while testing swamp-club#2571: 6 concurrent 'swamp workflow run' invocations in a new repo (swamp repo init --tool none, then start all runs at once). 1 of 6 runs logged it; the run still succeeded. It happens in startup before any extension auto-resolve, so it is independent of #2571.

The data-migration transaction in migrateSchema hits SQLITE_BUSY when another process holds the write lock, and the catch path logs a warning rather than retrying, even though initializeWithRetry is documented as covering lock retry and backoff. On a fresh catalog the migration presumably has nothing to migrate, so the warning is noise at best; at worst the migration marker is not written and a later run repeats or skips work.

Expected: concurrent processes opening a new catalog either wait for the migration (busy retry) or skip it once another process has applied it, without logging a failure.

Repro: in a new repo, start 4-6 'swamp workflow run' commands at the same moment and grep their output for 'Catalog migration'. Intermittent.

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

Open

9/29/2026, 12:34:56 PM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.