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

Relationships

#574 extension rm blocked by stale /workspace bundle_types rows from prior container sessions with host repo bind-mounted

Opened by bixu · 6/6/2026· Shipped 6/6/2026

Summary

swamp extension rm <name> fails with a rollback when the local catalog (.swamp/_extension_catalog.db) has stale bundle_types rows pointing at paths that don't exist on the host. The integrity check (I-Repo-1) flags a "type claimed by two paths" violation against a phantom entry and refuses the write.

Repro

  1. Use the same repo from both a host shell (/Users/<me>/...) and a container that bind-mounts the host repo at a different in-container path (e.g. /workspace/...). Both record themselves in bundle_types.source_path.
  2. Exit the container — the in-container path rows are not pruned.
  3. Pull a newer version of any extension on the host (e.g. @swamp/s3-datastore). Now two rows claim the same type_normalized at different source_paths and different versions.
  4. Run swamp extension rm <any-extension> --force. Fails with:
I-Repo-1 violation: type "@swamp/s3-datastore" (kind=datastore) claimed by both
@swamp/s3-datastore@<old> at /Users/<me>/.../.swamp/pulled-extensions/@swamp/s3-datastore/datastores/s3.ts
and @swamp/s3-datastore@<new> at /workspace/.swamp/pulled-extensions/@swamp/s3-datastore/datastores/s3.ts.
ROLLBACK applied.

The blocked extension has nothing to do with @swamp/s3-datastore; the violation is pre-existing state that blocks every catalog write.

Workaround

sqlite3 .swamp/_extension_catalog.db "DELETE FROM bundle_types WHERE source_path LIKE '/workspace%'"

Removed 25 rows in my case (a container with the host repo bind-mounted at /workspace had registered its in-container paths over multiple sessions). After the delete, extension rm worked.

Suggested fix

One or more of:

  • Prune bundle_types rows whose source_path doesn't resolve on disk before running integrity checks (cheap pre-flight on every catalog write).
  • Namespace catalog rows by host fingerprint so a container's view and the host's view don't share a SQLite file even when the repo dir is bind-mounted.
  • Add a swamp extension repair (or swamp doctor) command to surface and clear unreachable rows without needing direct SQL.

Related prior art: Lab #310 (extension source rm leaves stale @local/. rows) — same family of catalog-hygiene gap.

Environment

  • swamp 20260605.235921.0-sha.e3a85856
  • macOS host (Darwin 25.4.0); the /workspace/... rows came from container sessions where the host repo was bind-mounted at /workspace.
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 3 MOREPR_MERGED+ 1 MORECONTRIBUTOR_NOTIFIED

Shipped

6/6/2026, 11:39:09 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack726/6/2026, 10:14:05 PM
Editable. Press Enter to edit.

stack72 commented 6/6/2026, 11:39:16 PM

Thanks @bixu 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.