{"record":{"id":"db2a25744459b144","repo":"RocketChat/Rocket.Chat","slug":"error-ai-provider-request-failed","errorCode":"error-ai-provider-request-failed","errorMessage":"error-ai-provider-request-failed","messagePattern":"error-ai-provider-request-failed","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/api/v1/ai-search.ts","lineNumber":382,"sourceCode":"\t\ttry {\n\t\t\tconst answer = await AISearch.answer({\n\t\t\t\tquery,\n\t\t\t\tmessages: answerMessages,\n\t\t\t});\n\n\t\t\treturn API.v1.success(answer);\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : '';\n\t\t\tif (message === 'error-ai-not-enabled') {\n\t\t\t\tthrow new Meteor.Error('error-ai-not-enabled');\n\t\t\t}\n\t\t\tif (message === 'error-ai-provider-not-configured') {\n\t\t\t\tthrow new Meteor.Error('error-ai-provider-not-configured');\n\t\t\t}\n\t\t\tif (message === 'error-ai-provider-empty-response') {\n\t\t\t\tthrow new Meteor.Error('error-ai-provider-empty-response');\n\t\t\t}\n\t\t\tthrow new Meteor.Error('error-ai-provider-request-failed');\n\t\t}\n\t},\n);\n","sourceCodeStart":364,"sourceCodeEnd":386,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/api/v1/ai-search.ts#L364-L386","documentation":"The catch-all failure of POST ai.search.answer: AISearch.answer() threw something other than the three recognized service errors (not-enabled, provider-not-configured, empty-response). Typically this is a network-level failure reaching the LLM provider: DNS, TLS, timeouts, HTTP 4xx/5xx from the provider, or an unexpected exception inside the AI integration.","triggerScenarios":"POST /api/v1/ai.search.answer while the workspace server cannot reach the LLM endpoint (firewall, proxy, DNS), the provider returns 401/429/500, the request exceeds the provider timeout, or the AI service throws an unexpected internal error.","commonSituations":"Egress firewall blocks the AI gateway URL; provider rate limit or quota exhausted (429); expired/invalid API key producing 401; on-prem server without internet access; provider outage; self-hosted gateway down during the request.","solutions":["Check server-side logs for the underlying exception from AISearch.answer (the original message is swallowed by the mapping)","Verify network egress from the Rocket.Chat server to the provider base URL (curl from the server host)","Confirm provider API key validity and quota/plan status","Retry with backoff: 429s and transient 5xxs are common and recoverable"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { /* ai.search.answer */ } catch (e) {\n  if (e.error === 'error-ai-provider-request-failed') {\n    if (e.isRateLimited) return retryWithBackoff(); // 429\n    throw e; // network/auth issues need server-side fixes\n  }\n}","preventionTips":["Check server egress to the AI gateway URL as part of deployment checks","Keep provider API keys valid and quota monitored","Log server-side: the original provider error is masked by this mapping"],"tags":["ai-search","network","provider-outage","rocket-chat"],"backgroundTag":"ai-provider-request-failed","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}