{"record":{"id":"693d258c58de7a33","repo":"Mintplex-Labs/anything-llm","slug":"res-status-res-statustext-params-json-693d25","errorCode":null,"errorMessage":"${res.status} - ${res.statusText}. params: ${JSON.stringify({ url: searchURL.toString() })}","messagePattern":"(.+?) - (.+?)\\. params: (.+?)\\)\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/agents/aibitat/plugins/web-browsing.js","lineNumber":847,"sourceCode":"              return `Search is disabled and no content was found. This functionality is disabled because the user has not set it up yet.`;\n            }\n\n            this.super.introspect(\n              `${this.caller}: Using SearXNG to search for \"${\n                query.length > 100 ? `${query.slice(0, 100)}...` : query\n              }\"`\n            );\n\n            const { response, error } = await fetch(searchURL.toString(), {\n              method: \"GET\",\n              headers: {\n                \"Content-Type\": \"application/json\",\n                \"User-Agent\": \"anything-llm\",\n              },\n            })\n              .then((res) => {\n                if (res.ok) return res.json();\n                throw new Error(\n                  `${res.status} - ${res.statusText}. params: ${JSON.stringify({ url: searchURL.toString() })}`\n                );\n              })\n              .then((data) => {\n                return { response: data, error: null };\n              })\n              .catch((e) => {\n                this.super.handlerProps.log(\n                  `SearXNG Search Error: ${e.message}`\n                );\n                return { response: null, error: e.message };\n              });\n            if (error)\n              return `There was an error searching for content. ${error}`;\n\n            const data = [];\n            response.results?.forEach((searchResult) => {\n              const { url, title, content, publishedDate } = searchResult;","sourceCodeStart":829,"sourceCodeEnd":865,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/agents/aibitat/plugins/web-browsing.js#L829-L865","documentation":"Thrown by the SearXNG provider when fetch() to a self-hosted SearXNG instance returns a non-OK status. SearXNG is a self-hosted meta-search engine with no API key — the error includes the full search URL instead of auth info. The .catch logs 'SearXNG Search Error' and returns a failure string.","triggerScenarios":"The SearXNG instance URL is unreachable, returns 4xx/5xx, or is misconfigured. Common causes: the instance is down, the format=json parameter is not supported (SearXNG requires enabling JSON output in settings.yml), the URL is wrong, or network egress from the server to the instance is blocked.","commonSituations":"SearXNG settings.yml does not have 'search.formats: [html, json]' enabled (JSON output is off by default); the instance URL configured in AnythingLLM is wrong or includes a trailing path; the SearXNG instance is behind a firewall the server cannot reach; CORS or reverse proxy returning an error page.","solutions":["Verify the SearXNG instance is running and accessible from the server: curl '<searchURL>'.","In SearXNG's settings.yml, ensure JSON output is enabled: search: formats: [html, json].","Confirm the configured URL is correct and includes the /search endpoint if needed.","If behind a reverse proxy, check that it forwards requests correctly and returns the JSON response."],"exampleFix":"// before\nconst { response, error } = await fetch(searchURL.toString(), { method: \"GET\", headers: {...} })\n  .then((res) => { if (res.ok) return res.json(); throw new Error(`${res.status} - ${res.statusText}...`); })\n\n// caller-side fix — pre-flight connectivity check\ntry {\n  const healthRes = await fetch(searxngBaseUrl, { method: \"HEAD\" });\n  if (!healthRes.ok) return `SearXNG instance at ${searxngBaseUrl} is not responding correctly.`;\n} catch {\n  return `Cannot reach SearXNG instance at ${searxngBaseUrl}. Verify the URL and network.`;\n}","handlingStrategy":"validation","validationCode":"// SearXNG requires JSON output enabled in settings.yml\n// Pre-flight: verify the instance is reachable and returns JSON\nconst healthRes = await fetch(`${searxngBaseUrl}/search?q=test&format=json`, { method: \"GET\" });\nif (!healthRes.ok) {\n  throw new Error(`SearXNG instance unreachable or JSON output disabled. Status: ${healthRes.status}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  const results = await searxngSearch(query);\n  return results;\n} catch (e) {\n  if (e.message.includes(\"404\") || e.message.includes(\"400\")) {\n    return \"SearXNG error — verify JSON output is enabled in settings.yml (search: formats: [html, json]).\";\n  }\n  if (e.message.includes(\"502\") || e.message.includes(\"503\")) {\n    return \"SearXNG instance is down. Check the self-hosted service.\";\n  }\n  throw e;\n}","preventionTips":["Enable JSON output in SearXNG settings.yml: search: formats: [html, json].","Verify the configured SearXNG URL is correct and the instance is running.","Ensure network connectivity from the server to the SearXNG instance.","Test the instance manually with ?format=json before relying on the agent."],"tags":["searxng","web-search","http","self-hosted","configuration","agent-tool"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}