{"record":{"id":"5e3bcf31e3c34ea8","repo":"openai/codex","slug":"remote-control-pairing-failed-at-http-statu","errorCode":null,"errorMessage":"remote control pairing failed at `{}`: HTTP {status}, {}, body: {body_preview}","messagePattern":"remote control pairing failed at `(.+?)`: HTTP (.+?), (.+?), body: (.+?)","errorType":"http","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/app-server-transport/src/transport/remote_control/enroll.rs","lineNumber":90,"sourceCode":"                    self.remote_control_target.pair_url\n                ))\n            })?;\n        let headers = response.headers().clone();\n        let status = response.status();\n        let body = response.bytes().await.map_err(|err| {\n            io::Error::other(format!(\n                \"failed to read remote control pairing response from `{}`: {err}\",\n                self.remote_control_target.pair_url\n            ))\n        })?;\n        let body_preview = preview_remote_control_response_body(&body);\n        if !status.is_success() {\n            let error_kind = match status.as_u16() {\n                401 | 403 => ErrorKind::PermissionDenied,\n                404 => ErrorKind::NotFound,\n                _ => ErrorKind::Other,\n            };\n            return Err(io::Error::new(\n                error_kind,\n                format!(\n                    \"remote control pairing failed at `{}`: HTTP {status}, {}, body: {body_preview}\",\n                    self.remote_control_target.pair_url,\n                    format_headers(&headers)\n                ),\n            ));\n        }\n\n        let pairing = serde_json::from_slice::<StartRemoteControlPairingResponse>(&body).map_err(\n            |err| {\n                io::Error::other(format!(\n                    \"failed to parse remote control pairing response from `{}`: HTTP {status}, {}, body: {body_preview}, decode error: {err}\",\n                    self.remote_control_target.pair_url,\n                    format_headers(&headers)\n                ))\n            },\n        )?;","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/app-server-transport/src/transport/remote_control/enroll.rs#L72-L108","documentation":"HTTP failure in start_pairing: the remote-control pairing endpoint returned a non-2xx status. The message includes the pair URL, HTTP status, response headers, and a truncated body preview; the io::ErrorKind is chosen from the status code (400 → InvalidInput, 401/403 → PermissionDenied, 404 → NotFound, else Other).","triggerScenarios":"Thrown at codex-rs/app-server-transport/src/transport/remote_control/enroll.rs:90 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["On 401/403, re-authenticate to the remote-control service before retrying pairing.","On 404/410, the pair URL or server enrollment is stale — re-enroll the server.","For 5xx, retry with backoff; otherwise surface the body preview to logs for diagnosis."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}