{"record":{"id":"480ec31773aefae9","repo":"BigPizzaV3/CodexPlusPlus","slug":"failed-to-query-cdp-targets-on-loopback-addresses","errorCode":null,"errorMessage":"failed to query CDP targets on loopback addresses: {}","messagePattern":"failed to query CDP targets on loopback addresses: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/cdp.rs","lineNumber":139,"sourceCode":"    let client = reqwest::Client::builder()\n        .no_proxy()\n        .timeout(CDP_HTTP_TIMEOUT)\n        .build()\n        .context(\"failed to build CDP HTTP client\")?;\n\n    let urls = [\n        format!(\"http://127.0.0.1:{debug_port}/json\"),\n        format!(\"http://[::1]:{debug_port}/json\"),\n    ];\n    let mut errors = Vec::new();\n    for url in urls {\n        match query_targets_url(&client, &url, debug_port).await {\n            Ok(targets) => return Ok(targets),\n            Err(error) => errors.push(format!(\"{url}: {error:#}\")),\n        }\n    }\n\n    bail!(\n        \"failed to query CDP targets on loopback addresses: {}\",\n        errors.join(\"; \")\n    )\n}\n\npub async fn browser_identity(debug_port: u16) -> anyhow::Result<CdpBrowserIdentity> {\n    let client = reqwest::Client::builder()\n        .no_proxy()\n        .timeout(CDP_HTTP_TIMEOUT)\n        .build()\n        .context(\"failed to build CDP HTTP client\")?;\n    let urls = [\n        format!(\"http://127.0.0.1:{debug_port}/json/version\"),\n        format!(\"http://[::1]:{debug_port}/json/version\"),\n    ];\n    let mut errors = Vec::new();\n    for url in urls {\n        let result = async {","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/cdp.rs#L121-L157","documentation":"Raised in list_targets after the CDP /json endpoint failed on both loopback addresses (127.0.0.1 and [::1]) for the debug port; all individual errors are aggregated into the message. Usually means the browser debug port is closed, the browser is not running, or something intercepted the loopback HTTP request.","triggerScenarios":"Thrown at crates/codex-plus-core/src/cdp.rs:139 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the browser runs with --remote-debugging-port=<port>","Check the debug port passed to list_targets","Ensure no proxy intercepts loopback HTTP (client uses no_proxy)","Test `curl http://127.0.0.1:<port>/json` manually"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}