Skip to content

opencode 2.0 ,Windows WSL下,卡住了。并且另外的终端启动报错 #55033

Closed as not planned

Description

@flaymes

Description

https://cdn.nodeimage.com/i/eDurRaS4UylGx0c3ds3wLlhoP9Vxf4BU.webp

另外开终端,报错
root@1100-22000959:~/code/29th/wcs-backend-plc-lock# opencode
Error: Background service failed to start
at z (/$bunfs/root/chunk-42zm80wf.js:3:3708)
at (/$bunfs/root/chunk-42zm80wf.js:3:6332)
at service.ensure (/$bunfs/root/chunk-gta1y3p5.js:3:690)
at service.ensure (definition) (/$bunfs/root/chunk-42zm80wf.js:3:5523)
at cli.server-connection.resolve (/$bunfs/root/chunk-qqmzrn42.js:96:6563)
at cli.server-connection.resolve (definition) (/$bunfs/root/chunk-gta1y3p5.js:2:402)

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

WSL Ubuntu24

Terminal

Windows Terminal

Activity

  1. opencode-agent commented on Oct 13, 2026

    @opencode-agent
    Contributor

    Thanks for the report! To work out what's going on, could you please provide:

    1. The exact version: the output of opencode --version.
    2. What the first session was doing when it froze, e.g. stuck on Starting background server... or frozen in the middle of a reply. The screenshot didn't load for us, so please paste the text or attach a PNG. Is the project directory very large (lots of files, or a big git repository)?
    3. The output of opencode service status.
    4. The real startup error. With other opencode instances stopped, run opencode serve --service and paste its output. If a port conflict is the cause, this usually prints something like Managed service port 49374 ... is already in use.
    5. Whether port 49374 is taken: ss -ltnp | grep 49374 (or lsof -i :49374), and whether any old opencode processes are still running (ps aux | grep opencode).

    You can reply here with the details, or edit the issue. If you edit it, please also leave a comment saying you've updated it, so we know when you're done.

    These existing issues may be related, ordered from most to least likely. Please check whether one of them already covers your problem:

  2. Underworldbros commented on Oct 14, 2026

    @Underworldbros

    Additional WSL2 troubleshooting result — OpenCode v2.0.28

    I encountered repeated managed-service restarts under WSL2, including:

    • Background service is unresponsive
    • Server process ... is still running
    • Managed service port 49374 already in use
    • Repeated HTTP 503 responses from /api/info and /api/model
    • Event-stream connection timeouts and stalls

    Environment: WSL2 Ubuntu, kernel 6.18.40.1-microsoft-standard-WSL2, Node.js v24.13.0, npm-installed @opencode/cli v2.0.28.

    My OpenCode SQLite database was approximately 3.99 GB, with a 163 MB WAL file. I observed a server process blocked in a kernel file-read path while accessing opencode.db. Later, Docker's dockerd process was also in uninterruptible sleep (D state), waiting at submit_bio_wait.

    Observed recovery: OpenCode eventually displayed its “What's New” page, but the Agents list was initially blank and the managed service continued restarting. I then changed to my actual project directory and reopened OpenCode. It opened immediately, and the Agents list populated.

    I have not established that changing directories caused the recovery; the service may have finished initializing at the same time. Nevertheless, reopening from the project directory is a useful troubleshooting observation.

    I have not deleted the database, WAL, or SHM files, and have not run database repair or VACUUM.

  3. opencode-agent commented on Oct 16, 2026

    @opencode-agent
    Contributor

    Closing this for now, since we didn't get the details we need to look into it: the exact opencode --version, what the first session was doing when it froze (the WebP screenshot didn't load for us), and the real startup error from opencode serve --service / opencode service status. Background service failed to start is a generic message, so without those we can't tell what caused it.

    If it still happens, please reply here with that information and we can reopen it. In the meantime, these issues cover similar background-service problems on WSL and may help:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions