Codex App for Windows: WSL2 agent mode blocks launch due to SQLite migration mismatch
What version of the Codex App are you using (From “About Codex” dialog)?
26.519.2081.0
What subscription do you have?
Enterprise
What platform is your computer?
Windows11 / WSL2
What issue are you seeing?
Hi OpenAI Support,
I’m reporting a launch-blocking issue in Codex App for Windows when switching the agent mode to WSL2.
Environment:
- Codex App for Windows version: 26.519.2081.0
- Windows user: workstation\leona
- WSL distro: Ubuntu, WSL version 2
wsl -l -vshows Ubuntu as Running, version 2- WSL user: leo
- WSL home: /home/leo
- bubblewrap is installed:
/usr/bin/bwrap, version 0.4.0 - Codex Windows native/auto mode still launches
Actual result:
Codex shows a modal saying:
“Codex cannot access its local database.
The app cannot finish launching until its SQLite database is accessible.”
The error text is:
Database path: /mnt/c/Users/leona/.codex/state_5.sqlite
failed to initialize state runtime at /mnt/c/Users/leona/.codex
Error:
(code=-1, signal=null)
Most recent error:
failed to initialize sqlite state db at /mnt/c/Users/leona/.codex/state_5.sqlite:
failed to initialize state runtime at /mnt/c/Users/leona/.codex:
migration 1 was previously applied but has been modified
Expected result:
Codex App should launch in WSL2 agent mode and allow the agent to access the WSL filesystem, e.g. /home/leo.
Additional observations:
- In Windows native mode, Codex commands run under
workstation\codexsandboxoffline, so they cannot see the WSL distro registered underworkstation\leona. - If a command is approved outside the sandbox, it runs as
workstation\leonaand can access WSL successfully. - The SQLite database exists at
C:\Users\leona\.codex\state_5.sqlite. - The
_sqlx_migrationstable contains migrations 1 through 32. - This looks like a migration checksum/version mismatch between the Windows-native state database and the WSL2 agent startup path.
- This is not a missing WSL/bubblewrap problem: Ubuntu WSL2 is running and
bwrapis installed.
Related public reports/issues:
- openai/codex #21750: state runtime can wedge startup on
state_5.sqlitefailures, with no automatic recovery:
https://github.com/openai/codex/issues/21750
- openai/codex #20493: Codex Desktop update/import issue involving broken
state_5.sqliteand manual DB recovery:
https://github.com/openai/codex/issues/20493
- openai/codex #17991: Windows desktop / WSL issue that also mentions a separate repaired
state_5.sqlitemigration mismatch:
https://github.com/openai/codex/issues/17991
- Reddit report with the same exact error text after update on Windows/WSL:
Workaround:
Switching back to Windows native/auto mode lets Codex launch again, but WSL2 agent mode remains unusable.
Thanks!
Leonardo
What steps can reproduce the bug?
- Open Codex App on Windows.
- Go to Settings.
- Change the agent mode from Windows native/auto to WSL2.
- Restart the app.
- Codex does not finish launching.
What is the expected behavior?
The agent should run in WSL2
Additional information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗