{"record":{"id":"97d1bacf7e434502","repo":"zeroclaw-labs/zeroclaw","slug":"nevis-health-check-failed-http","errorCode":null,"errorMessage":"Nevis health check failed: HTTP {}","messagePattern":"Nevis health check failed: HTTP (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/zeroclaw-runtime/src/security/nevis.rs","lineNumber":336,"sourceCode":"    }\n\n    /// Health check against the Nevis instance.\n    pub async fn health_check(&self) -> Result<()> {\n        let health_url = format!(\n            \"{}/auth/realms/{}\",\n            self.instance_url.trim_end_matches('/'),\n            self.realm,\n        );\n\n        let resp = self\n            .http_client\n            .get(&health_url)\n            .send()\n            .await\n            .context(\"Nevis health check failed: cannot reach instance\")?;\n\n        if !resp.status().is_success() {\n            bail!(\"Nevis health check failed: HTTP {}\", resp.status().as_u16());\n        }\n\n        Ok(())\n    }\n\n    /// Getter for instance URL (for diagnostics).\n    pub fn instance_url(&self) -> &str {\n        &self.instance_url\n    }\n\n    /// Getter for realm.\n    pub fn realm(&self) -> &str {\n        &self.realm\n    }\n}\n\n// ── Wire types for Nevis API responses ─────────────────────────────\n","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-runtime/src/security/nevis.rs#L318-L354","documentation":"health_check GETs {instance_url}/auth/realms/{realm} (nevis.rs:321-337) and fails on any non-2xx status. A separate earlier message ('cannot reach instance') covers connection failures. This method exists for startup and readiness diagnostics, not per-request auth.","triggerScenarios":"Calling health_check when the realm is misspelled (404), Nevis sits behind a proxy returning 502/503, or instance_url points at the wrong host or path prefix.","commonSituations":"Readiness probe wired to health_check during an IdP upgrade window; DNS not resolvable from the ZeroClaw host; instance_url with an extra path segment producing 404.","solutions":["From the ZeroClaw host, curl {instance_url}/auth/realms/{realm} and confirm it returns 200","Fix instance_url or realm if the realm root returns 404","For 5xx or unreachable instances, mark the gateway degraded and retry — do not crash the process"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"Treat any health_check error as 'not ready': report unhealthy to the orchestrator and let the probe schedule retry; distinguish 'cannot reach instance' (network/DNS) from 'HTTP {code}' (config or IdP state) in logs.","preventionTips":["Run health_check at startup so realm/URL mistakes surface before traffic","Alert on health-check failure rate, not a single blip","Verify DNS and firewall paths from the runtime host, not your workstation"],"tags":["nevis","health-check","oauth","http-status","rust"],"backgroundTag":"health-check-failed","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}