{"record":{"id":"5254ac90c9788852","repo":"RocketChat/Rocket.Chat","slug":"slackbridge-disabled","errorCode":"SlackBridge_disabled","errorMessage":"SlackBridge_disabled","messagePattern":"SlackBridge_disabled","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/bridges/slack/removeChannelLinks.ts","lineNumber":31,"sourceCode":"}\n\nMeteor.methods<ServerMethods>({\n\tasync removeSlackBridgeChannelLinks() {\n\t\tconst user = await Meteor.userAsync();\n\t\tif (!user) {\n\t\t\tthrow new Meteor.Error('error-invalid-user', 'Invalid user', {\n\t\t\t\tmethod: 'removeSlackBridgeChannelLinks',\n\t\t\t});\n\t\t}\n\n\t\tif (!(await hasPermissionAsync(user, 'remove-slackbridge-links'))) {\n\t\t\tthrow new Meteor.Error('error-not-authorized', 'Not authorized', {\n\t\t\t\tmethod: 'removeSlackBridgeChannelLinks',\n\t\t\t});\n\t\t}\n\n\t\tif (settings.get('SlackBridge_Enabled') !== true) {\n\t\t\tthrow new Meteor.Error('SlackBridge_disabled');\n\t\t}\n\n\t\tawait Rooms.unsetAllImportIds();\n\n\t\treturn {\n\t\t\tmessage: 'Slackbridge_channel_links_removed_successfully',\n\t\t\tparams: [],\n\t\t};\n\t},\n});\n","sourceCodeStart":13,"sourceCodeEnd":42,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/server/bridges/slack/removeChannelLinks.ts#L13-L42","documentation":"Thrown by removeSlackBridgeChannelLinks when the caller passes the user and permission checks but settings.get('SlackBridge_Enabled') is not exactly true. The SlackBridge feature is disabled at the instance level, so removing its channel links is refused to avoid inconsistent state.","triggerScenarios":"An authorized admin calls removeSlackBridgeChannelLinks while SlackBridge_Enabled is false (feature off, never configured, or disabled).","commonSituations":"SlackBridge was disabled after a migration but leftover admin UI still exposes the link-removal action. New instance where SlackBridge was never enabled.","solutions":["If link removal is genuinely needed, temporarily enable SlackBridge_Enabled, run the removal, then disable it again - or perform the cleanup directly via the Rooms.unsetAllImportIds in a maintenance script.","If SlackBridge is off permanently, suppress the removal UI; there is nothing to link.","Confirm with the admin whether importIds should be cleared at all when the bridge is inactive."],"exampleFix":"// before\nMeteor.call('removeSlackBridgeChannelLinks') // SlackBridge_Enabled = false\n\n// after - enable then remove (or skip)\nawait Settings.set('SlackBridge_Enabled', true)\nMeteor.call('removeSlackBridgeChannelLinks')","handlingStrategy":"validation","validationCode":"const enabled = settings.get('SlackBridge_Enabled');\nif (enabled !== true) throw new ClientError('config','SlackBridge_Enabled is off; nothing to remove');","typeGuard":"function isSlackBridgeEnabled(v) { return v === true; }","tryCatchPattern":"try { Meteor.call('removeSlackBridgeChannelLinks'); }\ncatch (e) {\n  if (e?.error === 'SlackBridge_disabled') { surface('Enable SlackBridge before removing links'); return; }\n  throw e;\n}","preventionTips":["Hide the link-removal control when SlackBridge_Enabled is false.","Enable SlackBridge before performing maintenance on its links.","Communicate feature-disabled state to admins in the UI."],"tags":["meteor","methods","slack","bridge","settings","configuration"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}