zed-industries/zed · error · anyhow::Error

unknown bind error

Error message

unknown bind error

What it means

Fallback in try_bind_with_cancel: the bind loop ended without recording any specific error (last_err was None), so a generic unknown-bind-error is returned. Means the listener could not be established for an atypical reason.

Source

Thrown at crates/oauth_callback_server/src/oauth_callback_server.rs:450

                    }

                    if !cancel_attempted {
                        cancel_attempted = true;
                        if let Err(cancel_err) = send_cancel_request(host, port) {
                            log::warn!(
                                "Failed to cancel previous OAuth callback server on {addr}: {cancel_err}"
                            );
                        }
                    }

                    last_err = Some(anyhow!(err));
                    std::thread::sleep(BIND_RETRY_DELAY);
                }
            }
        }

        Err(last_err
            .unwrap_or_else(|| anyhow!("unknown bind error"))
            .context(format!(
                "OAuth callback port {addr} remained in use after {BIND_MAX_ATTEMPTS} attempts"
            )))
    }

    /// Sends `GET /cancel` to a listener on `host:port`, asking it to shut down.
    ///
    /// Best-effort: errors here are surfaced to the caller for logging but do
    /// not block the subsequent rebind attempt.
    fn send_cancel_request(host: &str, port: u16) -> std::io::Result<()> {
        use std::io::{Read as _, Write as _};
        use std::net::{TcpStream, ToSocketAddrs as _};

        let addr = format!("{host}:{port}")
            .to_socket_addrs()?
            .next()
            .ok_or_else(|| {
                std::io::Error::new(

View on GitHub (pinned to f4178619ac)

Solutions

  1. Retry the OAuth sign-in
  2. Check loopback interface and firewall configuration
  3. Inspect OS-level errors (e.g. with lsof/netstat on the port)
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/oauth_callback_server/src/oauth_callback_server.rs:450 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/b5d87a8d9abdae8a. Report an issue: GitHub.