{"record":{"id":"192d0128f8c7ed4f","repo":"jdx/mise","slug":"github-relay-is-not-connected","errorCode":null,"errorMessage":"GitHub relay is not connected","messagePattern":"GitHub relay is not connected","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/github_relay.rs","lineNumber":910,"sourceCode":"        command: &mut tokio::process::Command,\n        socket: Option<&Path>,\n    ) -> Result<std::process::ExitStatus> {\n        let mut terminate =\n            tokio::signal::unix::signal(tokio::signal::unix::SignalKind::terminate())?;\n        let mut hangup = tokio::signal::unix::signal(tokio::signal::unix::SignalKind::hangup())?;\n        let heartbeat = if let Some(socket) = socket {\n            let client = Client::builder()\n                .unix_socket(socket)\n                .no_proxy()\n                .timeout(Duration::from_secs(3))\n                .build()?;\n            if !client\n                .get(\"http://localhost/_session\")\n                .send()\n                .await\n                .is_ok_and(|r| r.status() == 204)\n            {\n                bail!(\"GitHub relay is not connected\");\n            }\n            Some(client)\n        } else {\n            None\n        };\n        let disconnected = async {\n            let Some(client) = heartbeat else {\n                std::future::pending::<()>().await;\n                return;\n            };\n            let mut failures = 0;\n            loop {\n                tokio::time::sleep(Duration::from_secs(2)).await;\n                if client\n                    .get(\"http://localhost/_session\")\n                    .send()\n                    .await\n                    .is_ok_and(|r| r.status() == 204)","sourceCodeStart":892,"sourceCodeEnd":928,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/github_relay.rs#L892-L928","documentation":"In `wait_command`, before handing the HTTP client to the session, the relay performs a health check against `http://localhost/_session` and requires a 204. If the health probe fails or returns any other status, the relay considers itself disconnected and bails with \"GitHub relay is not connected\". It means the local relay server isn't up, isn't ready, or its connection to GitHub is broken.","triggerScenarios":"Calling the relay session while the relay process is not yet started or has exited; the `_session` endpoint returns a non-204 status (relay lost upstream connectivity); connection to the local relay port is refused.","commonSituations":"Running git/HTTP operations before the relay background task finished starting; relay crashed due to network/auth problems; firewall or proxy blocking localhost socket; stale environment pointing at a dead relay.","solutions":["Wait for the relay to report ready / retry the operation — the relay may still be connecting at startup.","Restart the mise relay/session process and check its logs for upstream connection or auth errors.","Verify nothing (proxy env vars, firewall) is intercepting the localhost `_session` health request.","If the relay persistently reports disconnected, check GitHub reachability/credentials and re-authenticate."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// poll until the relay is ready before use\nfor _ in 0..30 {\n    if reqwest::get(\"http://localhost/_session\").await.map(|r| r.status() == 204) == Ok(true) { break; }\n    tokio::time::sleep(std::time::Duration::from_millis(200)).await;\n}","typeGuard":null,"tryCatchPattern":"match session(client).await {\n    Err(e) if e.to_string().contains(\"not connected\") => {\n        wait_for_relay_ready().await?;\n        session(client).await\n    }\n    other => other,\n}","preventionTips":["Wait for the relay's ready signal before issuing session commands","Monitor relay process health and restart on crash","Keep proxy/no_proxy settings from interfering with localhost requests"],"tags":["network","health-check","relay","github","local-server"],"backgroundTag":"connection-refused","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}