Skip to content

Windows: Running /update leaves background service in a zombie state with "SQLiteError: disk I/O error" causing "Background service failed to start" #59940

Closed as duplicate

Description

@CyberBonk

Description

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:

  1. 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.
  2. 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
  1. The crashed server process remained alive, bound to localhost port 28894, and continuously responded with HTTP 500 to /api/info.
  2. 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

  1. On Windows, have an active OpenCode session running with the background service alive.
  2. Run /update from within the CLI to install the latest version (v2.2.0).
  3. After update completion, run opencode or any command like opencode auth list or opencode models.

Screenshot

Image

Operating System

Windows 11 26H2

Terminal

Windows Terminal

Activity

  1. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    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.

  2. opencodejr commented on Oct 29, 2026

    @opencodejr
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions