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
Codex Windows App reported an error after upgrading: Codex cannot access its local database #23780
changed the title [-]The Codex Windows app crashes and becomes impossible to reopen after setting the agent environment and terminal environment to WSL and then closing the app[/-][+]Codex Windows App reported an error after upgrading: Codex cannot access its local database[/+]on May 20, 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.
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 20, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
[-]The Codex Windows app crashes and becomes impossible to reopen after setting the agent environment and terminal environment to WSL and then closing the app[/-][+]Codex Windows App reported an error after upgrading: Codex cannot access its local database[/+]migration 1 was previously applied but has been modified#23824 as a duplicate of this issuexdifu 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.