{"record":{"id":"4f60cd9441696fb0","repo":"RocketChat/Rocket.Chat","slug":"provider-currently-not-active","errorCode":null,"errorMessage":"Provider currently not active","messagePattern":"Provider currently not active","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"apps/meteor/server/meteor-methods/platform/search.ts","lineNumber":53,"sourceCode":"\t\t\ticon: provider.iconName,\n\t\t\tresultTemplate: provider.resultTemplate,\n\t\t\tsupportsSuggestions: provider.supportsSuggestions,\n\t\t\tsuggestionItemTemplate: provider.suggestionItemTemplate,\n\t\t\tsettings: Object.fromEntries(Object.values(provider.settingsAsMap).map((setting) => [setting.key, setting.value] as const)),\n\t\t};\n\t},\n\t/**\n\t * Search using the current search provider and check if results are valid for the user. The search result has\n\t * the format `{messages:{start:0,numFound:1,docs:[{...}]},users:{...},rooms:{...}}`\n\t * @param text the search text\n\t * @param context the context (uid, rid)\n\t * @param payload custom payload (e.g. for paging)\n\t */\n\tasync 'rocketchatSearch.search'(text, context, payload) {\n\t\tpayload = payload !== null ? payload : undefined; // TODO is this cleanup necessary?\n\n\t\tif (!searchProviderService.activeProvider) {\n\t\t\tthrow new Error('Provider currently not active');\n\t\t}\n\n\t\tSearchLogger.debug({ msg: 'search', text, context, payload });\n\n\t\tconst userId = Meteor.userId();\n\t\tif (!userId) {\n\t\t\tthrow new Error('User not logged in');\n\t\t}\n\n\t\treturn new Promise<IRawSearchResult>((resolve, reject) => {\n\t\t\tvoid searchProviderService.activeProvider?.search(userId, text, context, payload, (error, data) => {\n\t\t\t\tif (error) {\n\t\t\t\t\treturn reject(error);\n\t\t\t\t}\n\n\t\t\t\treturn resolve(data);\n\t\t\t});\n\t\t}).then((result) => validationService.validateSearchResult(result));","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/meteor-methods/platform/search.ts#L35-L71","documentation":"`rocketchatSearch.search` throws a plain `Error('Provider currently not active')` when `searchProviderService.activeProvider` is null — no search provider (default or Solr) is registered/active on the server. The provider service activates a provider during startup/settings load; if none activated, every search call fails with this error before any search runs.","triggerScenarios":"`Meteor.call('rocketchatSearch.search', text, context, payload)` on a server where search was never configured, the chosen provider failed to initialize (e.g. Solr unreachable), or settings were changed without the service re-initializing.","commonSituations":"Fresh installation without completing search setup; Solr selected but host/port/credentials wrong so activation failed; feature regressions after upgrades where the provider never started.","solutions":["Set/verify a search provider in Administration -> Search (the default provider needs no external service)","For Solr: fix connection details and re-save settings so the provider activates, then test connectivity","Restart the server if the provider failed during startup","On the client, disable the search UI when no provider is active instead of letting calls fail"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// expose search only when a provider is configured\nconst searchConfigured = () => Boolean(settings.get('Search_Provider'));\nif (!searchConfigured()) {\n  disableSearchUI();\n}","typeGuard":null,"tryCatchPattern":"try {\n  const results = await Meteor.callAsync('rocketchatSearch.search', text, context, payload);\n} catch (e) {\n  if (e instanceof Error && e.message === 'Provider currently not active') {\n    // no provider: degrade to no-search UX instead of surfacing the error\n  }\n}","preventionTips":["Complete search provider setup before exposing search UI","Monitor Solr availability — a provider that fails activation leaves activeProvider null","Re-verify search settings after upgrades and restarts"],"tags":["search","configuration","solr","meteor-method"],"backgroundTag":"search-provider-not-configured","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"}