RocketChat/Rocket.Chat · warning

Mentioned room not found

Error message

Mentioned room not found

What it means

During message import, a #channel mention could not be resolved to an imported room (getMentionedChannelData returned nothing usable). The mention is skipped with continue: the channel is left out of the message's channels array and the raw imported id stays unreplaced in the message text. Non-fatal - the message itself still imports.

Source

Thrown at apps/meteor/server/lib/import/classes/converters/MessageConverter.ts:129

			emoji: data.emoji,
			alias: data.alias,
			...(data._id ? { _id: data._id } : {}),
			...(data.reactions ? { reactions: await this.convertMessageReactions(data.reactions) } : {}),
		});
	}

	protected async convertMessageChannels(message: IImportMessage): Promise<MentionedChannel[] | undefined> {
		const { channels } = message;
		if (!channels) {
			return;
		}

		const result: MentionedChannel[] = [];
		for (const importId of channels) {
			const { name, _id } = (await this.getMentionedChannelData(importId)) || {};

			if (!_id || !name) {
				this._logger.warn({ msg: 'Mentioned room not found', importId });
				continue;
			}

			message.msg = message.msg.replace(new RegExp(`\#${importId}`, 'gi'), `#${name}`);

			result.push({
				_id,
				name,
			});
		}

		return result;
	}

	protected async convertMessageMentions(message: IImportMessage): Promise<MentionedUser[] | undefined> {
		const { mentions } = message;
		if (!mentions) {
			return undefined;

View on GitHub (pinned to b2c16d5842)

Solutions

  1. Import the missing channels too, or accept the loss - only mention metadata and the text substitution are affected
  2. Pre-scan message channel mentions against the imported channel ids before running the import
  3. Post-import, fix leftover raw channel ids in message text with a targeted database update if fidelity matters
Defensive patterns

Strategy: fallback

Validate before calling

const importedChannelIds = new Set(channels.map((c) => c._id));
const sanitizeMessage = (msg: IImportMessage) => ({
  ...msg,
  channels: (msg.channels ?? []).filter((id) => importedChannelIds.has(id)),
});

Prevention

When it happens

Trigger: An imported message mentions a channel that is not part of the import set: deleted or renamed private channels, channels created after the export, or channels skipped because of earlier import errors.

Common situations: Slack exports omitting private channels the exporting admin could not access; selective imports of a few channels while messages cross-reference others; workspace-to-workspace migrations with different channel sets.

Related errors


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