{"record":{"id":"d5c26f1ba2ef7aaf","repo":"RocketChat/Rocket.Chat","slug":"error-ai-provider-not-configured-d5c26f","errorCode":null,"errorMessage":"error-ai-provider-not-configured","messagePattern":"error-ai-provider-not-configured","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/services/ai-search/service.ts","lineNumber":394,"sourceCode":"\t\t});\n\n\t\treturn this.normalizeIntelligentResults(json, userId, limit);\n\t}\n\n\tasync answer({ query, messages }: { query: string; messages: AISearchAnswerMessage[] }): Promise<AISearchAnswerResult> {\n\t\tconst hasIntelligentSearchLicense = await License.hasModule(AI_LICENSE_MODULE);\n\t\tconst intelligentSearchEnabled = settings.get<boolean>('AI_Intelligent_Search_Enabled');\n\t\tconst answerGenerationEnabled = settings.get<boolean>('AI_Intelligent_Search_Answer_Enabled');\n\t\tconst pipelineConfig = this.getPipelineConfig();\n\t\tconst provider = this.getAnswerProviderConfig();\n\t\tconst systemPromptSetting = settings.get<string>('AI_Intelligent_Search_Answer_System_Prompt');\n\n\t\tif (!hasIntelligentSearchLicense || intelligentSearchEnabled !== true || answerGenerationEnabled !== true || !pipelineConfig) {\n\t\t\tthrow new Error('error-ai-not-enabled');\n\t\t}\n\n\t\tif (!provider) {\n\t\t\tthrow new Error('error-ai-provider-not-configured');\n\t\t}\n\n\t\tconst systemPrompt = asString(systemPromptSetting);\n\n\t\tconst sanitizedMessages: SearchAnswerMessage[] = messages.map(({ text, username, roomName, ts, score }) => ({\n\t\t\ttext,\n\t\t\tusername,\n\t\t\troomName,\n\t\t\tts,\n\t\t\tscore,\n\t\t}));\n\n\t\treturn generateOpenAICompatibleSearchAnswer({\n\t\t\tquery,\n\t\t\tmessages: sanitizedMessages,\n\t\t\tprovider,\n\t\t\tsystemPrompt,\n\t\t\tfetch: fetchWithSsrfValidation,","sourceCodeStart":376,"sourceCodeEnd":412,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/2a7de457074cbb4d4373fbd9a4e5bea292c9c764/apps/meteor/server/services/ai-search/service.ts#L376-L412","documentation":"Thrown by the AI search service's answer() method when getAnswerProviderConfig() returns nothing — the LLM backend that generates answers is not configured. This check runs after the enablement checks, so the feature is licensed and on, but no provider (e.g. an OpenAI-compatible endpoint and model) is set up.","triggerScenarios":"Calling aiSearch.answer(...) with no AI provider configured in administration; provider configuration saved partially so parsing yields undefined; provider entries removed after clients already show the answer UI.","commonSituations":"Admins enable intelligent search but never fill the external provider section; rotating/clearing provider credentials; air-gapped installs where the provider was never reachable and the config was dropped.","solutions":["Configure an answer provider (OpenAI-compatible base URL, API key, model) in the AI administration panel","Verify the saved settings parse into a provider object via the same getAnswerProviderConfig logic","Hide the answer affordance in the UI when no provider is configured"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const provider = getAnswerProviderConfig();\nif (!provider) { /* hide/disable answer generation until a provider is configured */ }","typeGuard":"function hasAnswerProvider(p: { baseURL?: string; apiKey?: string; model?: string } | undefined | null): p is { baseURL: string; apiKey: string; model: string } {\n  return Boolean(p && p.baseURL && p.apiKey && p.model);\n}","tryCatchPattern":"try { await aiSearch.answer({ query, messages }); } catch (e) { if (e.message === 'error-ai-provider-not-configured') { /* surface admin setup hint */ } else throw e; }","preventionTips":["Configure the provider before enabling answer generation in admin","Validate provider settings after credential rotation"],"tags":["ai","configuration","provider","rocket-chat"],"backgroundTag":"missing-configuration","analyzedSha":"2a7de457074cbb4d4373fbd9a4e5bea292c9c764","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}