sipeed/picoclaw · error

no SearXNG URL provided

Error message

no SearXNG URL provided

What it means

SearXNGSearchProvider.Search requires a baseURL: it builds "<baseURL>/search?q=...&format=json&categories=general" against your SearXNG instance. Unlike the other providers it needs no API key, but a missing URL means there is no instance to query, so it fails before creating the HTTP request.

Source

Thrown at pkg/tools/integration/web.go:1207

	}

	return "", fmt.Errorf("all api keys failed, last error: %w", lastErr)
}

type SearXNGSearchProvider struct {
	baseURL string
	proxy   string
	client  *http.Client
}

func (p *SearXNGSearchProvider) Search(
	ctx context.Context,
	query string,
	count int,
	rangeCode string,
) (string, error) {
	if p.baseURL == "" {
		return "", errors.New("no SearXNG URL provided")
	}

	searchURL := fmt.Sprintf("%s/search?q=%s&format=json&categories=general",
		strings.TrimSuffix(p.baseURL, "/"),
		url.QueryEscape(query))
	if timeRange := mapSearXNGTimeRange(rangeCode); timeRange != "" {
		searchURL += "&time_range=" + url.QueryEscape(timeRange)
	}

	req, err := http.NewRequestWithContext(ctx, "GET", searchURL, nil)
	if err != nil {
		return "", fmt.Errorf("failed to create request: %w", err)
	}

	client := p.client
	if client == nil {
		client = &http.Client{Timeout: searchTimeout}
	}

View on GitHub (pinned to 49183d7e8d)

Solutions

  1. Set the SearXNG instance URL in the web-search provider config (baseURL, trailing slash is trimmed automatically) and restart
  2. Verify the URL is reachable from the gateway (container DNS, port) once set
  3. If you meant to use a hosted provider, configure its API key instead

Example fix

# before
provider: searxng   # no url

# after
provider: searxng
searxng_url: http://searxng:8080
Defensive patterns

Strategy: validation

Validate before calling

searxngURL := strings.TrimSpace(cfg.SearXNGURL)
if searxngURL == "" {
    return errors.New("searxng selected but no instance URL configured")
}
p := &integration.SearXNGSearchProvider{BaseURL: searxngURL}

Try / catch

result, err := provider.Search(ctx, q, n, rangeCode)
if err != nil {
    if err.Error() == "no SearXNG URL provided" {
        // configure the instance URL; not retryable
    }
    return err
}

Prevention

When it happens

Trigger: Calling Search on a SearXNGSearchProvider constructed with baseURL == "" — searxng selected as provider but the instance URL was never configured.

Common situations: SearXNG chosen to avoid API keys but the self-hosted instance URL (e.g. http://searxng:8080) omitted from config; URL stored in an env var that is unset in the service unit; provider enabled by default without the URL.

Related errors


AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15). Data as JSON: /api/errors/decfc4de2289e876. Report an issue: GitHub.