{"record":{"id":"67bdb769b3c2f4e3","repo":"RocketChat/Rocket.Chat","slug":"federation-is-not-enabled","errorCode":null,"errorMessage":"Federation is not enabled","messagePattern":"Federation is not enabled","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/services/federation/utils.ts","lineNumber":9,"sourceCode":"import { settings } from '../../settings';\n\nexport function isFederationEnabled(): boolean {\n\treturn settings.get<boolean>('Federation_Service_Enabled');\n}\n\nexport function throwIfFederationNotEnabled(): void {\n\tif (!isFederationEnabled()) {\n\t\tthrow new Error('Federation is not enabled');\n\t}\n}\n\nexport class FederationMatrixInvalidConfigurationError extends Error {\n\tconstructor(cause?: string) {\n\t\t// eslint-disable-next-line prefer-template\n\t\tconst message = 'Federation configuration is invalid' + (cause ? ',' + cause[0].toLowerCase() + cause.slice(1) : '');\n\n\t\tsuper(message);\n\n\t\tthis.name = 'FederationMatrixInvalidConfiguration';\n\t}\n}\n","sourceCodeStart":1,"sourceCodeEnd":23,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/services/federation/utils.ts#L1-L23","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Enable Administration > Federation > Federation_Service_Enabled","Guard call sites with isFederationEnabled() before invoking federation APIs","Skip federation flows on workspaces that do not use federation"],"exampleFix":"// before\nthrowIfFederationNotEnabled();\ndoFederationWork();\n\n// after\nif (!isFederationEnabled()) return;\ndoFederationWork();","handlingStrategy":"validation","validationCode":"import { isFederationEnabled } from './utils';\nif (!isFederationEnabled()) {\n  throw new Error('federation is disabled on this workspace');\n}\ndoFederationWork();","typeGuard":"function federationReady(enabled: boolean, loaded: boolean): boolean {\n  return loaded && enabled;\n}","tryCatchPattern":"try { await federationOperation(); } catch (e) { if (e.message === 'Federation is not enabled') { /* skip federation path, run local-only flow */ } }","preventionTips":["Guard every federation entry point with isFederationEnabled()","Wait for settings to load before first federation calls at startup"],"tags":["federation","settings","feature-flag","rocket-chat"],"backgroundTag":"feature-disabled","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}