Skip to content

Updates #55107

Closed
Closed

Description

@pixelcreatives

Description

Every single opencode update brings a new error, how is that possible?

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. opencode-agent commented on Oct 13, 2026

    @opencode-agent
    Contributor

    Thanks for the report, and sorry about the trouble with updates. We need a bit more detail before we can look into it:

    • The exact error you get after updating: the full message, a screenshot or the relevant log output.
    • Your OpenCode version (opencode --version), and the version you updated from if you know it.
    • How you installed OpenCode (npm, curl install script, Homebrew, desktop app, etc.) and how you update it.
    • Your operating system, and your terminal if the error shows up in the TUI.
    • What you were doing when the error appeared, e.g. on startup, when running a specific command or when sending a prompt.
    • Any plugins or custom config you use, since these sometimes break after an update.

    If you've hit different errors across several updates, please describe the most recent one first. Separate problems are best filed as separate issues.

    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.

  2. pixelcreatives commented on Oct 13, 2026

    @pixelcreatives
    Author

    Error: Desktop IPC handler failed
    at cee (oc://renderer/assets/main-LkJVdThx.js:2:30745)
    at see (oc://renderer/assets/main-LkJVdThx.js:2:30411)
    at MessagePort. (oc://renderer/assets/main-LkJVdThx.js:2:29128)
    at MessagePort.i (oc://renderer/assets/esm-BnYEL-oC.js:15:6665)

    ────────────────────────────────────────
    Causado por:
    {
    "name": "UnknownError",
    "message": "An error occurred in Effect.tryPromise",
    "cause": {
    "name": "Error",
    "message": "Background service failed to start"
    }
    }

  3. opencode-agent commented on Oct 13, 2026

    @opencode-agent
    Contributor

    Thanks for the error output. It shows the OpenCode Desktop app (v2) can't start its local background service. "Background service failed to start" is a generic message, though, so the real cause isn't in this output yet. To narrow it down, could you share:

    • The OpenCode Desktop version (shown in the updater or About screen), and the version you had before the update if you know it.
    • Your operating system and version (e.g. Windows 11 23H2, macOS 15).
    • The debug logs: click Export Logs on the error screen. It saves an opencode-debug-<date>.zip file to your Downloads folder. Please attach it here, or paste the relevant part of the server log. Look through it first and remove anything private.
    • Whether it fails every time you open the app, or only when you reopen it right after closing it. Does it start working again after a reboot?
    • If you also have the opencode CLI installed in a terminal, the output of opencode service status and opencode service start.

    These existing issues look related. The list is ordered by likelihood, so please check whether one of them already covers your problem:

    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.

  4. pixelcreatives commented on Oct 13, 2026

    @pixelcreatives
    Author
  5. opencode-agent commented on Oct 13, 2026

    @opencode-agent
    Contributor

    Thanks for the debug logs, they showed what was going on. In your server log, the background service hung, the app restarted it several times, and one restart failed while starting up with SQLiteError: disk I/O error. That failed process never exited. It kept the service port, so every launch afterwards showed "Background service failed to start", even though the original problem may already have cleared.

    I reproduced this on Linux with the 2.0.28 CLI. I couldn't test the desktop app or Windows here, but the failed state comes from the shared server code.

    1. Start the background service once so the data directory exists, then stop it.
    2. Corrupt the service database to force a startup error. opencode service start fails, but the serve --service process stays running.
    3. Restore a working database and start again. It still fails with Background service failed to start every time, and opencode service status says stopped although the old process is still running.

    This still happens on the latest dev (e9def88). The script below reproduces it.

    Workaround: close OpenCode, then in Task Manager end any leftover opencode-cli.exe / opencode processes, or reboot, and open the app again. If you have the CLI, opencode service stop should also clear it.

    Related: #54810 covers the slow startup and restart storm that probably caused the first failure. #54267 covers port conflicts on relaunch.

    Reproduction script (repro.sh)
    #!/usr/bin/env bash
    # Repro for anomalyco/opencode#55107: a background service whose boot fails
    # (here: SQLite error) stays alive holding the managed port in "failed" state,
    # so every later launch reports "Background service failed to start" even
    # after the cause is gone.
    #
    # Usage: ./repro.sh                 # uses `opencode` from PATH
    #        OC="bun ... /path/packages/cli/src/index.ts" ./repro.sh   # from source
    set -u
    OC=${OC:-opencode}
    export HOME=${REPRO_HOME:-/tmp/opencode/h55107}
    rm -rf "$HOME"; mkdir -p "$HOME/.local/share/opencode"
    D=$HOME/.local/share/opencode
    cd "${REPRO_CWD:-$(mktemp -d)}"
    
    echo "== version: $($OC --version)"
    echo "== 1. normal start/stop to create the data dir"
    timeout 90 $OC service start; $OC service stop >/dev/null 2>&1; sleep 2
    
    echo "== 2. simulate a boot-time SQLite failure (author saw 'SQLiteError: disk I/O error')"
    DB=$(ls "$D"/opencode*.db | head -1)   # opencode.db (release) or opencode-local.db (source)
    rm -f "$DB"-wal "$DB"-shm
    head -c 8192 /dev/urandom > "$DB"
    timeout 90 $OC service start; echo "exit=$?"
    grep -h "background service boot failed" "$D"/log/*.log | tail -1 | cut -c1-200
    echo "service processes:"; pgrep -af "serve --service" | grep -v pgrep
    
    echo "== 3. remove the cause (fresh DB) and launch again"
    mv "$DB" "$D/corrupt.db"
    for i in 1 2; do timeout 90 $OC service start 2>&1 | head -1; done
    echo "status: $($OC service status 2>&1 | head -1)"
    echo "service processes (same PID still alive = bug):"; pgrep -af "serve --service" | grep -v pgrep
    
    $OC service stop >/dev/null 2>&1; sleep 2; pkill -f "serve --service" 2>/dev/null; true

    Run it: bash repro.sh

  6. Dante-dan commented on Oct 14, 2026

    @Dante-dan
    Contributor

    I’m taking the failed-boot service cleanup. The server keeps its failed health endpoint alive, but both clients currently return the startup error without stopping that registered owner. I’m checking cleanup before returning that error while preserving the existing failed-health and registration ownership contracts.

  7. rekram1-node commented on Oct 16, 2026

    @rekram1-node
    Contributor

    THis was fixed on latest desktop release there were some port conflict issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions