v2+ is unusable on Fedora - Zombie Service and Connection Refused errors
On Fedora, OpenCode v2 attempts to run a persistent background service (daemon) which often fails to shut down correctly when interrupted (e.g., via Ctrl+C) or when the network state changes.
Symptoms:
- "Connection Refused" errors when attempting to restart.
- Terminal hangs.
- Zombie processes hold onto communication ports, preventing new commands from starting a fresh server.
Workaround identified:
Using the --standalone flag forces OpenCode to behave like the Ubuntu version (stateless), starting and stopping cleanly with the command.
Proposed Fix: Investigate why the persistent background service fails to shut down correctly on Fedora's networking/process management and ensure it cleans up properly, or consider making standalone mode the default or more easily configurable on Fedora.
Reference guide content:
- Problem: Zombie processes holding onto communication ports.
- Current workaround: Add wrappers to ~/.bashrc to use
--standaloneand manually kill zombie processes.
Thanks for reporting this! It sounds frustrating. Right now the description is fairly general, so we can't yet tell which background-service problem you're hitting. Could you describe briefly, in your own words, what you did, what you expected and what you saw? In particular:
- The output of
opencode --version, and how you installed OpenCode (npm, install script, package manager, etc.). - The exact steps: which command you ran, and what you did before it failed (e.g. pressed Ctrl+C in the TUI, then ran
opencodeagain). - The exact error output, copied in full, including the "Connection Refused" message and the command that printed it.
- While it's broken, the output of
opencode service statusand ofss -ltnp | grep opencode(orps aux | grep opencode), so we can see which processes are still running and which ports they hold. - Whether
opencode service stop(instead of killing processes by hand) gets you working again.
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 you're done editing.
These existing issues look related, ordered from most to least likely. Please check whether one of them already covers your problem:
- #54267: relaunching fails with "Managed service port … already in use" because the previous background service hasn't exited yet (Linux)
- #62326: a leftover background service blocks startup until
opencode service stopis run - #57032: "Background service failed to start" / port already in use at startup on Linux
- #52021: the CLI intermittently times out waiting for the background service even though it is running
Same thing, except I'm on a Mac, and I'm very frustrated. Version 2.2.5 shows EHOSTUNREACH: Was there a typo in the url or port?, and version 2.2.6 shows Can't reach 192.168.31.82. Check the networkconnection. (EHOSTUNREACH: Was there atypo in the url or port?). My current conclusion is that it's a zombie process that hasn't exited cleanly.
We haven't heard back, so I'm closing this for now. Without the OpenCode version, the exact steps and the full "Connection Refused" error output, we couldn't tell which background-service problem this is or reproduce it on Fedora.
These existing issues may cover what you saw:
- #54267: relaunching fails with "Managed service port … already in use" because the previous background service hasn't exited
- #62326: a leftover background service blocks startup until
opencode service stopis run
If this still happens on the latest v2, please reply with the output of opencode --version, the steps you took, the exact error, and the output of opencode service status while it's broken. We can reopen it then. Thanks!
We haven't heard back, so I'm closing this for now. Without the OpenCode version, the exact steps and the full "Connection Refused" error output, we couldn't tell which background-service problem this is or reproduce it on Fedora.
These existing issues may cover what you saw:
* [service: relaunch fails with "Managed service port already in use" when previous background service has not exited #54267](https://github.com/anomalyco/opencode/issues/54267): relaunching fails with "Managed service port … already in use" because the previous background service hasn't exited * [Windows: "Background service failed to start" after update until `opencode service stop` is run #62326](https://github.com/anomalyco/opencode/issues/62326): a leftover background service blocks startup until `opencode service stop` is runIf this still happens on the latest v2, please reply with the output of
opencode --version, the steps you took, the exact error, and the output ofopencode service statuswhile it's broken. We can reopen it then. Thanks!
Yes it is reoccur. No responce from opencode team Lol. Stupid bot. Another user mentioned it doesnt work on macos as well. So fedora + mac currently cant use v2