codex - 💡(How to fix) Fix Codex App for Windows: WSL2 agent mode blocks launch due to SQLite migration mismatch

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

The error text is: Error: Most recent error:

  • Reddit report with the same exact error text after update on Windows/WSL:

Fix Action

Fix / Workaround

Workaround: Switching back to Windows native/auto mode lets Codex launch again, but WSL2 agent mode remains unusable.

RAW_BUFFERClick to expand / collapse

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

26.519.2081.0

What subscription do you have?

Enterprise

What platform is your computer?

Windows11 / WSL2

What issue are you seeing?

Hi OpenAI Support,

I’m reporting a launch-blocking issue in Codex App for Windows when switching the agent mode to WSL2.

Environment:

  • Codex App for Windows version: 26.519.2081.0
  • Windows user: workstation\leona
  • WSL distro: Ubuntu, WSL version 2
  • wsl -l -v shows Ubuntu as Running, version 2
  • WSL user: leo
  • WSL home: /home/leo
  • bubblewrap is installed: /usr/bin/bwrap, version 0.4.0
  • Codex Windows native/auto mode still launches

Actual result: Codex shows a modal saying:

“Codex cannot access its local database. The app cannot finish launching until its SQLite database is accessible.”

The error text is:

Database path: /mnt/c/Users/leona/.codex/state_5.sqlite failed to initialize state runtime at /mnt/c/Users/leona/.codex

Error: (code=-1, signal=null)

Most recent error: failed to initialize sqlite state db at /mnt/c/Users/leona/.codex/state_5.sqlite: failed to initialize state runtime at /mnt/c/Users/leona/.codex: migration 1 was previously applied but has been modified

Expected result: Codex App should launch in WSL2 agent mode and allow the agent to access the WSL filesystem, e.g. /home/leo.

Additional observations:

  • In Windows native mode, Codex commands run under workstation\codexsandboxoffline, so they cannot see the WSL distro registered under workstation\leona.
  • If a command is approved outside the sandbox, it runs as workstation\leona and can access WSL successfully.
  • The SQLite database exists at C:\Users\leona\.codex\state_5.sqlite.
  • The _sqlx_migrations table contains migrations 1 through 32.
  • This looks like a migration checksum/version mismatch between the Windows-native state database and the WSL2 agent startup path.
  • This is not a missing WSL/bubblewrap problem: Ubuntu WSL2 is running and bwrap is installed.

Related public reports/issues:

Workaround: Switching back to Windows native/auto mode lets Codex launch again, but WSL2 agent mode remains unusable.

Thanks! Leonardo

What steps can reproduce the bug?

  1. Open Codex App on Windows.
  2. Go to Settings.
  3. Change the agent mode from Windows native/auto to WSL2.
  4. Restart the app.
  5. Codex does not finish launching.

What is the expected behavior?

The agent should run in WSL2

Additional information

No response

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 App for Windows: WSL2 agent mode blocks launch due to SQLite migration mismatch