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
另外开终端,报错
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)
Thanks for the report! To work out what's going on, could you please provide:
The exact version: the output of opencode --version.
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)?
The output of opencode service status.
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.
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:
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.
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:
Activity
opencode-agent commentedon Oct 13, 2026
Thanks for the report! To work out what's going on, could you please provide:
opencode --version.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)?opencode service status.opencode serve --serviceand paste its output. If a port conflict is the cause, this usually prints something likeManaged service port 49374 ... is already in use.ss -ltnp | grep 49374(orlsof -i :49374), and whether any oldopencodeprocesses 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:
Underworldbros commentedon Oct 14, 2026
Additional WSL2 troubleshooting result — OpenCode v2.0.28
I encountered repeated managed-service restarts under WSL2, including:
Background service is unresponsiveServer process ... is still running49374already in use/api/infoand/api/modelEnvironment: WSL2 Ubuntu, kernel
6.18.40.1-microsoft-standard-WSL2, Node.jsv24.13.0, npm-installed@opencode/cliv2.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'sdockerdprocess was also in uninterruptible sleep (Dstate), waiting atsubmit_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.
opencode-agent commentedon Oct 16, 2026
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 fromopencode serve --service/opencode service status.Background service failed to startis 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: