{"record":{"id":"464a6983b802c727","repo":"FlowiseAI/Flowise","slug":"resp-statustext","errorCode":null,"errorMessage":"${resp.statusText}","messagePattern":"\\$\\{resp\\.statusText\\}","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/Searxng/Searxng.ts","lineNumber":304,"sourceCode":"        const searchParams = new URLSearchParams(nonUndefinedParams)\n        return `${baseUrl}/${path}?${searchParams}`\n    }\n\n    async _call(input: string): Promise<string> {\n        const queryParams = {\n            q: input,\n            ...this.params\n        }\n        const url = this.buildUrl('search', queryParams, this.apiBase as string)\n\n        const resp = await secureFetch(url, {\n            method: 'POST',\n            headers: this.headers,\n            signal: AbortSignal.timeout(5 * 1000) as any // node-fetch AbortSignal type predates native AbortSignal\n        })\n\n        if (!resp.ok) {\n            throw new Error(resp.statusText)\n        }\n\n        const res: SearxngResults = await resp.json()\n\n        if (!res.results.length && !res.answers.length && !res.infoboxes.length && !res.suggestions.length) {\n            return 'No good results found.'\n        } else if (res.results.length) {\n            const response: string[] = []\n\n            res.results.forEach((r) => {\n                response.push(\n                    JSON.stringify({\n                        title: r.title || '',\n                        link: r.url || '',\n                        snippet: r.content || ''\n                    })\n                )\n            })","sourceCodeStart":286,"sourceCodeEnd":322,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/Searxng/Searxng.ts#L286-L322","documentation":"Thrown by Searxng._call when the POST to the SearxNG /search endpoint returns a non-ok response. Only the raw statusText is reported (no status code), which makes diagnosis harder than the Requests tools. The request has a 5-second AbortSignal timeout, so a slow SearxNG also surfaces here as a network/timeout error path.","triggerScenarios":"SearxNG returns 4xx/5xx; SearxNG is down or unreachable; request exceeds the 5s timeout (abort); wrong apiBase path; SearxNG behind a proxy that returns an error page.","commonSituations":"Self-hosted SearxNG instance not running; apiBase points to the UI URL instead of the API base; SearxNG rate-limits or blocks the request; network latency triggers the 5s abort.","solutions":["Confirm the SearxNG instance is up: `curl -X POST <apiBase>/search -d 'q=test&format=json'`.","Ensure apiBase is the API base (often ending without /search); the tool appends the path via buildUrl.","If the instance is slow, raise capacity or reduce query load (the 5s timeout is fixed in source).","Check SearxNG logs for the rejected query (e.g. disabled engines, blocked output format)."],"exampleFix":"// before (only statusText surfaced)\nif (!resp.ok) throw new Error(resp.statusText)\n\n// after (include status code and body for diagnosis)\nif (!resp.ok) {\n  const detail = await resp.text().catch(() => '')\n  throw new Error(`SearxNG ${resp.status} ${resp.statusText}: ${detail.slice(0, 300)}`)\n}","handlingStrategy":"retry","validationCode":"async function safeSearxng(tool: any, input: string, maxRetries = 2) {\n  for (let attempt = 0; attempt <= maxRetries; attempt++) {\n    try { return await tool._call(input) }\n    catch (e) {\n      const transient = /timeout|aborted|econn|reset|5\\d\\d/i.test((e as Error).message)\n      if (!transient || attempt === maxRetries) throw e\n      await new Promise((r) => setTimeout(r, 2 ** attempt * 1000))\n    }\n  }\n}","typeGuard":"const isSearxngTimeout = (e: unknown): boolean =>\n  /timeout|aborted|AbortError/i.test(e instanceof Error ? e.message : String(e))","tryCatchPattern":"try { return await tool._call(input) }\ncatch (e) {\n  const msg = (e as Error).message\n  if (/timeout|aborted/i.test(msg)) throw new Error('SearxNG request timed out (>5s) — reduce load or check instance')\n  if (/not found|404/i.test(msg)) throw new Error('SearxNG API base path is wrong')\n  throw e\n}","preventionTips":["Health-check the SearxNG instance before running flows (`curl -X POST <apiBase>/search`).","Use the API base URL (not the UI URL) for apiBase.","Treat the 5-second timeout as a hard ceiling — keep queries light.","Monitor SearxNG engine status; some engines failing can return non-ok."],"tags":["network","searxng","http","timeout"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}