RocketChat/Rocket.Chat · error · Meteor.Error
error-ai-provider-request-failed
error-ai-provider-request-failed
Error message
error-ai-provider-request-failed
What it means
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.
Source
Thrown at apps/meteor/server/api/v1/ai-search.ts:382
try {
const answer = await AISearch.answer({
query,
messages: answerMessages,
});
return API.v1.success(answer);
} catch (error) {
const message = error instanceof Error ? error.message : '';
if (message === 'error-ai-not-enabled') {
throw new Meteor.Error('error-ai-not-enabled');
}
if (message === 'error-ai-provider-not-configured') {
throw new Meteor.Error('error-ai-provider-not-configured');
}
if (message === 'error-ai-provider-empty-response') {
throw new Meteor.Error('error-ai-provider-empty-response');
}
throw new Meteor.Error('error-ai-provider-request-failed');
}
},
);
View on GitHub (pinned to b2c16d5842)
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
Defensive patterns
Strategy: retry
Try / catch
try { /* ai.search.answer */ } catch (e) {
if (e.error === 'error-ai-provider-request-failed') {
if (e.isRateLimited) return retryWithBackoff(); // 429
throw e; // network/auth issues need server-side fixes
}
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- error-ai-not-enabled
- error-ai-provider-not-configured
- error-ai-provider-empty-response
- Failed to retrieve registration confirmation poll data: ${re
- App package download failed
AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18).
Data as JSON: /api/errors/db2a25744459b144.
Report an issue: GitHub.