RocketChat/Rocket.Chat · error · Error
Creating normal users is currently not supported
Error message
Creating normal users is currently not supported
What it means
Thrown by the users bridge create method when user.type is anything other than 'bot' or 'app'. The bridge explicitly supports creating only bot/app users (app-owned identities); the default branch of the switch rejects any other type, including normal human users.
Source
Thrown at apps/meteor/app/apps/server/bridges/users.ts:105
}
switch (user.type) {
case 'bot':
case 'app':
if (!(await checkUsernameAvailability(user.username as string))) {
throw new Error(`The username "${user.username}" is already being used. Rename or remove the user using it to install this App`);
}
await Users.insertOne(user);
if (options?.avatarUrl) {
await setUserAvatar(user, options.avatarUrl, '', 'local');
}
break;
default:
throw new Error('Creating normal users is currently not supported');
}
void notifyOnUserChangeById({ clientAction: 'inserted', id: user._id });
return user._id;
}
protected async remove(user: IUser & { id: string }, appId: string): Promise<boolean> {
this.orch.debugLog(`The App's user is being removed: ${appId}`);
// It's actually not a problem if there is no App user to delete - just means we don't need to do anything more.
if (!user) {
return true;
}
try {
await deleteUser(user.id);
} catch (err) {View on GitHub (pinned to f9d3ec372b)
Solutions
- Set user.type to 'bot' or 'app' when creating users through the Apps Engine.
- Use the REST API or a server-side migration for provisioning real human users — the Apps Engine intentionally forbids it.
- Validate the type field before calling create.
Example fix
// before
const u: IUser = { name, username, type: 'user' };
await users.create(u);
// after
const u: IUser = { name, username, type: 'bot' };
await users.create(u); Defensive patterns
Strategy: type-guard
Type guard
function isAppUserType(type: string): boolean {
return type === 'bot' || type === 'app';
} Prevention
- Only create bot/app users via the Apps Engine.
- Provision human users through the REST API, not the bridge.
- Set user.type explicitly to 'bot' or 'app'.
When it happens
Trigger: App calls create with a user whose type is undefined, 'user', or any value outside {'bot','app'}. The switch falls through to the default branch and throws.
Common situations: App author tries to provision human users via the Apps Engine; user object built without setting type; type field populated from an external source that uses different enum values.
Related errors
- The username "${user.username}" is already being used. Renam
- User not provided
- Invalid user id
- Invalid Api parameter provided, it must be a valid IApi obje
- Invalid command parameter provided, must be a string.
AI-assisted analysis of RocketChat/Rocket.Chat@f9d3ec372b (2026-08-12).
Data as JSON: /api/errors/41634e6a39eda3ed.
Report an issue: GitHub.