{"record":{"id":"03e1d40b1ef3e969","repo":"RocketChat/Rocket.Chat","slug":"no-user-provided-and-rocket-cat-not-found","errorCode":null,"errorMessage":"No user provided and rocket.cat not found","messagePattern":"No user provided and rocket\\.cat not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"apps/meteor/server/lib/omnichannel/sendTranscript.ts","lineNumber":211,"sourceCode":"\t});\n\n\tconst requestData: IOmnichannelSystemMessage['requestData'] = {\n\t\ttype: 'user',\n\t\tvisitor,\n\t\tuser,\n\t};\n\n\tif (!user?.username) {\n\t\tconst cat = await Users.findOneById('rocket.cat', { projection: { _id: 1, username: 1, name: 1 } });\n\t\tif (cat) {\n\t\t\trequestData.user = cat;\n\t\t\trequestData.type = 'visitor';\n\t\t}\n\t}\n\n\tif (!requestData.user) {\n\t\tlogger.error('rocket.cat user not found');\n\t\tthrow new Error('No user provided and rocket.cat not found');\n\t}\n\n\tawait Message.saveSystemMessage<IOmnichannelSystemMessage>('livechat_transcript_history', room._id, '', requestData.user, {\n\t\trequestData,\n\t});\n\n\treturn true;\n}\n\nexport async function requestTranscript({\n\trid,\n\temail,\n\tsubject,\n\tuser,\n}: {\n\trid: string;\n\temail: string;\n\tsubject: string;","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/2a7de457074cbb4d4373fbd9a4e5bea292c9c764/apps/meteor/server/lib/omnichannel/sendTranscript.ts#L193-L229","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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)","Audit what deleted it: custom cleanup jobs, user import pipelines, or scripts that purge users","Pass an explicit user to the transcript call so the fallback is never needed","Review scripts that manipulate the users collection to always exclude _id 'rocket.cat'"],"exampleFix":"// before\nawait sendTranscript({ rid, token, email }); // no user -> falls back to rocket.cat\n\n// after\n// pass an explicit requesting user so the rocket.cat fallback is never exercised\nawait sendTranscript({ rid, token, email, user: await Users.findOneById(userId) });","handlingStrategy":"fallback","validationCode":"import { Users } from '@rocket.chat/models';\n\nconst cat = await Users.findOneById('rocket.cat', { projection: { _id: 1, username: 1, name: 1 } });\nif (!cat) {\n  throw new Error('rocket.cat system user missing — database is in a broken state');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await sendTranscript({ rid, token, email });\n} catch (err) {\n  if (err instanceof Error && err.message === 'No user provided and rocket.cat not found') {\n    // pass an explicit user on retry; flag the missing system user to ops\n  } else {\n    throw err;\n  }\n}","preventionTips":["Never let cleanup/import scripts delete _id 'rocket.cat' — blocklist system users","After DB restores/migrations, assert rocket.cat exists as a smoke test","Prefer passing an explicit requesting user to transcript flows so the fallback is unused"],"tags":["omnichannel","transcript","rocket-cat","system-user","data-corruption"],"backgroundTag":"missing-system-user","analyzedSha":"2a7de457074cbb4d4373fbd9a4e5bea292c9c764","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-09T01:17:15.007Z"}