RocketChat/Rocket.Chat · critical · Error

No user provided and rocket.cat not found

Error message

No user provided and rocket.cat not found

What it means

When a transcript is recorded (system message 'livechat_transcript_history') and no requesting user was supplied, the code falls back to the built-in rocket.cat system user. If Users.findOneById('rocket.cat') returns null it logs 'rocket.cat user not found' and throws Error('No user provided and rocket.cat not found'). rocket.cat ships with every install, so its absence indicates a damaged database or an over-aggressive cleanup script.

Source

Thrown at apps/meteor/server/lib/omnichannel/sendTranscript.ts:211

	});

	const requestData: IOmnichannelSystemMessage['requestData'] = {
		type: 'user',
		visitor,
		user,
	};

	if (!user?.username) {
		const cat = await Users.findOneById('rocket.cat', { projection: { _id: 1, username: 1, name: 1 } });
		if (cat) {
			requestData.user = cat;
			requestData.type = 'visitor';
		}
	}

	if (!requestData.user) {
		logger.error('rocket.cat user not found');
		throw new Error('No user provided and rocket.cat not found');
	}

	await Message.saveSystemMessage<IOmnichannelSystemMessage>('livechat_transcript_history', room._id, '', requestData.user, {
		requestData,
	});

	return true;
}

export async function requestTranscript({
	rid,
	email,
	subject,
	user,
}: {
	rid: string;
	email: string;
	subject: string;

View on GitHub (pinned to 2a7de45707)

Solutions

  1. Check db.users.findOne({_id: 'rocket.cat'}) — recreate the rocket.cat user if missing (fresh installs create it; you can copy the document shape from a clean instance)
  2. Audit what deleted it: custom cleanup jobs, user import pipelines, or scripts that purge users
  3. Pass an explicit user to the transcript call so the fallback is never needed
  4. Review scripts that manipulate the users collection to always exclude _id 'rocket.cat'

Example fix

// before
await sendTranscript({ rid, token, email }); // no user -> falls back to rocket.cat

// after
// pass an explicit requesting user so the rocket.cat fallback is never exercised
await sendTranscript({ rid, token, email, user: await Users.findOneById(userId) });
Defensive patterns

Strategy: fallback

Validate before calling

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

const cat = await Users.findOneById('rocket.cat', { projection: { _id: 1, username: 1, name: 1 } });
if (!cat) {
  throw new Error('rocket.cat system user missing — database is in a broken state');
}

Try / catch

try {
  await sendTranscript({ rid, token, email });
} catch (err) {
  if (err instanceof Error && err.message === 'No user provided and rocket.cat not found') {
    // pass an explicit user on retry; flag the missing system user to ops
  } else {
    throw err;
  }
}

Prevention

When it happens

Trigger: Executing the sendTranscript flow with user unset/null (e.g. visitor-initiated transcript from the widget) on a deployment where the rocket.cat user document was deleted from the users collection.

Common situations: Admin scripts or LDAP/SCIM sync deleted or skipped system users, a partial DB restore or migration dropped rocket.cat, or a fresh import omitted system accounts.

Related errors


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