zed-industries/zed · error

server not bound to a TCP address

Error message

server not bound to a TCP address

What it means

Startup guard in start_oauth_callback_server_with_config: bind_callback_server returned no server (all bind attempts failed), so there is no loopback listener to receive the OAuth redirect and the redirect URI cannot be produced.

Source

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

    )> {
        start_oauth_callback_server_with_config(OAuthCallbackServerConfig::default())
    }

    /// Start a loopback HTTP server with custom host/port/path.
    ///
    /// Use this when the OAuth client requires a specific redirect URI that the
    /// default ephemeral-port `http://127.0.0.1:<port>/callback` doesn't match.
    pub fn start_oauth_callback_server_with_config(
        config: OAuthCallbackServerConfig,
    ) -> Result<(
        String,
        futures::channel::oneshot::Receiver<Result<OAuthCallbackParams>>,
    )> {
        let server = bind_callback_server(&config)?;
        let port = server
            .server_addr()
            .to_ip()
            .ok_or_else(|| anyhow!("server not bound to a TCP address"))?
            .port();

        let redirect_uri = format!("http://{}:{}{}", config.host, port, config.path);
        let expected_path = config.path;

        let (tx, rx) = futures::channel::oneshot::channel();

        std::thread::spawn(move || {
            let deadline = std::time::Instant::now() + OAUTH_CALLBACK_TIMEOUT;

            loop {
                if tx.is_canceled() {
                    return;
                }
                let remaining = deadline.saturating_duration_since(std::time::Instant::now());
                if remaining.is_zero() {
                    return;
                }

View on GitHub (pinned to f4178619ac)

Solutions

  1. Check that the configured host/port is free and not blocked by firewall
  2. Use the default ephemeral-port configuration instead of a fixed port
  3. Retry after closing the application holding the port
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/oauth_callback_server/src/oauth_callback_server.rs:251 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/c9666aa4fd20604e. Report an issue: GitHub.