{"record":{"id":"decfc4de2289e876","repo":"sipeed/picoclaw","slug":"no-searxng-url-provided","errorCode":null,"errorMessage":"no SearXNG URL provided","messagePattern":"no SearXNG URL provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/tools/integration/web.go","lineNumber":1207,"sourceCode":"\t}\n\n\treturn \"\", fmt.Errorf(\"all api keys failed, last error: %w\", lastErr)\n}\n\ntype SearXNGSearchProvider struct {\n\tbaseURL string\n\tproxy   string\n\tclient  *http.Client\n}\n\nfunc (p *SearXNGSearchProvider) Search(\n\tctx context.Context,\n\tquery string,\n\tcount int,\n\trangeCode string,\n) (string, error) {\n\tif p.baseURL == \"\" {\n\t\treturn \"\", errors.New(\"no SearXNG URL provided\")\n\t}\n\n\tsearchURL := fmt.Sprintf(\"%s/search?q=%s&format=json&categories=general\",\n\t\tstrings.TrimSuffix(p.baseURL, \"/\"),\n\t\turl.QueryEscape(query))\n\tif timeRange := mapSearXNGTimeRange(rangeCode); timeRange != \"\" {\n\t\tsearchURL += \"&time_range=\" + url.QueryEscape(timeRange)\n\t}\n\n\treq, err := http.NewRequestWithContext(ctx, \"GET\", searchURL, nil)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to create request: %w\", err)\n\t}\n\n\tclient := p.client\n\tif client == nil {\n\t\tclient = &http.Client{Timeout: searchTimeout}\n\t}","sourceCodeStart":1189,"sourceCodeEnd":1225,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/tools/integration/web.go#L1189-L1225","documentation":"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.","triggerScenarios":"Calling Search on a SearXNGSearchProvider constructed with baseURL == \"\" — searxng selected as provider but the instance URL was never configured.","commonSituations":"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.","solutions":["Set the SearXNG instance URL in the web-search provider config (baseURL, trailing slash is trimmed automatically) and restart","Verify the URL is reachable from the gateway (container DNS, port) once set","If you meant to use a hosted provider, configure its API key instead"],"exampleFix":"# before\nprovider: searxng   # no url\n\n# after\nprovider: searxng\nsearxng_url: http://searxng:8080","handlingStrategy":"validation","validationCode":"searxngURL := strings.TrimSpace(cfg.SearXNGURL)\nif searxngURL == \"\" {\n    return errors.New(\"searxng selected but no instance URL configured\")\n}\np := &integration.SearXNGSearchProvider{BaseURL: searxngURL}","typeGuard":null,"tryCatchPattern":"result, err := provider.Search(ctx, q, n, rangeCode)\nif err != nil {\n    if err.Error() == \"no SearXNG URL provided\" {\n        // configure the instance URL; not retryable\n    }\n    return err\n}","preventionTips":["Set the SearXNG instance URL (e.g. http://searxng:8080) whenever the provider is enabled","Health-check the instance from the gateway network after config load","Remember SearXNG needs no key — the URL is its only requirement"],"tags":["web-search","searxng","configuration","self-hosted"],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}