{"record":{"id":"c9666aa4fd20604e","repo":"zed-industries/zed","slug":"server-not-bound-to-a-tcp-address","errorCode":null,"errorMessage":"server not bound to a TCP address","messagePattern":"server not bound to a TCP address","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/oauth_callback_server/src/oauth_callback_server.rs","lineNumber":251,"sourceCode":"    )> {\n        start_oauth_callback_server_with_config(OAuthCallbackServerConfig::default())\n    }\n\n    /// Start a loopback HTTP server with custom host/port/path.\n    ///\n    /// Use this when the OAuth client requires a specific redirect URI that the\n    /// default ephemeral-port `http://127.0.0.1:<port>/callback` doesn't match.\n    pub fn start_oauth_callback_server_with_config(\n        config: OAuthCallbackServerConfig,\n    ) -> Result<(\n        String,\n        futures::channel::oneshot::Receiver<Result<OAuthCallbackParams>>,\n    )> {\n        let server = bind_callback_server(&config)?;\n        let port = server\n            .server_addr()\n            .to_ip()\n            .ok_or_else(|| anyhow!(\"server not bound to a TCP address\"))?\n            .port();\n\n        let redirect_uri = format!(\"http://{}:{}{}\", config.host, port, config.path);\n        let expected_path = config.path;\n\n        let (tx, rx) = futures::channel::oneshot::channel();\n\n        std::thread::spawn(move || {\n            let deadline = std::time::Instant::now() + OAUTH_CALLBACK_TIMEOUT;\n\n            loop {\n                if tx.is_canceled() {\n                    return;\n                }\n                let remaining = deadline.saturating_duration_since(std::time::Instant::now());\n                if remaining.is_zero() {\n                    return;\n                }","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/oauth_callback_server/src/oauth_callback_server.rs#L233-L269","documentation":"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.","triggerScenarios":"Thrown at crates/oauth_callback_server/src/oauth_callback_server.rs:251 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the configured host/port is free and not blocked by firewall","Use the default ephemeral-port configuration instead of a fixed port","Retry after closing the application holding the port"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}