{"record":{"id":"41634e6a39eda3ed","repo":"RocketChat/Rocket.Chat","slug":"creating-normal-users-is-currently-not-supported","errorCode":null,"errorMessage":"Creating normal users is currently not supported","messagePattern":"Creating normal users is currently not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/meteor/app/apps/server/bridges/users.ts","lineNumber":105,"sourceCode":"\t\t}\n\n\t\tswitch (user.type) {\n\t\t\tcase 'bot':\n\t\t\tcase 'app':\n\t\t\t\tif (!(await checkUsernameAvailability(user.username as string))) {\n\t\t\t\t\tthrow new Error(`The username \"${user.username}\" is already being used. Rename or remove the user using it to install this App`);\n\t\t\t\t}\n\n\t\t\t\tawait Users.insertOne(user);\n\n\t\t\t\tif (options?.avatarUrl) {\n\t\t\t\t\tawait setUserAvatar(user, options.avatarUrl, '', 'local');\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('Creating normal users is currently not supported');\n\t\t}\n\n\t\tvoid notifyOnUserChangeById({ clientAction: 'inserted', id: user._id });\n\n\t\treturn user._id;\n\t}\n\n\tprotected async remove(user: IUser & { id: string }, appId: string): Promise<boolean> {\n\t\tthis.orch.debugLog(`The App's user is being removed: ${appId}`);\n\n\t\t// It's actually not a problem if there is no App user to delete - just means we don't need to do anything more.\n\t\tif (!user) {\n\t\t\treturn true;\n\t\t}\n\n\t\ttry {\n\t\t\tawait deleteUser(user.id);\n\t\t} catch (err) {","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/app/apps/server/bridges/users.ts#L87-L123","documentation":"The users bridge create path only supports users of type 'bot' or 'app' — Rocket.Chat app users. Any other type falls through the switch to 'Creating normal users is currently not supported', a deliberate restriction: apps must not create human accounts.","triggerScenarios":"App passes an IUser with type undefined, 'user', or any value other than 'bot'/'app' to the user-creation bridge.","commonSituations":"Building user objects by hand and omitting the type field; porting code that assumed arbitrary user creation; pushing converted external users into the bridge.","solutions":["Set user.type = 'bot' — most apps never need to create users beyond the framework-provided app user.","For real human accounts, use the REST/provisioning API with admin credentials instead of this bridge.","Re-examine whether you need a second bot user at all; often the app's own user suffices."],"exampleFix":"// before\nconst user: IUser = { ...base, type: 'user' };\nawait createUser(user, options, appId);\n\n// after\nconst user: IUser = { ...base, type: 'bot' };\nawait createUser(user, options, appId);","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"const isBotOrAppUser = (u: IUser): u is IUser & { type: 'bot' | 'app' } =>\n  u.type === 'bot' || u.type === 'app';","tryCatchPattern":null,"preventionTips":["Only create bot/app users through the apps-engine bridge.","Use the REST/provisioning API for human accounts.","Default the type field to 'bot' whenever constructing users manually."],"tags":["apps-engine","users","unsupported","bot"],"backgroundTag":"unsupported-operation","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}