Windows Desktop 26.820.10647.0: fresh codex-dev.db repeatedly rejected as "file is not a database"
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of the Codex App are you using (From “About Codex” dialog)?
26.820.10647.0
What subscription do you have?
ChatGPT Plus
What platform is your computer?
Microsoft Windows 11 Pro 10.0.26200 Build 26200 x64
What issue are you seeing?
Summary
After an interrupted ChatGPT Desktop update on Windows, the app repeatedly rejects a newly generated local database with:
Error: file is not a database
Trigger
The ChatGPT Desktop app was updating when Windows Update requested a restart. Windows restarted while the ChatGPT update was still in progress.
Actual behavior
- Launch ChatGPT Desktop.
- The app reports that it detected a damaged local database and rebuilt it.
- Immediately afterward, the app reports that it cannot access the new database.
- Selecting "Back Up and Rebuild" repeats the same loop.
Database path:
%USERPROFILE%.codex\sqlite\codex-dev.db
Recovery attempts
- Fully terminated all ChatGPT and Codex processes.
- Rebooted Windows.
- Reset the Windows app.
- Uninstalled and reinstalled the Microsoft Store app.
- Moved all active SQLite and DB files under
.codexto a separate backup. A total of 18 database files were moved. - Moved
.codex-global-state.jsonand its backup aside. - Confirmed that no VS Code, separate Codex installation, or duplicate app-server process was running.
The error still occurs with a completely fresh database.
Database evidence
The newly generated codex-dev.db has the following properties:
- Size: 102,400 bytes
- Header:
53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00 - The header correctly identifies
SQLite format 3. - No
codex-dev.db-walorcodex-dev.db-shmfile is present.
Despite this, the app immediately rejects the newly generated database with:
Error: file is not a database
Expected behavior
After rebuilding the local database, ChatGPT Desktop should launch successfully instead of repeatedly quarantining each newly generated database.
What steps can reproduce the bug?
- Launch ChatGPT Desktop version 26.820.10647.0 on Windows.
- A dialog says that ChatGPT detected a damaged local database and rebuilt it.
- Click OK.
- Another dialog says that ChatGPT cannot access its local database.
- The displayed error is: "file is not a database."
- Click "Back Up and Rebuild."
- ChatGPT creates another backup and displays the same two dialogs again.
The issue also reproduces after moving all existing SQLite and DB files out of the .codex directory, causing the app to generate a completely fresh database.
What is the expected behavior?
ChatGPT Desktop should create a valid fresh database and launch successfully after rebuilding the damaged database. It should not immediately reject and quarantine the database that it just generated.
Additional information
The issue began after Windows restarted while a ChatGPT Desktop update was still in progress.
Troubleshooting already completed:
- Fully terminated all ChatGPT and Codex processes
- Rebooted Windows
- Reset the Windows app
- Uninstalled and reinstalled the Microsoft Store app
- Moved 18 active SQLite and DB files under .codex to a separate backup
- Moved .codex-global-state.json and its backup aside
- Confirmed that no VS Code, separate Codex installation, or duplicate app-server process was running
The newly generated codex-dev.db is 102,400 bytes and begins with the valid SQLite header:
53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00
This corresponds to "SQLite format 3."
No codex-dev.db-wal or codex-dev.db-shm file is present. Despite this, the app immediately reports: "file is not a database."
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the Windows rebuild loop involving %USERPROFILE%.codex\sqlite\codex-dev.db and inspect the generated database's open or validation path against the reported SQLite header. The report names no source file or test, so trace the rebuild flow first. Done means a fresh database is accepted and the app launches without repeatedly quarantining it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, sqlite
- Domain
- databases, desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100