Skip to content

CLI: web and serve show generic error message when the port is already in use #46263

Closed as not planned

Description

@MohamedSayed0573

Description

opencode web --port 3000
opencode serve --port 3000

show vague error message when the port is already in use

Plugins

No response

OpenCode version

1.18.25

Steps to reproduce

nc -l 4096 // Listen on 4096
opencode web --port 4096

Screenshot and/or share link

Image

Operating System

WSL2

Terminal

Tmux

Activity

  1. github-actions commented on Aug 30, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • Steps to reproduce is empty — please describe how to trigger this error (e.g. which command you ran, whether a port was already occupied, etc.)
    • OpenCode version is empty — please provide the version you were using
    • Operating System and Terminal are empty — these help narrow down environment-specific issues
    • The description contains only a screenshot with no textual context; please add a brief written description of what you observed and what you expected

    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:

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. added
    needs:complianceThis means the issue will auto-close after 2 hours.
    and removed
    needs:complianceThis means the issue will auto-close after 2 hours.
    on Aug 30, 2026
  3. github-actions commented on Aug 30, 2026

    @github-actions
    Contributor

    Thank you for updating the issue! It now includes a clear description, steps to reproduce, a screenshot, your OpenCode version, OS, and terminal info. Everything looks good — the needs:compliance label has been removed.

  4. ling9ling7 commented on Sep 28, 2026

    @ling9ling7

    Related (Windows-specific, different root cause): #51899 — same bare Unexpected error / ServeError, but in my case the port is held by an orphaned socket whose owning PID no longer exists (netstat shows a LISTENING entry, tasklist shows no such process), so there is no listener to kill and only a reboot clears it. Includes a raw TcpListener bind test proving the WSAEADDRINUSE, plus a suggestion to detect and report this state explicitly.

  5. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions