opencode icon indicating copy to clipboard operation
opencode copied to clipboard

v2+ is unusable on Fedora - Zombie Service and Connection Refused errors

Open skorphil opened this issue 4 weeks ago • 4 comments

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 --standalone and manually kill zombie processes.

skorphil avatar Nov 08 '26 15:11 skorphil

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:

  1. The output of opencode --version, and how you installed OpenCode (npm, install script, package manager, etc.).
  2. The exact steps: which command you ran, and what you did before it failed (e.g. pressed Ctrl+C in the TUI, then ran opencode again).
  3. The exact error output, copied in full, including the "Connection Refused" message and the command that printed it.
  4. While it's broken, the output of opencode service status and of ss -ltnp | grep opencode (or ps aux | grep opencode), so we can see which processes are still running and which ports they hold.
  5. 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 stop is 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

opencodejr[bot] avatar Nov 08 '26 15:11 opencodejr[bot]

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.

yuanmaweiwu avatar Nov 09 '26 07:11 yuanmaweiwu

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 stop is 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!

opencodejr[bot] avatar Nov 11 '26 15:11 opencodejr[bot]

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 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!

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

skorphil avatar Nov 24 '26 11:11 skorphil