{"record":{"id":"a3208b7d4276d9ef","repo":"RocketChat/Rocket.Chat","slug":"error-invalid-user-a3208b","errorCode":"error-invalid-user","errorMessage":"Invalid user (did you delete the `rocket.cat` user?)","messagePattern":"Invalid user \\(did you delete the `rocket\\.cat` user\\?\\)","errorType":"validation","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/lib/integrations/lib/validateOutgoingIntegration.ts","lineNumber":148,"sourceCode":"\n\t\t\tfor (const channel of channels) {\n\t\t\t\tif (!validChannelChars.includes(channel[0]) && !scopedChannels.includes(channel.toLowerCase())) {\n\t\t\t\t\tthrow new Meteor.Error('error-invalid-channel-start-with-chars', 'Invalid channel. Start with @ or #', {\n\t\t\t\t\t\tfunction: 'validateOutgoing',\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else if (!(await hasPermissionAsync(userId, 'manage-outgoing-integrations'))) {\n\t\tthrow new Meteor.Error('error-invalid-permissions', 'Invalid permission for required Integration creation.', {\n\t\t\tfunction: 'validateOutgoing',\n\t\t});\n\t}\n\n\tconst user = await Users.findOne({ username: integration.username });\n\n\tif (!user) {\n\t\tthrow new Meteor.Error('error-invalid-user', 'Invalid user (did you delete the `rocket.cat` user?)', { function: 'validateOutgoing' });\n\t}\n\n\tconst integrationData: IOutgoingIntegration = {\n\t\t...integration,\n\t\tscriptEngine: integration.scriptEngine ?? 'isolated-vm',\n\t\ttype: 'webhook-outgoing',\n\t\tchannel: channels,\n\t\tuserId: user._id,\n\t\t_createdAt: new Date(),\n\t\t_createdBy: await Users.findOne(userId, { projection: { username: 1 } }),\n\t};\n\n\tif (outgoingEvents[integration.event].use.triggerWords && integration.triggerWords) {\n\t\tif (!Match.test(integration.triggerWords, [String])) {\n\t\t\tthrow new Meteor.Error('error-invalid-triggerWords', 'Invalid triggerWords', {\n\t\t\t\tfunction: 'validateOutgoing',\n\t\t\t});\n\t\t}","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/integrations/lib/validateOutgoingIntegration.ts#L130-L166","documentation":"Thrown in validateOutgoing when Users.findOne({ username: integration.username }) returns null: the 'post as' user named by the integration does not exist. The message points at the most common cause — the built-in rocket.cat bot having been deleted — since rocket.cat is the default username for outgoing integrations. Meteor.Error code 'error-invalid-user'.","triggerScenarios":"integrations.create with username 'rocket.cat' on a workspace where that system user was deleted, or with a typo'd/bot-deactivated username ('rocket.cat ' with a space, 'Rocket.Cat' with wrong case, or a bot account that was removed).","commonSituations":"Fresh restores or trimmed test datasets where the system user was purged; workspaces that disable the bot user and someone deletes it; provisioning scripts that reference a bot before creating it.","solutions":["Point username at an existing user (any real account or bot) and retry","If rocket.cat was deleted, re-create it or run the factory reset/seed so the system user exists again","Verify beforehand with GET /api/v1/users.info?username=rocket.cat"],"exampleFix":"// before\n{ username: 'rocket.cat' } // rocket.cat was deleted from the workspace\n\n// after — use an existing user\n{ username: 'my.bot' }","handlingStrategy":"validation","validationCode":"const user = await Users.findOne({ username: integration.username }, { projection: { _id: 1 } });\nif (!user) {\n  throw new Error(`post-as user '${integration.username}' does not exist`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify the post-as username via users.info before creating integrations in automation","Never delete the rocket.cat system user on workspaces that use integrations"],"tags":["integrations","outgoing-webhook","user-not-found","rocket-cat"],"backgroundTag":"user-not-found","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}