RocketChat/Rocket.Chat · error · FederationMatrixInvalidConfigurationError

Federation configuration is invalid,unable to change room ow

Error message

Federation configuration is invalid,unable to change room owners

What it means

When the room IS federated but the Federation_Service_Enabled setting is off, addRoomModerator throws FederationMatrixInvalidConfigurationError with the message 'Federation configuration is invalid, unable to change room owners'. This is a plain Error subclass (name 'FederationMatrixInvalidConfiguration'), not a Meteor.Error, so over DDP it surfaces as a generic method failure rather than a coded error. It means the workspace retains federated rooms while the Matrix-based federation service is disabled or never configured.

Source

Thrown at apps/meteor/server/meteor-methods/rooms/addRoomModerator.ts:44

	check(userId, String);

	const room = await Rooms.findOneById(rid, { projection: { t: 1, federated: 1, federation: 1 } });
	if (!room) {
		throw new Meteor.Error('error-invalid-room', 'Invalid room', {
			method: 'addRoomModerator',
		});
	}

	const isFederated = isRoomFederated(room);

	if (!(await hasPermissionAsync(fromUserId, 'set-moderator', rid)) && !isFederated) {
		throw new Meteor.Error('error-not-allowed', 'Not allowed', {
			method: 'addRoomModerator',
		});
	}

	if (isFederated && !isFederationEnabled()) {
		throw new FederationMatrixInvalidConfigurationError('unable to change room owners');
	}

	const user = await Users.findOneById(userId);

	if (!user?.username) {
		throw new Meteor.Error('error-invalid-user', 'Invalid user', {
			method: 'addRoomModerator',
		});
	}

	const subscription = await Subscriptions.findOneByRoomIdAndUserId(rid, user._id);

	if (!subscription) {
		throw new Meteor.Error('error-user-not-in-room', 'User is not in this room', {
			method: 'addRoomModerator',
		});
	}

View on GitHub (pinned to b2c16d5842)

Solutions

  1. If federation is intended, enable Federation_Service_Enabled and complete the Matrix bridge configuration.
  2. If federation is permanently off, convert or remove the leftover federated rooms before managing their roles.
  3. Check the room's federated/federation flags (rooms.info) when this error appears unexpectedly.
Defensive patterns

Strategy: validation

Validate before calling

// preflight: only attempt role changes on federated rooms when federation is on
const info = await fetch('/api/v1/settings/Federation_Service_Enabled', { headers }).then((r) => r.json());
if (roomIsFederated && info.value !== true) {
	throw new Error('Federation disabled but room is federated - fix configuration first');
}

Try / catch

try {
	await Meteor.callAsync('addRoomModerator', rid, userId);
} catch (e: any) {
	if (e?.message?.includes('Federation configuration is invalid')) {
		// config-level failure: enable federation or unfederate the room; do not retry
	}
}

Prevention

When it happens

Trigger: Calling addRoomModerator on a room flagged federated/federation while settings.get('Federation_Service_Enabled') is false - e.g. federation was enabled, rooms were federated, then the service was switched off.

Common situations: Federation toggled off after pilot use; deployments where federation was never fully set up but federated rooms exist from an import/migration; version upgrades changing federation defaults.

Related errors


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