RocketChat/Rocket.Chat · warning · Error

Search provider not found

Error message

Search provider not found

What it means

Thrown inside a React Query queryFn when the 'rocketchatSearch.getProvider' method returns undefined. This method queries the server for the configured message search provider (e.g., the default provider, ElasticSearch, or a third-party search app). If no search provider is configured server-side, the method returns undefined, and the queryFn throws to surface the absence.

Source

Thrown at apps/meteor/client/views/room/contextualBar/MessageSearchTab/hooks/useMessageSearchProviderQuery.ts:12

import { useMethod } from '@rocket.chat/ui-contexts';
import { useQuery } from '@tanstack/react-query';

export const useMessageSearchProviderQuery = () => {
	const getSearchProvider = useMethod('rocketchatSearch.getProvider');
	return useQuery({
		queryKey: ['search', 'provider'] as const,

		queryFn: async () => {
			const provider = await getSearchProvider();
			if (provider === undefined) {
				throw new Error('Search provider not found');
			}

			return provider;
		},
	});
};

View on GitHub (pinned to f9d3ec372b)

Solutions

  1. Configure a search provider in Rocket.Chat server settings (Admin > Settings > Search).
  2. Install and enable a search provider app if using the marketplace-based search.
  3. Guard the UI: only show the message search tab when the query succeeds (not when it errors).
  4. Catch the error in the component and show a 'Search not configured' message instead of the search UI.

Example fix

// before
const { data } = useMessageSearchProviderQuery();
// after: handle missing provider
const { data, isError } = useMessageSearchProviderQuery();
if (isError || !data) {
  return <Message>Search is not configured. Contact your administrator.</Message>;
}
Defensive patterns

Strategy: validation

Validate before calling

const provider = await getSearchProvider();
if (provider === undefined) {
  // no search provider configured, do not show search UI
  return;
}

Type guard

const hasSearchProvider = async (): Promise<boolean> => {
  const provider = await getSearchProvider();
  return provider !== undefined;
};

Try / catch

const { data, isError } = useMessageSearchProviderQuery();
if (isError) {
  // show 'search not configured' instead of search UI
  return <SearchNotConfigured />;
}

Prevention

When it happens

Trigger: No search provider is configured in Rocket.Chat server settings. The search provider setting exists but the provider app/plugin is not installed or enabled. The server method returns undefined due to a configuration gap. The search provider was recently uninstalled.

Common situations: Fresh Rocket.Chat installation without search configured. Search app (e.g., ElasticSearch integration) was uninstalled or disabled. Server setting 'Search_Provider' is empty or misconfigured. The message search tab is shown but no backend search is available.

Related errors


AI-assisted analysis of RocketChat/Rocket.Chat@f9d3ec372b (2026-08-12). Data as JSON: /api/errors/2c57cc5761c51ca6. Report an issue: GitHub.