RocketChat/Rocket.Chat · error
Failed to create new room
Error message
Failed to create new room
What it means
During an import, the RoomConverter failed to create a channel/private group via the server's createChannelMethod/createPrivateGroupMethod. It logs the room name, member list and error, then rethrows — this room's import aborts and, because the error propagates, the import step fails rather than skipping. The inner check 'importer-channel-invalid-creator' fires when the mapped creator user no longer exists.
Source
Thrown at apps/meteor/server/lib/import/classes/converters/RoomConverter.ts:131
roomInfo = await createDirectMessage(members, startedByUserId, true);
} else {
if (!roomData.name) {
return;
}
if (roomData.t === 'p') {
const user = await Users.findOneById(creatorId);
if (!user) {
throw new Error('importer-channel-invalid-creator');
}
roomInfo = await createPrivateGroupMethod(user, roomData.name, members, false, {}, {});
} else {
roomInfo = await createChannelMethod(creatorId, roomData.name, members, false, {}, {});
}
}
roomData._id = roomInfo.rid;
} catch (e) {
this._logger.warn({ msg: 'Failed to create new room', name: roomData.name, members, err: e });
throw e;
}
await this.updateRoomId(roomData._id as 'string', roomData);
}
async archiveRoomById(rid: string) {
const responses = await Promise.all([Rooms.archiveById(rid), Subscriptions.archiveByRoomId(rid)]);
if (responses[1]?.modifiedCount) {
void notifyOnSubscriptionChangedByRoomId(rid);
}
}
async updateRoomId(_id: string, roomData: IImportChannel): Promise<void> {
const set = {
ts: roomData.ts,
topic: roomData.topic,View on GitHub (pinned to b2c16d5842)
Solutions
- Read err in the log entry: 'importer-channel-invalid-creator' means remap or re-import the users first
- For duplicate names, delete or rename the existing room, or adjust the imported name, then re-run the import step
- Fix the offending entries in the source export (name/members) and re-upload
- Re-run — rooms already created in earlier progress are skipped
Defensive patterns
Strategy: validation
Validate before calling
// pre-flight before the import step creates rooms
const creator = await Users.findOneById(creatorId);
if (!creator) throw new Error(`importer-channel-invalid-creator: ${creatorId}`);
const nameConflict = await Rooms.findOneByName(roomData.name);
if (nameConflict) {
roomData.name = `${roomData.name}-imported`; // or skip/report
} Try / catch
try {
roomData._id = (await createChannelMethod(creatorId, roomData.name, members, false, {}, {})).rid;
} catch (e) {
this._logger.warn({ msg: 'Failed to create new room', name: roomData.name, members, err: e });
throw e; // abort this room's import — do not continue with an unset _id
} Prevention
- Import users before channels so creators and members resolve
- Check the target workspace for name collisions before importing
- Sanitize imported room names to valid Rocket.Chat names before the create call
When it happens
Trigger: Creator user id missing from Users when creating a private group; room name colliding with an existing channel/group of the same type; name validation failing after conversion of the source name (empty, too long, invalid characters); members list containing users that failed to import.
Common situations: Importing into a workspace that already has channels with the same names; users deleted between the prepare and import phases; Slack/Skype names that normalize to invalid Rocket.Chat room names.
Related errors
- error-importer-not-defined
- Import operation not initialized.
- error-importer-not-defined
- The file contains invalid syntax
- Failed to set user avatar from pending URL
AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18).
Data as JSON: /api/errors/d0790732079c4a6b.
Report an issue: GitHub.