RocketChat/Rocket.Chat · warning · Error

Mention bot - Failed to retrieve message information

Error message

Mention bot - Failed to retrieve message information

What it means

In the `mention-core` blockAction handler, the `blockId` of the action is used as a reference message id: `Messages.findOneById(referenceMessageId, { projections: { _id: 1, tmid: 1 } })`. If the lookup returns null the module throws `Error('Mention bot - Failed to retrieve message information')` — the message the ephemeral mention prompt points at no longer exists (deleted, purged, or the blockId is not a real message id).

Source

Thrown at apps/meteor/server/modules/core-apps/mention.module.ts:43

	appId = 'mention-core';

	async blockAction(payload: UiKitCoreAppBlockActionPayload): Promise<undefined> {
		const {
			actionId,
			payload: { value: stringifiedMentions, blockId: referenceMessageId },
		} = payload;

		const user = payload.user!;
		const room = payload.room!;

		const mentions = retrieveMentionsFromPayload(stringifiedMentions as string);

		const usernames = mentions.map(({ username }) => username);

		const message = await Messages.findOneById(referenceMessageId, { projection: { _id: 1, tmid: 1 } });

		if (!message) {
			throw new Error('Mention bot - Failed to retrieve message information');
		}

		const joinedUsernames = `@${usernames.join(', @')}`;

		if (actionId === 'dismiss') {
			void api.broadcast('notify.ephemeralMessage', user._id, room, {
				msg: i18n.t('You_mentioned___mentions__but_theyre_not_in_this_room', {
					mentions: joinedUsernames,
					lng: user.language,
				}),
				_id: payload.message,
				tmid: message.tmid,
				mentions,
			});
			return undefined;
		}

		if (actionId === 'add-users') {

View on GitHub (pinned to b2c16d5842)

Solutions

  1. Ensure the block action's `blockId` is the `_id` of an existing message when the prompt is built.
  2. Client-side, dismiss or disable the ephemeral mention prompt when its reference message is removed.
  3. Treat this error as benign when the message was legitimately deleted — catch and ignore it.
Defensive patterns

Strategy: validation

Validate before calling

import { Messages } from '@rocket.chat/models';

const message = await Messages.findOneById(referenceMessageId, { projection: { _id: 1 } });
if (!message) {
  // reference message gone: skip the mention action instead of dispatching
} else {
  await mentionModule.blockAction(payload);
}

Try / catch

try {
  await mentionModule.blockAction(payload);
} catch (error) {
  if (error instanceof Error && error.message === 'Mention bot - Failed to retrieve message information') {
    return; // reference message was deleted: benign stale-prompt case
  }
  throw error;
}

Prevention

When it happens

Trigger: A user clicks the mention prompt's action after the reference message was deleted; a retention/purge job removed the message between prompt render and click; a custom payload sets `blockId` to something that is not an existing message `_id`.

Common situations: Message deletion races with the ephemeral prompt; retention policies purging old messages while prompts are open; custom clients that set blockId incorrectly when building the mention prompt.

Related errors


AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18). Data as JSON: /api/errors/f30710ac8e6d2b98. Report an issue: GitHub.