{"record":{"id":"7edbc8e28645b2d2","repo":"RocketChat/Rocket.Chat","slug":"error-omnichannel-is-disabled","errorCode":"error-omnichannel-is-disabled","errorMessage":"error-omnichannel-is-disabled","messagePattern":"error-omnichannel-is-disabled","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/lib/omnichannel/rooms.ts","lineNumber":58,"sourceCode":"import { callbacks } from '../callbacks';\nimport {\n\tnotifyOnLivechatInquiryChangedByRoom,\n\tnotifyOnSubscriptionChangedByRoomId,\n\tnotifyOnRoomChangedById,\n\tnotifyOnLivechatInquiryChanged,\n\tnotifyOnSubscriptionChanged,\n\tnotifyOnRoomChanged,\n} from '../notifyListener';\n\nexport async function getRoom(\n\tguest: ILivechatVisitor,\n\tmessage: Pick<IMessage, 'rid' | 'msg' | 'token'>,\n\troomInfo: IOmnichannelRoomInfo,\n\tagent?: SelectedAgent,\n\textraData?: IOmnichannelRoomExtraData,\n) {\n\tif (!settings.get('Livechat_enabled')) {\n\t\tthrow new Meteor.Error('error-omnichannel-is-disabled');\n\t}\n\tlivechatLogger.debug({ msg: 'Attempting to find or create a room for visitor', visitorId: guest._id });\n\tconst room = await LivechatRooms.findOneById(message.rid);\n\n\tif (room?.v._id && (await LivechatContacts.isChannelBlocked(Visitors.makeVisitorAssociation(room.v._id, room.source)))) {\n\t\tthrow new Error('error-contact-channel-blocked');\n\t}\n\n\tif (!room?.open) {\n\t\tlivechatLogger.debug({ msg: 'Last room for visitor closed. Creating new one', visitorId: guest._id });\n\t}\n\n\tif (!room?.open) {\n\t\treturn {\n\t\t\troom: await createRoom({ visitor: guest, message: message.msg, roomInfo, agent, extraData }),\n\t\t\tnewRoom: true,\n\t\t};\n\t}","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/omnichannel/rooms.ts#L40-L76","documentation":"getRoom is the entry point that finds or creates an omnichannel room for a visitor. Its first guard checks the Livechat_enabled setting and throws Meteor.Error('error-omnichannel-is-disabled') when the workspace has Omnichannel turned off, before any room lookup happens.","triggerScenarios":"A visitor sends a message through the livechat widget/inquiry flow, or an integration calls a getRoom-based path (e.g., livechat room creation endpoints) while Livechat_enabled is false.","commonSituations":"Fresh installation where Omnichannel was never enabled; an admin temporarily disabled Omnichannel; a settings migration or import reset Livechat_enabled to its default false.","solutions":["Enable Omnichannel in Administration > Omnichannel, or set Livechat_enabled=true via the settings REST API, then retry.","If it must stay disabled, stop calling livechat flows and remove/hide the widget embed.","Audit for other tooling (setup wizards, config imports) that may have flipped the setting."],"exampleFix":"// before\nconst { room } = await getRoom(guest, message, roomInfo); // throws error-omnichannel-is-disabled\n\n// after\nif (!settings.get('Livechat_enabled')) {\n\tthrow new Error('Omnichannel is disabled on this workspace');\n}\nconst { room } = await getRoom(guest, message, roomInfo);","handlingStrategy":"validation","validationCode":"if (!settings.get('Livechat_enabled')) {\n\tthrow new Error('Omnichannel is disabled on this workspace');\n}\nconst { room, newRoom } = await getRoom(guest, message, roomInfo);","typeGuard":"const isOmnichannelEnabled = (): boolean => settings.get<boolean>('Livechat_enabled');","tryCatchPattern":"try {\n\tconst { room } = await getRoom(guest, message, roomInfo);\n} catch (err) {\n\tif (err instanceof Meteor.Error && err.error === 'error-omnichannel-is-disabled') {\n\t\t// tell the visitor the channel is offline; do not retry until the setting changes\n\t\treturn;\n\t}\n\tthrow err;\n}","preventionTips":["Check the setting (or the livechat config/online endpoint) before mounting the widget.","Monitor setting changes and disable livechat entry points when Omnichannel is off.","After environment restores, verify Livechat_enabled is still true."],"tags":["omnichannel","livechat","settings","room-creation"],"backgroundTag":"feature-disabled-by-setting","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}