RocketChat/Rocket.Chat · error · Meteor.Error
error-app-prevented
error-app-prevented
Error message
error.message
What it means
During room creation, an installed Rocket.Chat App listening to IPreRoomCreatePrevent threw an AppsEngineException, and its message is surfaced as error-app-prevented. The app explicitly vetoed (or crashed while vetoeing) the creation of this room.
Solutions
- Identify the app: check its logs / Apps-Engine debug output for the handler that threw
- Align the room (name/type/members) with the app's policy, or ask the admin to relax/disable the rule
- If the exception message is opaque, enable apps-engine debug logging to see the app-side stack before re-attempting creation
Defensive patterns
Strategy: try-catch
Try / catch
try {
await createRoom(type, name, owner, members, extraData);
} catch (err) {
if (err instanceof Meteor.Error && err.error === 'error-app-prevented') {
// err.message carries the app's exception text — surface it to the admin/operator
}
throw err;
} Prevention
- Keep an inventory of installed apps that hook IPreRoomCreate
- Include the app's exception message in operator-facing error reports
- Test room creation in a CI workspace with the same apps installed
When it happens
Trigger: Apps.self.triggerEvent(AppEvents.IPreRoomCreatePrevent, tmp) rejects with an error whose name equals AppsEngineException.name — e.g. an app calling context.getInteractionResponder().error or throwing inside its IPreRoomCreate handler for rooms matching a policy (name pattern, type, member).
Common situations: Compliance/governance apps that block channel creation by naming convention; app bugs where the handler throws on unexpected payloads; app updated with stricter rules after rooms were previously created fine.
Related errors
- Invalid app provided
- A new user type has been added that the Apps don't know…
- A video conference must exist to update.
- app-addon-not-valid
- App already exists.
AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18).
Data as JSON: /api/errors/8f5109c56d95ea3a.
Report an issue: GitHub.
Appendix: source
Thrown at apps/meteor/server/lib/rooms/createRoom.ts:267
ts: now,
ro: readOnly === true,
};
if (teamId) {
const team = await Team.getOneById(teamId, { projection: { _id: 1 } });
if (team) {
roomProps.teamId = team._id;
}
}
const tmp = {
...roomProps,
_USERNAMES: memberList,
};
const prevent = await Apps.self?.triggerEvent(AppEvents.IPreRoomCreatePrevent, tmp).catch((error) => {
if (error.name === AppsEngineException.name) {
throw new Meteor.Error('error-app-prevented', error.message);
}
throw error;
});
if (prevent) {
throw new Meteor.Error('error-app-prevented', 'A Rocket.Chat App prevented the room creation.');
}
const eventResult = await Apps.self?.triggerEvent(
AppEvents.IPreRoomCreateModify,
await Apps.triggerEvent(AppEvents.IPreRoomCreateExtend, tmp),
);
if (eventResult && typeof eventResult === 'object' && delete eventResult._USERNAMES) {
Object.assign(roomProps, eventResult);
}
View on GitHub (pinned to b2c16d5842)