Skip to content

Codex Windows Store 26.519.2736.0 fails on startup: "migration 1 was previously applied but has been modified" #23923

@simonholm

Description

@simonholm

What version of the Codex App are you using (From “About Codex” dialog)?

26.519.2736.0

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Windows 11 x64

What issue are you seeing?

After a recent Microsoft Store auto-update, Codex no longer launches and consistently fails during SQLite state initialization.

Error:

Error: failed to initialize sqlite state runtime under /mnt/c/Users/<redacted>/.codex
failed to initialize state runtime at /mnt/c/Users/<redacted>/.codex
migration 1 was previously applied but has been modified

Environment:

  • Codex Store version: 26.519.2736.0
  • Windows 11 x64
  • Store install path:
    C:\Program Files\WindowsApps\OpenAI.Codex_26.519.2736.0_x64__2p2nqsd0c76g0\app\Codex.exe
  • State DB:
    C:\Users\<redacted>\.codex\state_5.sqlite

Things tested:

  1. Deleted WAL/SHM files (*.sqlite-wal, *.sqlite-shm) → no effect
  2. Deleted state_5.sqlite completely → Codex recreates DB and runs all 34 migrations successfully, but next launch still fails with the same migration checksum error
  3. Verified _sqlx_migrations table → all migrations marked successful
  4. Checked for duplicate installs / secondary sqlite DBs → none found
  5. Disabled newly downloaded WSL runtime binary under:
    ~/.codex/bin/wsl/ab950535f78f78c1/
    → no effect
  6. Checked LocalAppData / Package state directories for alternate DBs → none found

Important finding:
Even a freshly recreated database fails immediately afterward with the same error. This suggests the issue is internal to the shipped application/runtime rather than user DB corruption.

Hypothesis:
Possible embedded migration mismatch or migration checksum regression (sqlx-style migration validation).

At this point it does not appear locally recoverable.

What steps can reproduce the bug?

  1. Install/update Codex Windows app from Microsoft Store to version 26.519.2736.0

  2. Launch Codex normally

  3. App fails immediately during startup with:

    migration 1 was previously applied but has been modified
    

Additional reproduction observations:

  • Deleting state_5.sqlite allows Codex to recreate the DB and run migrations successfully once
  • On the following launch, the same migration integrity error reappears
  • Issue persists even with a freshly recreated database

What is the expected behavior?

Codex should launch normally after update and initialize its SQLite state database without reporting migration checksum/integrity failures.

Deleting and recreating the local state database should result in a clean startup rather than the same recurring migration validation error.

Additional information

One potentially important detail:

A new WSL runtime binary appeared immediately before the failures started:

~/.codex/bin/wsl/ab950535f78f78c1/codex

However, disabling that runtime did not resolve the issue, suggesting the migration definitions may also be embedded in the Windows application binary itself.

Another important observation:
even after deleting state_5.sqlite, Codex successfully recreates the database and applies all 34 migrations before later failing again with the same checksum/integrity error.

That behavior suggests:

  • conflicting embedded migration definitions
  • or migration checksum validation inconsistency
    rather than ordinary sqlite corruption or stale WAL state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingsessionIssues involving session (thread) management, resuming, forking, naming, archivingwindows-osIssues related to Codex on Windows systems

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions