Desktop App startup crash due to sqlx migration checksum mismatch on logs_2.sqlite after updating to
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
<img width="833" height="444" alt="Image" src="https://github.com/user-attachments/assets/7a37c198-7dad-4098-a370-363d11e8abd7" />
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.
What is the expected behavior?
launch normally
Additional information
_No response_
13 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
same here
Same. Repro steps:
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/)Same
<img width="558" height="313" alt="Image" src="https://github.com/user-attachments/assets/eb45b318-e723-47c7-9456-090a35e5d396" />
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.
Install Codex CLI in WSL and give it this issue thread, the RCA and fixes are contained in this thread https://github.com/openai/codex/issues/23777
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.
STOP PUTTING OUT SHIT UPDATES, OPENAI
Still not fixed, can OpenAI hurry up?
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.After seeing this message before the update, I decided not to proceed with the upgrade until the issue was resolved.
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.