{"record":{"id":"b59dc8fdc7913eaa","repo":"Budibase/budibase","slug":"parallel-error-response-status-response-stat","errorCode":null,"errorMessage":"Parallel error: ${response.status} ${response.statusText}","messagePattern":"Parallel error: (.+?) (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/server/src/ai/tools/search/parallel.ts","lineNumber":50,"sourceCode":"    inputSchema: parallelSearchParams,\n    execute: async args => {\n      const response = await fetch(\"https://api.parallel.ai/v1beta/search\", {\n        method: \"POST\",\n        headers: {\n          \"x-api-key\": apiKey,\n          \"parallel-beta\": \"search-extract-2025-10-10\",\n          \"Content-Type\": \"application/json\",\n        },\n        body: JSON.stringify({\n          objective: args.objective,\n          search_queries: args.search_queries,\n          max_results: args.max_results,\n          excerpts: { max_chars_per_result: 2000 },\n        }),\n      })\n\n      if (!response.ok) {\n        throw new Error(\n          `Parallel error: ${response.status} ${response.statusText}`\n        )\n      }\n      return response.json()\n    },\n  }),\n})\n","sourceCodeStart":32,"sourceCodeEnd":58,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/ai/tools/search/parallel.ts#L32-L58","documentation":"createParallelTool's fetch wrapper throws this when the Parallel search API responds with a non-OK HTTP status, including status and statusText. It signals upstream Parallel API failures as tool errors.","triggerScenarios":"Parallel API returns 4xx/5xx — authentication failure (401/403), invalid request object (400), quota/rate limits (429), or 5xx server errors.","commonSituations":"Missing/invalid PARALLEL_API_KEY; malformed search objective/params; plan tier limits exceeded; Parallel service outage.","solutions":["Verify the Parallel API key is set and valid","Check request payload against the Parallel API schema","Add retry with backoff for 429/5xx","Inspect Parallel response body/logs for the precise error"],"exampleFix":"// before\nthrow new Error(`Parallel error: 401 Unauthorized`)\n// after\n// configure valid credentials before invoking\nheaders: { Authorization: `Bearer ${process.env.PARALLEL_API_KEY}` }","handlingStrategy":"retry","validationCode":"if (!process.env.PARALLEL_API_KEY) throw new Error(\"PARALLEL_API_KEY not configured\")","typeGuard":null,"tryCatchPattern":"try { await parallelTool.run(args) } catch (e) { if (e.message.startsWith(\"Parallel error:\")) { const status = parseInt(e.message); if (status === 429 || status >= 500) await retryWithBackoff(); else surfaceToAgent(e) } }","preventionTips":["Validate PARALLEL_API_KEY at startup","Validate request payloads against the Parallel schema","Add exponential backoff for transient statuses"],"tags":["http","api","network","parallel"],"backgroundTag":"upstream-api-http-error","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}