codex - 💡(How to fix) Fix WSL agent environment corrupts local state_5.sqlite migration on Windows

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: while executing migration 1: migration 1 was previously applied but has been modified

Code Example

Ubuntu             Running   Version 2
docker-desktop     Running   Version 2

---

C:\Users\daiki\.codex

---

/mnt/c/Users/daiki/.codex

---

Agent environment -> WSL

---

error: while executing migration 1:
migration 1 was previously applied but has been modified

---

state_5.sqlite
state_5.sqlite-shm
state_5.sqlite-wal
logs_2.sqlite
RAW_BUFFERClick to expand / collapse

Environment

  • Windows 10 Home
  • Version: 2009
  • Build: 26200
  • Architecture: 64-bit

WSL

  • WSL version: 2.3.26.0
  • Kernel version: 5.15.167.4-1
  • Distro: Ubuntu (WSL2)

Installed distros:

Ubuntu             Running   Version 2
docker-desktop     Running   Version 2

Codex local directory

C:\Users\daiki\.codex

WSL accesses the same directory through:

/mnt/c/Users/daiki/.codex

Reproduction Steps

  1. Launch Codex normally on Windows
  2. Existing .codex directory and local chat history already present
  3. Open Codex settings
  4. Change:
Agent environment -> WSL
  1. Restart Codex
  2. Codex fails during startup with:
error: while executing migration 1:
migration 1 was previously applied but has been modified

Observed Behavior

  • state_5.sqlite becomes unusable
  • Existing chat history cannot be loaded
  • Restoring the previous .codex directory reproduces the same error
  • Renaming .codex allows Codex to launch again with a fresh state

Expected Behavior

Switching to WSL agent mode should not invalidate existing SQLite migrations or corrupt local state/history.


Additional Diagnostics

Relevant files

state_5.sqlite
state_5.sqlite-shm
state_5.sqlite-wal
logs_2.sqlite

Notes

  • No manual modification of SQLite files
  • No custom CODEX_HOME
  • No symlink setup
  • Problem started immediately after enabling WSL agent mode
  • Looks related to migration checksum mismatch between Windows and WSL environments

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 WSL agent environment corrupts local state_5.sqlite migration on Windows