on mac after codex update: Codex cannot access its local database.
Open 💬 14 comments Opened May 22, 2026 by garrettXu
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of the Codex App are you using (From “About Codex” dialog)?
it conn't open
What subscription do you have?
pro
What platform is your computer?
Darwin 24.6.0 arm64 arm
What issue are you seeing?
Codex cannot access its local database.
The app cannot finish launching until its SQLite database is accessible.
Database path: Path unavailable in app-server startup error
Close other Codex applications, then click Retry to check whether access has been restored.
Error: (code=1, signal=null).
Most recent error: Error: failed to initialize sqlite state runtime under /Users/xxx/.codex: failed to initialize state runtime at /Users/xxxx/.codex: error returned from database: (code: 11) database disk image is malformed
What steps can reproduce the bug?
when i update use app, it cann't work
What is the expected behavior?
_No response_
Additional information
_No response_
14 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Same Issue a simple reinstall does not fix it. Anyone have a fix ?
Same issue here... I tried renaming logs_2.sqlite like people said in the other tickets, but no luck. I can't start de app anymore.
Same issue here too
I got the same issue today, did anyone fix it?
Renaming state_5.sqlite had the effect.
You can fix it by
``
mv ~/.codex/state_5.sqlite ~/.codex/state_2.sqlite``You can use codex cli to start it again, codex cli will automatically fix this problem
Same issue here after an update. Renaming worked.
I did not have the ~/.codex/state_*.sqlite files present, so that does not work.
But @inRush's solution worked for me. Thank you!
System: macOS 26.5 arm64
Workaround: reset Codex SQLite state
I ran into an issue where Codex could no longer open, and the root cause appeared to be related to its local SQLite state files.
The workaround that fixed it for me was:
.sqlitefiles under any.codexdirectory..sqlitefiles to keep them as backups, for example:After doing this, Codex was able to start normally again.
Note that this may reset some local Codex state, but the original SQLite files are still preserved as
.bakbackups in case they are needed later.i asked Codex Cli to fix it :
What fixed it was not just renaming the .sqlite files. The missing piece was that Codex’s recovery flow expected this
directory to exist:
~/.codex/db-backups
In your case it did not exist, so “Back Up and Rebuild” failed with:
Recovery failed: ENOENT: no such file or directory, mkdir 'db-backups'
Here’s the exact summary you can post:
I was able to fix this by manually creating Codex’s missing backup directory and moving the active SQLite database
files out of the way.
The error dialog said Codex could not access its local SQLite database, and the recovery step failed with:
Recovery failed: ENOENT: no such file or directory, mkdir 'db-backups'What worked:
```sh
mkdir -p ~/.codex/db-backups/manual-backup
find ~/.codex ~/.codex/sqlite -maxdepth 1 -type f \
\( -name '.sqlite' -o -name '.sqlite-wal' -o -name '*.sqlite-shm' \) \
-exec mv {} ~/.codex/db-backups/manual-backup/ \;
Then I clicked Retry / restarted Codex, and Codex recreated fresh SQLite files automatically.
Notes:
directory was missing.
One caveat: the simple command above flattens files from
~/.codex/sqliteinto the same backup folder. What Iactually ran preserved the
sqlite/subfolder too, but for most users the simpler version is probably enough unlessthere are filename collisions.
Claude fixed my issue:
The dialog was misleading — your database was never actually corrupt (integrity_check and quick_check both returned ok). The real problem was a crash-looping process stack: a background codex app-server daemon and a codex-aar helper kept dying and respawning, each grabbing a lock on state_5.sqlite, so every relaunch failed to initialize the sqlite runtime. The in-app "Back Up and Rebuild" button couldn't help because it had its own bug (ENOENT … mkdir 'db-backups' — it tries to create that folder from a working directory that no longer exists).
What I did:
Fully close the app, then in the terminal run
Then try restarting the app