{"record":{"id":"6ffa4960441a301d","repo":"BigPizzaV3/CodexPlusPlus","slug":"http-status","errorCode":null,"errorMessage":"获取微信登录二维码失败：HTTP {status}","messagePattern":"获取微信登录二维码失败：HTTP (.+?)","errorType":"http","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/connect/weixin.rs","lineNumber":157,"sourceCode":"        })\n    }\n\n    pub async fn fetch_qr_code(base_url: &str, route_tag: &str) -> anyhow::Result<WeixinQrCode> {\n        let client = Self::new(base_url, \"\", route_tag)?;\n        let mut url = client.endpoint(\"ilink/bot/get_bot_qrcode\")?;\n        url.query_pairs_mut().append_pair(\"bot_type\", \"3\");\n        let response = client\n            .client\n            .get(url)\n            .headers(client.route_headers(false)?)\n            .timeout(Duration::from_secs(40))\n            .send()\n            .await\n            .context(\"获取微信登录二维码失败\")?;\n        let (status, bytes) =\n            read_response_limited(response, MAX_SMALL_RESPONSE_BYTES, \"微信二维码\").await?;\n        if !status.is_success() {\n            bail!(\"获取微信登录二维码失败：HTTP {status}\");\n        }\n        let qr: WeixinQrCode = serde_json::from_slice(&bytes).context(\"微信二维码响应格式无效\")?;\n        if qr.qr_code.trim().is_empty() || qr.qr_content.trim().is_empty() {\n            bail!(\"微信二维码响应缺少必要字段\");\n        }\n        Ok(qr)\n    }\n\n    pub async fn poll_qr_status(\n        base_url: &str,\n        route_tag: &str,\n        qr_code: &str,\n    ) -> anyhow::Result<WeixinQrStatus> {\n        let client = Self::new(base_url, \"\", route_tag)?;\n        let mut url = client.endpoint(\"ilink/bot/get_qrcode_status\")?;\n        url.query_pairs_mut().append_pair(\"qrcode\", qr_code);\n        let response = client\n            .client","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/connect/weixin.rs#L139-L175","documentation":"fetch_qr_code GETs the ilink bot QR endpoint with a 40s timeout and a size-limited body to obtain a WeChat login QR code; a non-2xx HTTP status aborts with this error. Transport-level failures surface separately through context, so this is specifically an HTTP error status from the gateway.","triggerScenarios":"base_url points at the wrong gateway or a mistyped host (404); the route tag or bot identity is rejected (4xx); the WeChat ilink service returns 5xx during maintenance.","commonSituations":"Typo in base_url; gateway endpoint moved; rate-limited or region-blocked IP; corporate proxy returning 407 or 502.","solutions":["Verify base_url reaches the ilink gateway by requesting the endpoint directly and checking the status","Confirm route_tag and the bot_type query match the working manager build","Retry after a short wait for transient 5xx and inspect the body via a proxy for 4xx cause","Update codex-plus-manager if the endpoint contract changed"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// prove the endpoint is reachable and 2xx before showing UI\nlet probe = reqwest::Client::new().get(format!(\"{base}/ilink/bot/get_bot_qrcode?bot_type=3\")).send().await?;\nensure!(probe.status().is_success(), \"gateway unhealthy\");","typeGuard":null,"tryCatchPattern":"let qr = match WeixinClient::fetch_qr_code(&base, &tag).await {\n    Ok(qr) => qr,\n    Err(e) if e.to_string().contains(\"HTTP \") => {\n        tokio::time::sleep(Duration::from_secs(2)).await;\n        WeixinClient::fetch_qr_code(&base, &tag).await?\n    }\n    Err(e) => return Err(e),\n};","preventionTips":["Validate base_url at config save time","Retry QR fetches with backoff, gateway 5xx is common in maintenance","Keep route_tag in sync with the manager build"],"tags":["weixin","http","qr-code","login"],"backgroundTag":"http-error-response","analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}