{"record":{"id":"b5d87a8d9abdae8a","repo":"zed-industries/zed","slug":"unknown-bind-error","errorCode":null,"errorMessage":"unknown bind error","messagePattern":"unknown bind error","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/oauth_callback_server/src/oauth_callback_server.rs","lineNumber":450,"sourceCode":"                    }\n\n                    if !cancel_attempted {\n                        cancel_attempted = true;\n                        if let Err(cancel_err) = send_cancel_request(host, port) {\n                            log::warn!(\n                                \"Failed to cancel previous OAuth callback server on {addr}: {cancel_err}\"\n                            );\n                        }\n                    }\n\n                    last_err = Some(anyhow!(err));\n                    std::thread::sleep(BIND_RETRY_DELAY);\n                }\n            }\n        }\n\n        Err(last_err\n            .unwrap_or_else(|| anyhow!(\"unknown bind error\"))\n            .context(format!(\n                \"OAuth callback port {addr} remained in use after {BIND_MAX_ATTEMPTS} attempts\"\n            )))\n    }\n\n    /// Sends `GET /cancel` to a listener on `host:port`, asking it to shut down.\n    ///\n    /// Best-effort: errors here are surfaced to the caller for logging but do\n    /// not block the subsequent rebind attempt.\n    fn send_cancel_request(host: &str, port: u16) -> std::io::Result<()> {\n        use std::io::{Read as _, Write as _};\n        use std::net::{TcpStream, ToSocketAddrs as _};\n\n        let addr = format!(\"{host}:{port}\")\n            .to_socket_addrs()?\n            .next()\n            .ok_or_else(|| {\n                std::io::Error::new(","sourceCodeStart":432,"sourceCodeEnd":468,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/oauth_callback_server/src/oauth_callback_server.rs#L432-L468","documentation":"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.","triggerScenarios":"Thrown at crates/oauth_callback_server/src/oauth_callback_server.rs:450 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the OAuth sign-in","Check loopback interface and firewall configuration","Inspect OS-level errors (e.g. with lsof/netstat on 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"}