codex - 💡(How to fix) Fix Codex Windows Store 26.519.2736.0 fails on startup: "migration 1 was previously applied but has been modified"

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error: Error: failed to initialize sqlite state runtime under /mnt/c/Users/<redacted>/.codex 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 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.

  • On the following launch, the same migration integrity error reappears Deleting and recreating the local state database should result in a clean startup rather than the same recurring migration validation error. 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.

Code Example

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:

---

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:
RAW_BUFFERClick to expand / collapse

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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Codex Windows Store 26.519.2736.0 fails on startup: "migration 1 was previously applied but has been modified"