RocketChat/Rocket.Chat · error · Error

Federation is not enabled

Error message

Federation is not enabled

What it means

Thrown by throwIfFederationNotEnabled() (apps/meteor/server/services/federation/utils.ts) when the Federation_Service_Enabled setting is false. It is the standard guard at the entry of federation operations, so any federation call on a workspace with federation off aborts immediately with this plain Error.

Source

Thrown at apps/meteor/server/services/federation/utils.ts:9

import { settings } from '../../settings';

export function isFederationEnabled(): boolean {
	return settings.get<boolean>('Federation_Service_Enabled');
}

export function throwIfFederationNotEnabled(): void {
	if (!isFederationEnabled()) {
		throw new Error('Federation is not enabled');
	}
}

export class FederationMatrixInvalidConfigurationError extends Error {
	constructor(cause?: string) {
		// eslint-disable-next-line prefer-template
		const message = 'Federation configuration is invalid' + (cause ? ',' + cause[0].toLowerCase() + cause.slice(1) : '');

		super(message);

		this.name = 'FederationMatrixInvalidConfiguration';
	}
}

View on GitHub (pinned to b2c16d5842)

Solutions

  1. Enable Administration > Federation > Federation_Service_Enabled
  2. Guard call sites with isFederationEnabled() before invoking federation APIs
  3. Skip federation flows on workspaces that do not use federation

Example fix

// before
throwIfFederationNotEnabled();
doFederationWork();

// after
if (!isFederationEnabled()) return;
doFederationWork();
Defensive patterns

Strategy: validation

Validate before calling

import { isFederationEnabled } from './utils';
if (!isFederationEnabled()) {
  throw new Error('federation is disabled on this workspace');
}
doFederationWork();

Type guard

function federationReady(enabled: boolean, loaded: boolean): boolean {
  return loaded && enabled;
}

Try / catch

try { await federationOperation(); } catch (e) { if (e.message === 'Federation is not enabled') { /* skip federation path, run local-only flow */ } }

Prevention

When it happens

Trigger: Invoking federation methods/services (e.g. federation search, invite, DNS operations) while Federation_Service_Enabled is false; calling federation utilities at startup before settings load; disabling federation while clients still issue federation requests.

Common situations: Testing federation code on workspaces where the feature was never enabled; toggling the setting off during operation; environments where the settings collection has no Federation_Service_Enabled value yet.

Related errors


AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18). Data as JSON: /api/errors/67bdb769b3c2f4e3. Report an issue: GitHub.