RocketChat/Rocket.Chat · error · Error
error-contact-channel-blocked
error-contact-channel-blocked
Error message
error-contact-channel-blocked
What it means
After getRoom locates the room, it asks LivechatContacts.isChannelBlocked for the visitor association (room.v._id + room.source). If the contact's channel is blocked, a plain Error('error-contact-channel-blocked') is thrown, so the visitor cannot continue the existing conversation.
Source
Thrown at apps/meteor/server/lib/omnichannel/rooms.ts:64
notifyOnSubscriptionChanged,
notifyOnRoomChanged,
} from '../notifyListener';
export async function getRoom(
guest: ILivechatVisitor,
message: Pick<IMessage, 'rid' | 'msg' | 'token'>,
roomInfo: IOmnichannelRoomInfo,
agent?: SelectedAgent,
extraData?: IOmnichannelRoomExtraData,
) {
if (!settings.get('Livechat_enabled')) {
throw new Meteor.Error('error-omnichannel-is-disabled');
}
livechatLogger.debug({ msg: 'Attempting to find or create a room for visitor', visitorId: guest._id });
const room = await LivechatRooms.findOneById(message.rid);
if (room?.v._id && (await LivechatContacts.isChannelBlocked(Visitors.makeVisitorAssociation(room.v._id, room.source)))) {
throw new Error('error-contact-channel-blocked');
}
if (!room?.open) {
livechatLogger.debug({ msg: 'Last room for visitor closed. Creating new one', visitorId: guest._id });
}
if (!room?.open) {
return {
room: await createRoom({ visitor: guest, message: message.msg, roomInfo, agent, extraData }),
newRoom: true,
};
}
if (room.v.token !== guest.token) {
livechatLogger.debug({ msg: 'Visitor trying to access another visitor room', visitorId: guest._id });
throw new Meteor.Error('cannot-access-room');
}
View on GitHub (pinned to b2c16d5842)
Solutions
- Unblock the contact channel in Administration > Omnichannel > Contacts (or the equivalent contact API) and retry.
- If the block was automated, review the rule/app that blocked this visitor.
- Inspect the LivechatContacts record for the visitor/source pair to confirm the block state.
Defensive patterns
Strategy: validation
Validate before calling
const blocked = room?.v?._id
? await LivechatContacts.isChannelBlocked(Visitors.makeVisitorAssociation(room.v._id, room.source))
: false;
if (blocked) {
// inform the visitor the channel is blocked instead of calling getRoom
} Try / catch
try {
const { room } = await getRoom(guest, message, roomInfo);
} catch (err) {
if ((err as Error).message === 'error-contact-channel-blocked') {
// show 'this channel can no longer be used'; do not retry
return;
}
throw err;
} Prevention
- Check the contact's block state before routing new messages into an existing room.
- Surface blocklist changes to agents so they understand why visitors go quiet.
- Automated blocking rules should log which visitor/source they blocked and why.
When it happens
Trigger: A visitor whose contact channel (e.g., a WhatsApp number or other source identity) was blocked sends a message into an existing room: the room lookup succeeds, then the block check fails.
Common situations: An agent or automation blocked the contact in the omnichannel Contacts panel; a spam contact keeps reusing an old rid; a moderation workflow blocks channels automatically.
Related errors
AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18).
Data as JSON: /api/errors/813894d88d425fa9.
Report an issue: GitHub.