{"record":{"id":"08bf6b306dd287bd","repo":"RocketChat/Rocket.Chat","slug":"ai-search-status-unavailable","errorCode":null,"errorMessage":"AI search status unavailable","messagePattern":"AI search status unavailable","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"apps/meteor/server/api/v1/ai-search.ts","lineNumber":258,"sourceCode":"\t\tresponse: {\n\t\t\t200: aiSearchResponseSchema,\n\t\t\t400: validateBadRequestErrorResponse,\n\t\t\t401: validateUnauthorizedErrorResponse,\n\t\t},\n\t},\n\tasync function action() {\n\t\tconst query = this.queryParams.query.trim();\n\t\tconst requestedIntelligentCount = this.queryParams.intelligentCount ?? AI_SEARCH_PAGE_SIZE;\n\t\tconst intelligentLimit = Math.min(Math.max(Math.floor(requestedIntelligentCount), 1), MAX_INTELLIGENT_SEARCH_RESULTS);\n\t\tconst rid = this.queryParams.rid || undefined;\n\t\tconst rids = parseCommaList(this.queryParams.rids);\n\t\tconst roomNames = parseCommaList(this.queryParams.roomNames);\n\t\tconst fromUsername = this.queryParams.fromUsername || undefined;\n\t\tconst fromUsernames = parseCommaList(this.queryParams.fromUsernames);\n\t\tconst startDate = parseQueryDate(this.queryParams.startDate);\n\t\tconst endDate = parseQueryDate(this.queryParams.endDate);\n\t\tconst aiSearchStatus = await AISearch.status().catch((error) => {\n\t\t\tthis.logger.warn({ msg: 'AI search status unavailable', err: error });\n\n\t\t\treturn {\n\t\t\t\thasIntelligentSearchLicense: false,\n\t\t\t\tintelligentSearchEnabled: false,\n\t\t\t\tintelligentSearchConfigured: false,\n\t\t\t\tanswerGenerationConfigured: false,\n\t\t\t};\n\t\t});\n\t\tlet intelligentResults: AISearchResult[] = [];\n\t\tif (\n\t\t\taiSearchStatus.hasIntelligentSearchLicense &&\n\t\t\taiSearchStatus.intelligentSearchEnabled &&\n\t\t\taiSearchStatus.intelligentSearchConfigured\n\t\t) {\n\t\t\ttry {\n\t\t\t\tintelligentResults = await AISearch.search({\n\t\t\t\t\tquery,\n\t\t\t\t\tuserId: this.userId,","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/api/v1/ai-search.ts#L240-L276","documentation":"The ai-search REST endpoint calls AISearch.status() (license module check + AI_Intelligent_Search_* settings + pipeline/provider config) before deciding whether to run intelligent search. When that status call itself rejects, the handler logs this warning and substitutes a status object with every intelligent-search flag false: the request still succeeds but is served as plain, non-intelligent search with an empty/degraded intelligent section.","triggerScenarios":"License.hasModule(AI_LICENSE_MODULE) rejecting because the licensing service/bridge is unavailable; the settings service throwing while reading AI_Intelligent_Search_Enabled or provider settings; transient internal errors while composing pipeline configuration during startup or license reload.","commonSituations":"Hitting the search endpoint while the license is being renewed or the licensing backend is unreachable; workspaces where AI settings are half-configured; calls racing server startup before services initialize.","solutions":["Inspect the err object in the log entry to see which subsystem (license vs settings) rejected","Verify the workspace license is active and includes the AI/intelligent-search module","Verify AI search settings are complete and the search backend is reachable from the app server","Retry the request once startup/license state settles — the endpoint degrades gracefully, it does not return an error status"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// client-side: check status before relying on intelligent results\nconst res = await fetch('/api/v1/ai-search.search?...');\nconst { intelligent, meta } = (await res.json()).data;\nif (!meta.intelligentSearchEnabled || intelligent.length === 0) {\n\t// degraded mode: fall back to ranking of the normal results\n}","typeGuard":null,"tryCatchPattern":"const aiSearchStatus = await AISearch.status().catch((error) => {\n\tlogger.warn({ msg: 'AI search status unavailable', err: error });\n\treturn { hasIntelligentSearchLicense: false, intelligentSearchEnabled: false, intelligentSearchConfigured: false, answerGenerationConfigured: false };\n});","preventionTips":["Keep the license active and AI settings fully configured before enabling AI features for users","Monitor the server log for this warn to detect license-backend outages early","Design clients to treat meta.intelligentSearchEnabled=false or empty intelligent arrays as a normal degraded state"],"tags":["search","ai","license","graceful-degradation","rest-api"],"backgroundTag":"search-service-unavailable","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}