Skip to content

Auto-switch port when getting: "RuntimeError: Failed to bind to WebSocket port 9877: Address already in use (os error 98)" #4241

@saryazdi

Description

@saryazdi

Describe the annoyance

Currently if there's a rerun server already using WebSocket port 9877 on a machine, rr.serve throws the following error:

RuntimeError: Failed to bind to WebSocket port 9877: Address already in use (os error 98)

To Reproduce

  1. Launch a script that runs rr.serve (I ran into it on python, but you can try cd rerun/examples/rust && cargo run --bin minimal_serve)
  2. While 1 is running, launch above script again in another terminal.

Expected behavior

Assign a different free port (e.g. streamlit does this also).

Your goals

  • Having multiple rr.serve sessions open
  • Running rr.serve on a shared machine/server where multiple users might simultaneously be using rerun

Desktop (please complete the following information):

  • OS: Ubuntu 20.04.6 LTS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions