{"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/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/bridges/slack/removeChannelLinks.ts#L13-L42","documentation":"removeSlackBridgeChannelLinks throws SlackBridge_disabled (a bare code with no human message) when the SlackBridge_Enabled setting is not exactly true. The check runs after user and permission checks, so an authorized caller still cannot unlink channels while the SlackBridge integration is off. It exists to prevent mutating room importIds for a feature the workspace has disabled.","triggerScenarios":"An authenticated, permission-holding user calls removeSlackBridgeChannelLinks while SlackBridge_Enabled is false or unset in Administration → Slack Bridge.","commonSituations":"Admin disabled the bridge earlier (or it was never configured) and later tries the cleanup action; automated cleanup scripts run against workspaces where the bridge is off; setting reset during migration or restore.","solutions":["Enable SlackBridge under Admin → Slack Bridge (set SlackBridge_Enabled = true), perform the unlink, then disable it again if desired","Skip the unlink operation on workspaces where the bridge is disabled","If a script drives this, first read SlackBridge_Enabled and only call the method when true"],"exampleFix":"// before\nawait call('removeSlackBridgeChannelLinks'); // throws SlackBridge_disabled\n\n// after\nconst enabled = settings.get('SlackBridge_Enabled');\nif (enabled === true) {\n  await call('removeSlackBridgeChannelLinks');\n}","handlingStrategy":"validation","validationCode":"// via admin REST: confirm the bridge is on before offering the unlink\nconst res = await fetch('/api/v1/settings/SlackBridge_Enabled', { headers: adminHeaders });\nconst { value } = await res.json();\nif (value !== true) throw new Error('SlackBridge is disabled on this workspace');\nawait call('removeSlackBridgeChannelLinks');","typeGuard":null,"tryCatchPattern":"try {\n  await Meteor.callAsync('removeSlackBridgeChannelLinks');\n} catch (e) {\n  if (e.error === 'SlackBridge_disabled') {\n    // prompt the admin to enable SlackBridge first (Admin → Slack Bridge)\n  }\n}","preventionTips":["Check the integration toggle before exposing cleanup actions for that integration","Automation should read SlackBridge_Enabled and skip disabled workspaces","Enable → act → disable is the safe sequence for one-off maintenance"],"tags":["meteor","slackbridge","settings","feature-flag"],"backgroundTag":"integration-disabled","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}