You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows: Running /update leaves background service in a zombie state with "SQLiteError: disk I/O error" causing "Background service failed to start" #59940
note: fixed the issue and made this report using the free version of antigravity
After updating OpenCode via /update from v2.1.4 to v2.2.0 on Windows, every subsequent OpenCode command crashes with:
Error: Background service failed to start
at L (B:/~BUN/root/chunk-at3y480f.js:3:893)
at <anonymous> (B:/~BUN/root/chunk-at3y480f.js:3:6325)
at service.ensure (B:/~BUN/root/chunk-2mmf4sjf.js:3:680)
at service.ensure (definition) (B:/~BUN/root/chunk-at3y480f.js:3:5516)
at cli.server-connection.resolve (B:/~52bn196m.js:95:6625)
What happened under the hood:
Looking at ~/.local/share/opencode/log/opencode.log:
When /update ran npm install --global --force @opencode/[email protected], the old background service process was not stopped and retained open Windows file handles on ~/.local/share/opencode/opencode.db.
When the newly installed v2.2.0 spawned opencode serve --service, it failed to open the database due to the lock:
level=ERROR message="background service boot failed" cause="Cause([Die(SQLiteError: disk I/O error)])" role=server
level=INFO message="Sent HTTP response" http.span=1 role=server http.method=GET http.url=/api/info http.status=500
The crashed server process remained alive, bound to localhost port 28894, and continuously responded with HTTP 500 to /api/info.
Any new CLI command saw port 28894 occupied, received 500 Internal Server Error, and aborted.
Workaround / Resolution:
Running opencode service stop cleanly deleted ~/.local/state/opencode/service.json and allowed the orphaned process to terminate and release the SQLite lock. After stopping the service, running opencode successfully booted the new service.
Plugins
@cortexkit/opencode-magic-context@latest
OpenCode version
2.2.0 (upgraded from 2.1.4 via /update)
Steps to reproduce
On Windows, have an active OpenCode session running with the background service alive.
Run /update from within the CLI to install the latest version (v2.2.0).
After update completion, run opencode or any command like opencode auth list or opencode models.
Thanks for the detailed report and for sharing the workaround, @CyberBonk!
I think this is a duplicate of #59189. There, on Windows, the background service (opencode serve --service) also fails at boot with SQLiteError: disk I/O error. The failed process then stays alive on the service port and answers 500 on /api/info, so every new opencode command fails with Background service failed to start until the stale service is stopped. In that report it starts after resuming from sleep; here it starts after /update, but what breaks afterwards is the same.
Possible duplicates and related issues, ordered from most to least likely:
The open PR #55311 ("stop failed services before reporting startup errors") targets the part where the failed service stays alive at 500.
One thing that would help: when a newer version starts, it is supposed to stop the old background service and replace it. If you can confirm that the old 2.1.4 opencode serve --service process was still running after /update (for example, you saw it in Task Manager, or the log shows it never shut down), please reply with those details. That would be a separate bug in the update path, not the one in #59189.
The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.
Closing this as a duplicate of #59189, since there's been no reply in the past day explaining how it's different. Both are the same Windows failure: the background service boot fails with SQLiteError: disk I/O error, and the failed process stays on the service port answering 500 until it's stopped. Please follow #59189 for updates. The open PR #55311 targets the stuck-service part.
Thanks again for the report and the opencode service stop workaround, @CyberBonk! If you later confirm that the old 2.1.4 background service really kept running after /update, please comment here or open a new issue with those details. That would be a separate bug in the update path.
Activity
opencodejr commentedon Oct 28, 2026
Thanks for the detailed report and for sharing the workaround, @CyberBonk!
I think this is a duplicate of #59189. There, on Windows, the background service (
opencode serve --service) also fails at boot withSQLiteError: disk I/O error. The failed process then stays alive on the service port and answers500on/api/info, so every newopencodecommand fails withBackground service failed to startuntil the stale service is stopped. In that report it starts after resuming from sleep; here it starts after/update, but what breaks afterwards is the same.Possible duplicates and related issues, ordered from most to least likely:
SQLiteError: disk I/O error, then stays stuck answering 500 until it is killeddisk I/O errorboot failure on Windows in Desktop 2.2.0, already pointed at desktop: service stuck at 500 after SQLite "disk I/O error" on resume from sleep #59189Background service failed to startwith a different boot cause (EPERMonchmod)The open PR #55311 ("stop failed services before reporting startup errors") targets the part where the failed service stays alive at 500.
One thing that would help: when a newer version starts, it is supposed to stop the old background service and replace it. If you can confirm that the old 2.1.4
opencode serve --serviceprocess was still running after/update(for example, you saw it in Task Manager, or the log shows it never shut down), please reply with those details. That would be a separate bug in the update path, not the one in #59189.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
Closing this as a duplicate of #59189, since there's been no reply in the past day explaining how it's different. Both are the same Windows failure: the background service boot fails with
SQLiteError: disk I/O error, and the failed process stays on the service port answering500until it's stopped. Please follow #59189 for updates. The open PR #55311 targets the stuck-service part.Thanks again for the report and the
opencode service stopworkaround, @CyberBonk! If you later confirm that the old 2.1.4 background service really kept running after/update, please comment here or open a new issue with those details. That would be a separate bug in the update path.