openai/codex · error · io::Error

remote control pairing failed at

Error message

remote control pairing failed at `{}`: HTTP {status}, {}, body: {body_preview}

What it means

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).

Solutions

  1. On 401/403, re-authenticate to the remote-control service before retrying pairing.
  2. On 404/410, the pair URL or server enrollment is stale — re-enroll the server.
  3. For 5xx, retry with backoff; otherwise surface the body preview to logs for diagnosis.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at codex-rs/app-server-transport/src/transport/remote_control/enroll.rs:90 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/5e3bcf31e3c34ea8. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/app-server-transport/src/transport/remote_control/enroll.rs:90

                    self.remote_control_target.pair_url
                ))
            })?;
        let headers = response.headers().clone();
        let status = response.status();
        let body = response.bytes().await.map_err(|err| {
            io::Error::other(format!(
                "failed to read remote control pairing response from `{}`: {err}",
                self.remote_control_target.pair_url
            ))
        })?;
        let body_preview = preview_remote_control_response_body(&body);
        if !status.is_success() {
            let error_kind = match status.as_u16() {
                401 | 403 => ErrorKind::PermissionDenied,
                404 => ErrorKind::NotFound,
                _ => ErrorKind::Other,
            };
            return Err(io::Error::new(
                error_kind,
                format!(
                    "remote control pairing failed at `{}`: HTTP {status}, {}, body: {body_preview}",
                    self.remote_control_target.pair_url,
                    format_headers(&headers)
                ),
            ));
        }

        let pairing = serde_json::from_slice::<StartRemoteControlPairingResponse>(&body).map_err(
            |err| {
                io::Error::other(format!(
                    "failed to parse remote control pairing response from `{}`: HTTP {status}, {}, body: {body_preview}, decode error: {err}",
                    self.remote_control_target.pair_url,
                    format_headers(&headers)
                ))
            },
        )?;

View on GitHub (pinned to 339751715c)