Repository navigation
[Bug]: Driver 'codex' failed to create instance: Cannot create Codex shadow home entry '.sqlite-maintenance.lock' #15138
Description
Activity
Note
Grok responding on behalf of Julius.
Triage
Thanks @rajiitmandi21 for the clear report and for comparing the affected and working shadow homes! I confirmed this on
v0.0.45and on currentmain(263097a8).CodexHomeLayouthasn't changed between them, so a newer build won't avoid this. It's the same kind of startup failure as #5817 (open), but.sqlite-maintenance.lockisn't a SQLite database file, so I'm keeping this open as its own issue.What happens
Auth-overlay accounts run Codex with
CODEX_HOMEset to the shadow home. T3 doesn't setCODEX_SQLITE_HOME, so the shadow directory is also Codex's SQLite home. In Codex 0.160.0, the reclamation worker creates<sqlite home>/.sqlite-maintenance.lockand takes an advisory lock on it (try_ownershipinreclamation.rsatrust-v0.160.0). The file is empty and holds no database contents.On the next startup,
materializeCodexShadowHomesymlinks every shared-home entry that isn't private (auth.json,models_cache.json) or shadow-local (log,memories,tmp). This lock file isn't in either set. When the shadow copy is already a regular file,ensureSymlinkraisesCodexShadowHomeEntryConflictErrorand the provider gets disabled. Today the only entry that can be replaced is themcp-oauth-locksdirectory.The symlink on your working account is the layout T3 is trying to create, and it's the right one. The lock elects a single reclamation worker per SQLite home, and these accounts already share the SQLite databases through symlinks. A separate lock file in each shadow home would let two workers reclaim the same databases. Replacing the 0-byte shadow file doesn't throw away any session or SQLite data.
Likely fix area
When
.sqlite-maintenance.lockin the shadow home is a regular file, replace it with a symlink to the shared home's lock, the same waymcp-oauth-locksis handled, and let provider startup continue. A fix that only special-cases*.sqlite,-wal, and-shm(like the closed, unmerged #7201 and #9229 for #5817) wouldn't cover this filename. A maintainer will decide on the fix direction.Workaround
Your workaround is the right recovery. Stop any Codex processes that might hold the lock, remove the regular file from the shadow home, and symlink it to the shared lock. Then restart T3. Don't delete
auth.jsonor any*.sqlitefiles.- addedbugSomething is broken or behaving incorrectly.Something is broken or behaving incorrectly.via-triageFiled through npx t3 triageFiled through npx t3 triage
on Oct 3, 2026 Confirmed on Linux x86_64 with T3 Code Nightly
0.0.46-nightly.20261003.2632, build commitf391794a35c604d57e166a3ab48d56fc6e4e469a, andcodex-cli 0.160.0.The second Codex instance uses the documented shared-home plus shadow-home layout. Its persisted provider configuration has
enabled: true. Both<shared-home>/.sqlite-maintenance.lockand<shadow-home>/.sqlite-maintenance.lockare regular zero-byte files.The live provider catalog reports:
Driver 'codex' failed to create instance: Cannot create Codex shadow home entry '.sqlite-maintenance.lock' because '<shadow-home>/.sqlite-maintenance.lock' already exists and is not a symlink.The account has no registered adapter or available models after this failure. The primary Codex account remains available.
There is also a misleading UI symptom worth covering in the fix: the model picker says "Disabled in settings" for the affected account even though it is enabled in the settings file. Upstream's buildUnavailableProviderSnapshot sets
enabled: falseandinstalled: falsefor the failed instance. ModelPickerSidebar checks that flag before displaying the initialization error, hiding the actual failure behind a settings label.This reproduces the lock-file conflict on the current nightly and confirms that the secondary account can look deliberately disabled when provider creation actually failed.
Before submitting
Area
apps/server
Steps to reproduce
homePath(e.g.~/.codex) and additional provider instances with ashadowHomePath(e.g.~/.codex-t3/cw-prem)..sqlite-maintenance.lockas a standalone regular file (0-byte lock file) in the shadow home directory.materializeCodexShadowHomeand encounters the non-symlink.sqlite-maintenance.lock.Expected behavior
T3 Code should handle
.sqlite-maintenance.lockgracefully (e.g. treating SQLite lock / maintenance files as replaceable runtime files, part of SQLite file families, or shadow-local) instead of aborting provider initialization and disabling the entire account.Actual behavior
The provider instance fails to create and is disabled:
Impact
Blocks work completely (the affected Codex account is marked Disabled and cannot be used until manually resolved).
Version or commit
T3 Code (Alpha) 0.0.45
Environment
Logs or stack traces
File inspection on affected vs working shadow profiles:
Affected shadow home:
Working shadow home:
Related: Similar to the SQLite file family divergence discussed in #5817 / PR #7201, but specifically triggered by
.sqlite-maintenance.lock.Workaround
Remove the standalone lock file from the shadow home (or recreate the symlink to
~/.codex/.sqlite-maintenance.lock):After doing this, reloading or restarting T3 Code allows the account instance to initialize cleanly.