Repository navigation
Description
Description
in wsl2 can't start opencode 2.0.12.
below is the log:
:~/.local/share/opencode/log$ tail -f opencode.log
timestamp=2026-09-22T03:15:02.661Z level=INFO run=94c35f20 message="cli starting" version=2.0.12 channel=latest local=false args="["serve","--service"]" role=cli
timestamp=2026-09-22T03:15:07.830Z level=INFO run=05f1d131 message="cli starting" version=2.0.12 channel=latest local=false args="["serve","--service"]" role=cli
timestamp=2026-09-22T03:15:23.262Z level=ERROR run=05f1d131 message="cli process failed" cause="Cause([Fail(Error: Managed service port 49375 on 127.0.0.1 is already in use by another process. Configure another port with opencode service set port <port> and start the service again. (cause: ServeError (cause: Error: Failed to start server. Is port 49375 in use?)))])" args="["serve","--service"]" role=cli
timestamp=2026-09-22T03:15:23.548Z level=INFO run=a03c9fef message="cli starting" version=2.0.12 channel=latest local=false args="["serve","--service"]" role=cli
timestamp=2026-09-22T03:15:39.906Z level=ERROR run=a03c9fef message="cli process failed" cause="Cause([Fail(Error: Managed service port 49375 on 127.0.0.1 is already in use by another process. Configure another port with opencode service set port <port> and start the service again. (cause: ServeError (cause: Error: Failed to start server. Is port 49375 in use?)))])" args="["serve","--service"]" role=cli
timestamp=2026-09-22T03:15:40.321Z level=INFO run=ca5187e3 message="cli starting" version=2.0.12 channel=latest local=false args="["serve","--service"]" role=cli
timestamp=2026-09-22T03:15:55.750Z level=ERROR run=ca5187e3 message="cli process failed" cause="Cause([Fail(Error: Managed service port 49375 on 127.0.0.1 is already in use by another process. Configure another port with opencode service set port <port> and start the service again. (cause: ServeError (cause: Error: Failed to start server. Is port 49375 in use?)))])" args="["serve","--service"]" role=cli
timestamp=2026-09-22T03:15:55.949Z level=INFO run=92660c83 message="cli starting" version=2.0.12 channel=latest local=false args="["serve","--service"]" role=cli
timestamp=2026-09-22T03:16:11.347Z level=ERROR run=92660c83 message="cli process failed" cause="Cause([Fail(Error: Managed service port 49375 on 127.0.0.1 is already in use by another process. Configure another port with opencode service set port <port> and start the service again. (cause: ServeError (cause: Error: Failed to start server. Is port 49375 in use?)))])" args="["serve","--service"]" role=cli
timestamp=2026-09-22T03:16:11.459Z level=INFO run=c4280d6f message="cli starting" version=2.0.12 channel=latest local=false args="["serve","--service"]" role=cli
timestamp=2026-09-22T03:16:26.884Z level=ERROR run=c4280d6f message="cli process failed" cause="Cause([Fail(Error: Managed service port 49375 on 127.0.0.1 is already in use by another process. Configure another port with opencode service set port <port> and start the service again. (cause: ServeError (cause: Error: Failed to start server. Is port 49375 in use?)))])" args="["serve","--service"]" role=cli
timestamp=2026-09-22T03:16:27.193Z level=INFO run=cdb6eb19 message="cli starting" version=2.0.12 channel=latest local=false args="["serve","--service"]" role=cli
timestamp=2026-09-22T03:16:42.605Z level=ERROR run=cdb6eb19 message="cli process failed" cause="Cause([Fail(Error: Managed service port 49375 on 127.0.0.1 is already in use by another process. Configure another port with opencode service set port <port> and start the service again. (cause: ServeError (cause: Error: Failed to start server. Is port 49375 in use?)))])" args="["serve","--service"]" role=cli
timestamp=2026-09-22T03:16:43.029Z level=INFO run=543f522a message="cli starting" version=2.0.12 channel=latest local=false args="["serve","--service"]" role=cli
timestamp=2026-09-22T03:16:58.468Z level=ERROR run=543f522a message="cli process failed" cause="Cause([Fail(Error: Managed service port 49375 on 127.0.0.1 is already in use by another process. Configure another port with opencode service set port <port> and start the service again. (cause: ServeError (cause: Error: Failed to start server. Is port 49375 in use?)))])" args="["serve","--service"]" role=cli
timestamp=2026-09-22T03:16:58.755Z level=INFO run=7571c301 message="cli starting" version=2.0.12 channel=latest local=false args="["serve","--service"]" role=cli
timestamp=2026-09-22T03:17:02.858Z level=ERROR run=0875123b message="cli process failed" cause="Cause([Fail(Error: Timed out waiting for the background service to start)])" args=[] role=cli
timestamp=2026-09-22T03:17:14.175Z level=ERROR run=7571c301 message="cli process failed" cause="Cause([Fail(Error: Managed service port 49375 on 127.0.0.1 is already in use by another process. Configure another port with opencode service set port <port> and start the service again. (cause: ServeError (cause: Error: Failed to start server. Is port 49375 in use?)))])" args="["serve","--service"]" role=cli
timestamp=2026-09-22T03:20:17.350Z level=INFO run=4109a5c0 message="cli starting" version=2.0.12 channel=latest local=false args=[] role=cli
timestamp=2026-09-22T03:20:17.436Z level=INFO run=4109a5c0 message="background service starting" reason=missing previousVersion=undefined role=cli
timestamp=2026-09-22T03:20:17.504Z level=INFO run=d23e6709 message="cli starting" version=2.0.12 channel=latest local=false args="["serve","--service"]" role=cli
timestamp=2026-09-22T03:20:22.716Z level=INFO run=d7160145 message="cli starting" version=2.0.12 channel=latest local=false args="["serve","--service"]" role=cli
timestamp=2026-09-22T03:20:38.159Z level=ERROR run=d7160145 message="cli process failed" cause="Cause([Fail(Error: Managed service port 49375 on 127.0.0.1 is already in use by another process. Configure another port with opencode service set port <port> and start the service again. (cause: ServeError (cause: Error: Failed to start server. Is port 49375 in use?)))])" args="["serve","--service"]" role=cli
timestamp=2026-09-22T03:21:12.259Z level=INFO run=046a2f26 message="cli starting" version=2.0.12 channel=latest local=false args="["upgrade","next"]" role=cli
Plugins
No response
OpenCode version
$ opencode --version
opencode v2.0.12
Steps to reproduce
pkill -9 -f opencode || true
rm -rf ~/.local/share/opencode/service
rm -rf ~/.cache/opencode
opencode
Screenshot and/or share link
No response
Operating System
wsl2 Ubuntu 22.04.5 LTS \n \l
Terminal
powershell 7.6.6
Activity
github-actions commentedon Sep 22, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
opencode --version)Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
serve --serviceattempts instead of surfacing the conflictIf you believe this was flagged incorrectly, please let a maintainer know.
github-actions commentedon Sep 22, 2026
Thanks for updating the issue! It now includes the necessary details — a clear description, log output, steps to reproduce, version, and OS info. We appreciate you taking the time to fill everything out properly.
[-]in wsl2 can't start opencode 2.0.12.[/-][+]in wsl2 [Ubuntu 22.04 LTS] can't start opencode 2.0.12.[/+]neriousy commentedon Oct 19, 2026
Sorry this hasn't been picked up yet. The log shows new
serve --serviceprocesses failing every ~16 seconds, which usually means a service is already running but the new launch can't reach or recognize it. Could you tell us:%USERPROFILE%\.wslconfigon Windows (especiallynetworkingModeandautoProxy).env | grep -i proxyinside WSL. If proxies are set, doesNO_PROXY=127.0.0.1,localhost opencodestart?opencodejr commentedon Oct 28, 2026
Thanks for the logs! Each
serve --serviceattempt fails because something already holds127.0.0.1:49375and it isn't an OpenCode service the CLI recognises, so it keeps retrying. To find out what is holding the port, could you reply to the earlier questions from @neriousy and also add:opencode service get. 49375 isn't the default port for the release channel (49374), so we'd like to know whether it was set by hand.cat /proc/sys/net/ipv4/ip_local_port_range ss -ltnp | grep 4937%USERPROFILE%\.wslconfig(especiallynetworkingMode), and whether OpenCode Desktop or the Windows CLI is running at the same time.As a test, you could also try a port below 32768, e.g.
opencode service set port 28894, then runopencodeagain and tell us whether it starts. With WSL mirrored networking, Windows and WSL can reserve ports that look "in use" even though nothing is listening on them.You can reply here 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.
Related issues, ordered by likelihood:
serve --serviceattemptsopencodejr commentedon Oct 31, 2026
We're closing this for now because we haven't heard back. To find out what is holding port 49375 in WSL2, we still need the details asked for above: whether it happens on the latest 2.x release (newer versions name the process holding the port in the error), the output of
opencode service get,cat /proc/sys/net/ipv4/ip_local_port_rangeandss -ltnp | grep 4937, and your.wslconfignetworking mode.In the meantime, a port below 32768 may get you running, e.g.
opencode service set port 28894.If it still happens, reply here with those details and we can reopen it. Related: #55907, #55918.