tinyhumansai/openhuman · error

SearXNG base_url cannot be empty

Error message

SearXNG base_url cannot be empty

What it means

search_endpoint_url found the configured base_url empty — the SearXNG client was constructed without an instance URL, so no search URL can be formed. Configuration omission, not an instance failure.

Source

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

        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()
        } else {
            format!("{base}/search")
        };
        reqwest::Url::parse(&endpoint)
            .with_context(|| format!("invalid SearXNG base_url `{}`", self.base_url))
    }

    fn render_markdown(response: &SearxngSearchResponse) -> String {
        if response.results.is_empty() {
            return format!("No SearXNG results for `{}`.", response.query);
        }

        let mut out = format!("# SearXNG results for `{}`\n", response.query);
        for (index, result) in response.results.iter().enumerate() {
            out.push_str(&format!(

View on GitHub (pinned to 7491200858)

Solutions

  1. Set the SearXNG instance base_url in the search-engine settings
  2. Choose a different default search engine if no instance is configured
Defensive patterns

Strategy: validation

When it happens

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

Common situations: See trigger scenarios.


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