{"record":{"id":"7e6c8c7e311fc9de","repo":"tinyhumansai/openhuman","slug":"failed-to-parse-searxng-response-err","errorCode":null,"errorMessage":"Failed to parse SearXNG response: {err}","messagePattern":"Failed to parse SearXNG response: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/search/tools/searxng.rs","lineNumber":196,"sourceCode":"            .timeout(Duration::from_secs(self.timeout_secs))\n            .send()\n            .await\n            .map_err(|err| {\n                tracing::warn!(error = %err, \"[searxng] request failed\");\n                anyhow::anyhow!(\"SearXNG request failed: {err}\")\n            })?;\n\n        let status = response.status();\n        if !status.is_success() {\n            let body = response.text().await.unwrap_or_default();\n            let detail = utf8_safe_prefix_at_byte_boundary(&body, 500);\n            tracing::warn!(status = %status, \"[searxng] non-2xx response: {detail}\");\n            anyhow::bail!(\"SearXNG returned {status}: {detail}\");\n        }\n\n        let raw: RawSearxngResponse = response.json().await.map_err(|err| {\n            tracing::warn!(error = %err, \"[searxng] failed to parse JSON response\");\n            anyhow::anyhow!(\"Failed to parse SearXNG response: {err}\")\n        })?;\n\n        let results = normalize_results(raw, max_results);\n        tracing::debug!(result_count = results.len(), \"[searxng] search complete\");\n\n        Ok(SearxngSearchResponse {\n            query: query.to_string(),\n            results,\n        })\n    }\n\n    fn search_endpoint_url(&self) -> anyhow::Result<reqwest::Url> {\n        let base = self.base_url.trim().trim_end_matches('/');\n        if base.is_empty() {\n            anyhow::bail!(\"SearXNG base_url cannot be empty\");\n        }\n        let endpoint = if base.ends_with(\"/search\") {\n            base.to_string()","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/search/tools/searxng.rs#L178-L214","documentation":"Response-deserialization guard in SearxngTool::search: the request returned 2xx but the body did not parse into the expected SearXNG JSON result shape — e.g. the instance returned HTML (a captcha or error page), an empty body, or a schema-incompatible payload. The serde error is logged and rewrapped with this message.","triggerScenarios":"Thrown at src/openhuman/search/tools/searxng.rs:196 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry; intermittent bad responses are common with self-hosted instances.","Confirm the SearXNG instance serves JSON (format=json enabled and not bot-blocked).","Inspect the raw body in logs and update the response model if the instance's schema differs."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}