Repository navigation
Description
Summary
On Windows, OpenCode Desktop 2.2.0 fails to start its local server: the bundled CLI (opencode serve --service) dies during boot with SQLiteError: disk I/O error. The renderer then shows the fatal screen "Something went wrong — An error occurred starting the local server." Restarting the app does not recover.
Environment
- opencode version: 2.2.0 (Desktop, packaged; bundled
opencode-cli2.2.0; Electron 44.9.1 / Chrome 152.0.7977.167) - OS: Windows NT 10.0 (x64)
- Terminal: Desktop app (no TUI involved)
- Shell: PowerShell 5.1 (
C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.EXE) - Install/channel:
C:\Users\<user>\AppData\Local\Programs\@opencode-aidesktop, channellatest, updater reports up-to-date on 2.2.0 - Active plugins:
coucou.ts(local file),[email protected],@nick-vi/[email protected],@tarquinen/[email protected],[email protected]— three of these fail to load on every boot (see Additional Context)
Reproduction
- Install/launch OpenCode Desktop 2.2.0 on Windows 10/11 x64.
- The app starts the bundled CLI with
args=["serve","--service"]. - Within ~500 ms the CLI logs
background service boot failed cause="Cause([Die(SQLiteError: disk I/O error)])". - All subsequent API calls fail:
GET /api/info→ 500,GET /api/event→ 503. - The renderer aborts with
fatal renderer error: Desktop IPC handler failed ... cause: "Background service failed to start"and shows the error screen. - Closing and relaunching the app does not help — the same failing service keeps answering 500.
Expected Behavior
The local background service boots, the database opens, and the desktop UI loads normally (as it did up to 2026-10-27 14:40 UTC on the same machine).
Actual Behavior
09:18:16.909 "cli starting" version=2.2.0 channel=latest local=false args="[\"serve\",\"--service\"]" role=cli
09:18:17.402 ERROR "background service boot failed" cause="Cause([Die(SQLiteError: disk I/O error)])" role=server
09:18:17.431 GET /api/info 500
09:18:17.734 GET /api/event 503
... (30 min of 500/503 retries, then 401s)
Renderer side:
Error: Desktop IPC handler failed
at oc://renderer/assets/main-*.js
Caused by:
{
"name": "UnknownError",
"message": "An error occurred in Effect.tryPromise",
"cause": { "name": "Error", "message": "Background service failed to start" }
}
Additional Context
Timeline
2026-10-27T12:06— DB migrations ran successfully, including20261025123711_bloband20261025154125_drop_session_pending.2026-10-27T14:40— last healthy run:/api/eventreturned 200, sessions working.2026-10-28T09:18:16— first failing boot. No migration log line appears at all, so the failure happens at/before opening the SQLite DB, not during a migration.
Possible trigger — manual DB maintenance on 2026-10-02
The DB was cleaned up through the CLI from inside OpenCode itself, then the WAL/SHM files were removed with the app running:
opencode db "VACUUM INTO 'C:/Users/<user>/Documents/opencode-backup/opencode-backup-preclean.db'"
opencode db "ATTACH DATABASE '...opencode-backup-preclean.db' AS bak; ..."
Remove-Item -LiteralPath "C:\Users\<user>\.local\share\opencode\opencode.db-wal",
"C:\Users\<user>\.local\share\opencode\opencode.db-shm"Data dir: C:\Users\<user>\.local\share\opencode (local disk, not OneDrive). Projects live under OneDrive, but the DB does not.
Secondary issue 1 — WSL sidecar fails on every launch
[wsl] spawning wsl sidecar { distro: 'PCMClawUbuntu' }
[wsl] wsl sidecar failed to start { message: 'WSL server exited before becoming healthy (code=1 signal=null)' }
The opencode binary installed inside that distro prints the serve help and exits 1, i.e. it is an older (v1) CLI that does not understand --service. This happens on all 7 runs present in the debug bundle.
Secondary issue 2 — plugins incompatible with the v2 plugin API
Three plugins fail on every boot (70/69/69 times respectively):
PluginModule.LoadError: Plugin must export a default definition with an id and an effect or setup function.
Targets: local ~/.config/opencode/plugins/coucou.ts, [email protected], @nick-vi/[email protected].
Other noise in the logs (probably unrelated)
spawn ENOMEM,spawn UNKNOWN(3×)Cannot connect to API: getaddrinfo ENOTFOUND opencode.ai,net::ERR_NAME_NOT_RESOLVEDFailed to fetch models.dev(109×)- Updater:
opencode-desktop-win-x64.exe.blockmap404 andERR_CONTENT_LENGTH_MISMATCH
Workaround attempted
None yet. Planned next step: fully quit the app, back up opencode.db, opencode.db-wal, opencode.db-shm, then PRAGMA wal_checkpoint(TRUNCATE) / remove the stale -wal and -shm files.
A full debug bundle (desktop + server logs, network.netlog) and a screenshot of the error screen are available on request / already attached to the internal report.
Activity
opencodejr commentedon Oct 28, 2026
Thanks for the detailed report and timeline, @4Hussam!
I think this is a duplicate of #59189. There, the Windows Desktop background service also fails at boot with
SQLiteError: disk I/O error. The failedserve --serviceprocess then stays alive on the service port and answers500on/api/infoand503on/api/eventforever. Because of that, relaunching the app keeps showingBackground service failed to start, as you saw. That issue has been reproduced on the current code.Possible duplicates and related issues, ordered from most to least likely:
disk I/O error, and the failed service process blocks every later startdisk I/O errorBackground service failed to start, but caused by a different boot error (chmodEPERM onopencode.db)The workaround from #59189 should get you running again:
opencode-cli.exeprocess in Task Manager, or runopencode service stopwith the bundled CLI.If the
disk I/O errorcomes back even after that process is gone, please reply here with the new log lines. That would point to a problem with the database itself (possibly related to the WAL/SHM files you removed), which would be a separate issue. Making a backup copy ofopencode.dband its-wal/-shmfiles first, as you planned, is a good idea.Two side notes:
opencodeinside that distro is a v1 CLI, which doesn't understand--service. Upgrading it there to v2 (@opencode/cli) should fix that.The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.
opencodejr commentedon Oct 29, 2026
We haven't heard back, so I'm closing this as a duplicate of #59189. In that issue, a background service whose boot fails with
SQLiteError: disk I/O errorstays alive on the service port. It keeps answering500/503, so Desktop showsBackground service failed to starton every relaunch. Please follow #59189 for updates. The open PRs #55311 and #57134 address it.Until it's fixed, you can work around it: quit the app, end any leftover
opencode-cli.exeprocess (or runopencode service stop), then reopen the app.If the
disk I/O errorstill comes back once that process is gone, please comment here with the new log lines and we can reopen this as a separate database issue. Thanks for the thorough report!