You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Desktop App startup crash due to sqlx migration checksum mismatch on logs_2.sqlite after updating to #23863
What version of the Codex App are you using (From “About Codex” dialog)?
26.519.21041
What subscription do you have?
PLUS
What platform is your computer?
Win11
What issue are you seeing?
Crash on start like the pic.
Title: Desktop App
startup crash due to sqlx migration checksum mismatch on logs_2.sqlite after updating to 26.519.2081.0
Technical Findings (Root Cause):
Misleading Error Context: Although the error window complained about /mnt/c/Users/Song/.codex/state_5.sqlite, the actual validation failure was occurring inside logs_2.sqlite's _sqlx_migrations table (both databases are initialized during the state runtime startup).
Checksum Mismatch: The migration checksums for migration 1 ('logs') and 2 ('logs feedback log body') stored in the local logs_2.sqlite differed from what the new CLI binary (0.131.0 spawned via WSL) expected.
Local logs_2.sqlite hash for migration 1 (from previous versions): F477E605...
New binary (0.131.0) expected hash for migration 1: 009639EA...
Line Endings / Immutable Violation: This is likely caused by either modifying past migration files in the new release, or a mismatch in CRLF vs LF line endings during the build pipeline of the binary packages.
Suggestions for OpenAI Dev Team:
Please ensure migration files are strictly treated as immutable across releases, and normalize line endings before calculating the migration hashes in the build pipeline.
Refine the exception propagation so the UI error message correctly specifies which database (logs_2.sqlite vs state_5.sqlite) actually failed the checksum verification.
I have submitted this problem in the feedback of the APP.
This problem is solved by Gemini 3.5 Flash
What steps can reproduce the bug?
In-APP update.
Environment Details:
Codex Desktop UWP Version: 26.519.2081.0 (Package: OpenAI.Codex_26.519.2081.0_x64__2p2nqsd0c76g0)
WSL CLI Binary version (active): 0.131.0 (Path: C:\Users\Song.codex\bin\wsl\7945a00f33bdc140\codex)
Previous/Fallback WSL CLI version: 0.128.0-alpha.1 (Path: C:\Users\Song.codex\bin\wsl\codex)
Windows Native CLI version: 0.131.0-alpha.9 (Path: C:\Users\Song\AppData\Local\OpenAI\Codex\bin\76ac88818493fc45\codex.exe)
Active OS: Windows 11 running WSL 2 (Distro: Ubuntu)
Steps to reproduce / Context: After updating the Codex Windows desktop application to version 26.519.2081.0, the app crashed on startup with a database initialization error. The error message displayed in the UI pointed to /mnt/c/Users/Song/.codex/state_5.sqlite: migration 1 was previously applied but has been modified.
To fix this, you need to delete the local state database so the application can regenerate it from scratch with the new migration checksums.
Note: This will reset your local app state, but it will allow the app to launch successfully.
For Windows Users:
Close the Codex application completely.
Open File Explorer and navigate to your user profile's .codex directory: C:\Users\<YourUsername>\.codex\
Delete the following files (if they exist):
state_5.sqlite
state_5.sqlite-shm
state_5.sqlite-wal
Launch the application again.
(If you are using WSL, the path is /mnt/c/Users/<YourUsername>/.codex/)
Got the same issue here. Doing the workaround (deleting the state sqlite files) works, but then when I restart Codex I am faced with the same error again. That means I have to delete my state every time I restart Codex right now.
This is the same root-cause family as #23777 / #23787: the WSL/Linux Codex backend rejects a Windows-created SQLite DB because SQLx migration checksums differ at the CRLF-vs-LF byte level. Moving state_5.sqlite* / logs_2.sqlite* aside is a launch workaround, but it forces Codex to rebuild metadata instead of repairing the existing DBs.
git clone https://github.com/xdifu/codex-repair.git
cd codex-repair
python codex-repair.py fix --apply
If you run it from WSL bash to repair Windows Codex Desktop data, pass --codex-home "/mnt/c/Users/<WindowsUser>/.codex" so it does not target WSL's own ~/.codex.
It backs up the SQLite DBs, extracts the active backend's expected checksums, schema-verifies before rewriting _sqlx_migrations, and leaves ~/.codex/sessions/*.jsonl read-only.
Activity
github-actions commentedon May 21, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
migration 1 was previously applied but has been modified#23824Powered by Codex Action
terrytwomail commentedon May 21, 2026
same here
NoahStahl commentedon May 21, 2026
Same. Repro steps:
tebriz91 commentedon May 21, 2026
Workaround
To fix this, you need to delete the local state database so the application can regenerate it from scratch with the new migration checksums.
Note: This will reset your local app state, but it will allow the app to launch successfully.
For Windows Users:
Close the Codex application completely.
Open File Explorer and navigate to your user profile's .codex directory:
C:\Users\<YourUsername>\.codex\Delete the following files (if they exist):
state_5.sqlite
state_5.sqlite-shm
state_5.sqlite-wal
Launch the application again.
(If you are using WSL, the path is
/mnt/c/Users/<YourUsername>/.codex/)Lianye-Scythe commentedon May 21, 2026
Same
lejmer commentedon May 21, 2026
Got the same issue here. Doing the workaround (deleting the state sqlite files) works, but then when I restart Codex I am faced with the same error again. That means I have to delete my state every time I restart Codex right now.
MisterRound commentedon May 21, 2026
Install Codex CLI in WSL and give it this issue thread, the RCA and fixes are contained in this thread #23777
LemonHaze420 commentedon May 21, 2026
Quick workaround for me was just to backup logs_2.sqlite by moving it somewhere else. Reopening Codex rebuilt it. #23777 didn't do anything for me.
planetzalex commentedon May 21, 2026
STOP PUTTING OUT SHIT UPDATES, OPENAI
Lianye-Scythe commentedon May 21, 2026
Still not fixed, can OpenAI hurry up?
NoahStahl commentedon May 22, 2026
Version released today doesn't fix. Repro of issue remains:
A workaround seems to be to install, switch to WSL, quit, delete all sqlite files from
.codexdirectory, then launch again.hsbtr commentedon May 22, 2026
After seeing this message before the update, I decided not to proceed with the upgrade until the issue was resolved.
xdifu commentedon May 23, 2026
This is the same root-cause family as #23777 / #23787: the WSL/Linux Codex backend rejects a Windows-created SQLite DB because SQLx migration checksums differ at the CRLF-vs-LF byte level. Moving
state_5.sqlite*/logs_2.sqlite*aside is a launch workaround, but it forces Codex to rebuild metadata instead of repairing the existing DBs.For users who want to preserve local history metadata, I published a non-destructive repair tool: https://github.com/xdifu/codex-repair
Windows PowerShell / Windows Terminal:
If you run it from WSL bash to repair Windows Codex Desktop data, pass
--codex-home "/mnt/c/Users/<WindowsUser>/.codex"so it does not target WSL's own~/.codex.It backs up the SQLite DBs, extracts the active backend's expected checksums, schema-verifies before rewriting
_sqlx_migrations, and leaves~/.codex/sessions/*.jsonlread-only.