tinyhumansai/openhuman · error

Failed to parse SearXNG response: {err}

Error message

Failed to parse SearXNG response: {err}

What it means

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.

Source

Thrown at src/openhuman/search/tools/searxng.rs:196

            .timeout(Duration::from_secs(self.timeout_secs))
            .send()
            .await
            .map_err(|err| {
                tracing::warn!(error = %err, "[searxng] request failed");
                anyhow::anyhow!("SearXNG request failed: {err}")
            })?;

        let status = response.status();
        if !status.is_success() {
            let body = response.text().await.unwrap_or_default();
            let detail = utf8_safe_prefix_at_byte_boundary(&body, 500);
            tracing::warn!(status = %status, "[searxng] non-2xx response: {detail}");
            anyhow::bail!("SearXNG returned {status}: {detail}");
        }

        let raw: RawSearxngResponse = response.json().await.map_err(|err| {
            tracing::warn!(error = %err, "[searxng] failed to parse JSON response");
            anyhow::anyhow!("Failed to parse SearXNG response: {err}")
        })?;

        let results = normalize_results(raw, max_results);
        tracing::debug!(result_count = results.len(), "[searxng] search complete");

        Ok(SearxngSearchResponse {
            query: query.to_string(),
            results,
        })
    }

    fn search_endpoint_url(&self) -> anyhow::Result<reqwest::Url> {
        let base = self.base_url.trim().trim_end_matches('/');
        if base.is_empty() {
            anyhow::bail!("SearXNG base_url cannot be empty");
        }
        let endpoint = if base.ends_with("/search") {
            base.to_string()

View on GitHub (pinned to 7491200858)

Solutions

  1. Retry; intermittent bad responses are common with self-hosted instances.
  2. Confirm the SearXNG instance serves JSON (format=json enabled and not bot-blocked).
  3. Inspect the raw body in logs and update the response model if the instance's schema differs.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/openhuman/search/tools/searxng.rs:196 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/7e6c8c7e311fc9de. Report an issue: GitHub.