{"record":{"id":"ff5c2d572613d674","repo":"FlowiseAI/Flowise","slug":"search-request-failed-searchresponse-warning","errorCode":null,"errorMessage":"Search request failed: ${searchResponse.warning || 'Unknown error'}","messagePattern":"Search request failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/components/nodes/documentloaders/FireCrawl/FireCrawl.ts","lineNumber":449,"sourceCode":"        // Add optional parameters if they exist and are not empty\n        const validSearchParams = ['limit', 'tbs', 'lang', 'country', 'location', 'timeout', 'ignoreInvalidURLs'] as const\n\n        validSearchParams.forEach((param) => {\n            if (request[param] !== undefined && request[param] !== null) {\n                validParams[param] = request[param]\n            }\n        })\n\n        try {\n            const parameters = {\n                ...validParams,\n                integration: 'flowise'\n            }\n            const response: AxiosResponse = await this.postRequest(this.apiUrl + '/v1/search', parameters, headers)\n            if (response.status === 200) {\n                const searchResponse = response.data as SearchResponse\n                if (!searchResponse.success) {\n                    throw new Error(`Search request failed: ${searchResponse.warning || 'Unknown error'}`)\n                }\n                return searchResponse\n            } else {\n                this.handleError(response, 'perform search')\n            }\n        } catch (error: any) {\n            throw new Error(error.message)\n        }\n        return { success: false }\n    }\n\n    private prepareHeaders(idempotencyKey?: string): AxiosRequestHeaders {\n        return {\n            'Content-Type': 'application/json',\n            Authorization: `Bearer ${this.apiKey}`,\n            ...(idempotencyKey ? { 'x-idempotency-key': idempotencyKey } : {})\n        } as AxiosRequestHeaders & { 'x-idempotency-key'?: string }\n    }","sourceCodeStart":431,"sourceCodeEnd":467,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/documentloaders/FireCrawl/FireCrawl.ts#L431-L467","documentation":"Thrown by FirecrawlApp.search when POST /v1/search returns HTTP 200 but the body has `success: false`. FireCrawl signals partial/total search failure this way, attaching a `warning` field with the reason. The message embeds that warning or falls back to 'Unknown error'.","triggerScenarios":"Response status === 200 AND `searchResponse.success === false`. Happens when FireCrawl's search backend (Serper/Google) fails, returns no valid results, or rate-limits internally.","commonSituations":"Empty or nonsensical query string; aggressive `tbs`/`location` filters yielding zero results; Serper upstream outage; rate-limit on the search subproduct; country/lang combo unsupported.","solutions":["Read `searchResponse.warning` to get FireCrawl's stated reason and act on it.","Retry with a simpler query (no tbs/location) to isolate the cause.","Raise `limit` only after confirming the query returns results at all.","If warning mentions quota, verify the FireCrawl plan includes the search product.","Cache successful results; search is metered and flaky."],"exampleFix":"// before\nconst response = await app.search({ query: this.query, ...this.params })\n\n// after\nconst response = await app.search({ query: this.query, limit: 10, ...this.params })\nif (!response.success) {\n  throw new Error(`Search rejected by FireCrawl (${response.warning}); retry with a simpler query`)\n}","handlingStrategy":"try-catch","validationCode":"const q = (request.query || '').trim()\nif (!q) throw new Error('query must be a non-empty string')","typeGuard":"function isSearchResponse(x: unknown): x is SearchResponse {\n  return typeof x === 'object' && x !== null && typeof (x as any).success === 'boolean'\n}","tryCatchPattern":"try {\n  const r = await app.search(req)\n  if (!r.success) console.warn('search soft-failed:', r.warning)\n  return r\n} catch (e) { /* network or upstream */ throw e }","preventionTips":["Trim and non-empty-check the query.","Cache successful search results to limit metered calls.","Start with a minimal query before adding tbs/location filters."],"tags":["firecrawl","search","api-error","soft-failure"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}