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 }}
[v2 Windows] opencode2 hangs at "Starting background server..." after reinstall #41746
This issue might be a duplicate of existing issues. Please check:
opencode2 became stuck starting its managed background server #41696: Similar symptom — opencode2 hangs at "Starting background server..." / stuck starting its managed background server (different root cause suspected: port conflict vs. Windows reinstall, but the failure mode is the same)
If your issue is distinct from #41696, feel free to add that context to help maintainers differentiate them.
Ran into this on Windows. In my case the timeout was caused by a port collision with Windows dynamic port reservations. On Windows, especially with Hyper-V, WSL2 or Docker installed it likes to reserve large blocks of ports.
The CLI hung and eventually threw:
Error: Timed out waiting for the background service to start
Checking ~/.local/share/opencode/log/opencode.log showed the actual error:
Managed service port 49374 on 127.0.0.1 is already in use by another process.
Running netsh interface ipv4 show excludedportrange protocol=tcp confirmed that Hyper-V/WSL had reserved ports
49336 to 49435, preventing the background service from binding to 49374.
Setting an unreserved port resolved it: powershell opencode service set port 40900 opencode service start
Two improvements would probably help here:
Surface stderr from the background service in the CLI rather than silently waiting for the timeout.
Retry with an alternate port (or request port 0 and persist what the OS assigns) when hitting EADDRINUSE / WSAEACCES.
Activity
github-actions commentedon Aug 11, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is distinct from #41696, feel free to add that context to help maintainers differentiate them.
opencode-agent commentedon Aug 11, 2026
Thanks for the report. Could you reproduce this once more and share the relevant log output?
On Windows, the installed-build log is at:
Please redact API keys, authorization headers, prompts, file contents, and any other sensitive data before sharing it.
Double77x commentedon Sep 7, 2026
Ran into this on Windows. In my case the timeout was caused by a port collision with Windows dynamic port reservations. On Windows, especially with Hyper-V, WSL2 or Docker installed it likes to reserve large blocks of ports.
The CLI hung and eventually threw:
Checking
~/.local/share/opencode/log/opencode.logshowed the actual error:Running
netsh interface ipv4 show excludedportrange protocol=tcpconfirmed that Hyper-V/WSL had reserved ports49336 to 49435, preventing the background service from binding to 49374.
Setting an unreserved port resolved it:
powershell opencode service set port 40900 opencode service startTwo improvements would probably help here:
fix(cli): resolve background service port collision on Windows
humb1t commentedon Sep 16, 2026
I get same issue on linux machine today
laundry-96 commentedon Oct 7, 2026
I'm getting the same issue. I have multiple users on my server, so the port can be blocked by other people
luzdealba commentedon Oct 12, 2026
I had the same issue on WSL after upgrading from v1 to v2 via
opencode upgrade --major, even after fully uninstalling and reinstalling via NPMIn the end, I fully (re)uninstalled and installed via
curl -fsSL https://opencode.ai/v2/install | bash— and it worked.Seems like the upgrade and NPM or PNPM installations aren't v2-ready yet.