Repository navigation
Description
Found while verifying #1247–#1249 (PR #1258) in a fresh worktree. Reproduces on the pristine base (verified via git stash → same failures), so it is not caused by that branch. Every pnpm run dev boot in this worktree fails the auth plugin — .bos/logs/ holds five boot logs, none green, and no successful dev boot has ever run here.
Repro
Fresh clone/worktree → pnpm run setup → pnpm run dev → the boot completes but auth fails:
curl -s localhost:3000/health | jq .status,.auth
# "ready" / "unavailable"
Observed chain (dev-2026-12-02T20-37-21-15636.log and the four earlier sessions)
-
One dev session opens the auth PGlite data dir twice. The auth plugin's
every-plugin devchild opensplugins/auth/.bos/db/authand becomes ready —✅ Plugin ready: @everything-dev/auth-plugin— while the host's in-process auth slot load opens the same dir and hits the kernel lock:Plugin @everything-dev/auth-plugin failed during initialize-plugin: PluginRuntimeError: DatabaseError [stage=driver]: [db] PGlite data dir ".../plugins/auth/.bos/db/auth" is locked by another process (.../.pglite-lock) — held by pid <own-session's auth dev child>The lock holder is always the session's own auth dev child (
ps -p <pid>→every-plugin.mjs dev, parented by thebos devsession pid). So this is not cross-session contention — the dev topology composes two live openers of one data dir within a single session. ADR 0044's preflight refuses same-dir composition at boot, but this composition happens at runtime and is not preflighted. -
The host marks the failure permanent and never recovers.
Failed to load plugin (initialize-plugin) — permanent,/healthreportsauth: unavailablefor the rest of the session — even though the auth dev child is up, healthy (:3002answers 200), and its initialize succeeded on its own retry. There is no adopt/retry path from "dev child ready" to "host slot loaded". Also seen on attempt 1 of the child's own boot: a transientDatabaseError [stage=load]: fetch failed: read ECONNRESET(the api plugin hits the same during the 12-plugin build storm) — the child retries, the host does not. -
The composed SSR plane 500s on every route while auth is down. In the sessions where the host reached SSR composition, the composed tree includes the auth plugin's routeConfig, and loading its SSR remote fails:
[SSR] Ui routeConfig _everything_dev_auth_plugin failed: Failed to load _everything_dev_auth_plugin from http://127.0.0.1:<port>/ssr/remoteEntry.server.js: The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib. #RUNTIME-012 [SSR] <digest> Manifest composition failed for /docs/and/about— core routes with no auth code — 500 withSSR composition failed. One plugin slot's SSR failure cascades to the whole plane instead of degrading that plugin only (compare the runtime load's warn-and-skip contract for unavailable plugin ui sources).
Impact
pnpm run devis unusable for anything touching auth (sign-in, settings, any composed page render) in an affected environment.- It blocks browser-level verification of plugin-UI work — PR feat(everything-dev,every-plugin,ui): ADR 0059 §1/§4 close-out — SSR surface markers, the full ./components expose, and the typed @/ui facade #1258 documents the gap (the migrated
@/uiconsumers carry typecheck + build + chunk evidence but no composed-tree click-through).
What this is not
- Not the kernel flock itself (ADR 0044) — the lock works as designed and correctly refused a corrupting double-open.
- Not the transient ECONNRESET in isolation — the child's retry handles it; the bug is the topology plus the host's permanent-no-retry handling.
Done when
- One dev session never opens the auth PGlite dir from both the plugin dev child and the host's in-process auth slot (either the host proxies auth to the dev child, or the dev child serves the remote without holding the DB — whichever matches the ADR 0051 dev-adopt intent; the preflight should also fail loud on this composition instead of the runtime driver error).
- A transient initialize failure no longer strands the session: the host retries the auth slot load (or the dev adopt recovers it) once the dev child reports ready, instead of
retryable: falseforever. - One plugin slot's SSR compose failure degrades that plugin's routes only — core routes and composed non-auth routes keep rendering.
- A fresh worktree boots
pnpm run devgreen end to end (auth available,/and/aboutSSR 200,/docscomposed) — this is the reproduction environment.
Activity
efizzybot commentedon Dec 2, 2026
Root cause located and the topology half is fixed in PR #1261 (2026-12-02) — cutting the issue down to the remainder per the partial-fix pattern:
What landed (PR #1261, two commits):
AUTH_DATABASE_URL=pglite::memory:on the auth child's env when the zero-config seed is active, so the host's in-process auth slot is the session's sole opener (ADR 0051's division: the child is the artifact server). The preflight grew an opener check (pgliteOpenerCollisions) that failsbos devloud with opener labels when any composition would put two live openers on one file-backed pglite dir — the one-secret-two-processes shape the secrets-per-dir check couldn't see (ADR 0044 amendment).better-near-authto its TS source and the SSR container died onCannot find module './store.js'— web/node environments lacked theextensionAliasthe plugin backend build already sets. That failure degraded boot compose to a 503 on every route and failed host readiness. Fixed in the same PR.Verified in a fresh worktree (the repro environment):
◉ APP READY,/health→ready / auth: ready,/+/about+/docsSSR 200 — done-when 4 green on this PR.Remaining on this issue:
initializefailure still strands the slot:forkDevPluginAdoptrequires captured load args (ADR 0051 amendment, line 97 names the gap); nothing re-runs a boot-failed slot load once the dev child reports ready.efizzybot commentedon Dec 2, 2026
The remainder is now also up as stacked PRs on #1261:
With #1261 (topology + the ui SSR build fix) landing first, all four done-when items are covered.
feat(host): a plugin ui slot's compose failure degrades that slot only (
fix(dev): one opener per dev session for the auth data dir — #1259, p…
feat(host): boot-failed dev slots recover without a restart (#1259 do…
feat(host): boot-failed dev slots recover without a restart (#1259 do…
feat(host): a plugin ui slot's compose failure degrades that slot only (
feat(host): boot-failed dev slots recover without a restart (#1259 do…
feat(host): a plugin ui slot's compose failure degrades that slot only (
feat(host): a plugin ui slot's compose failure degrades that slot only (
efizzybot commentedon Dec 2, 2026
All four done-when items are landed on main, each verified in the fresh-worktree repro environment:
◉ APP READY— /healthready · auth: ready, / + /about + /docs SSR 200.Closing with credit to @efizzybot for the issue's precise failure-chain analysis — the repro environment and the observed chain made every fix targetable.