Skip to content

Codex Windows App reported an error after upgrading: Codex cannot access its local database #23780

Closed

Description

@davidjqq19

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?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

Image

What is the expected behavior?

No response

Additional information

No response

Activity

  1. added
    appIssues related to the Codex desktop app
    on May 20, 2026
  2. added
    bugSomething isn't working
    windows-osIssues related to Codex on Windows systems
    configIssues involving config.toml, config keys, config merging, or config updates
    on May 20, 2026
  3. github-actions commented on May 20, 2026

    @github-actions
    Contributor
  4. 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
  5. xdifu commented on May 23, 2026

    @xdifu

    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:

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingconfigIssues involving config.toml, config keys, config merging, or config updateswindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions