RocketChat/Rocket.Chat · error · Meteor.Error
error-app-prevented-deleting
error-app-prevented-deleting
Error message
A Rocket.Chat App prevented the room erasing.
What it means
Before deleting, eraseRoom triggers the Apps Engine event IPreRoomDeletePrevent; if any loaded App's handler returns a truthy value, deletion is vetoed and this error is thrown. The veto is deliberate policy from an installed App, not a server bug.
Source
Thrown at apps/meteor/server/lib/eraseRoom.ts:46
.getRoomDirectives(room.t)
?.canBeDeleted((permissionId, rid) => hasPermissionAsync(user, permissionId, rid), room))
) {
throw new Meteor.Error('error-not-allowed', 'Not allowed', {
method: 'eraseRoom',
});
}
const team = room.teamId && (await Team.getOneById(room.teamId, { projection: { roomId: 1 } }));
if (team && !(await hasPermissionAsync(user, `delete-team-${room.t === 'c' ? 'channel' : 'group'}`, team.roomId))) {
throw new Meteor.Error('error-not-allowed', 'Not allowed', {
method: 'eraseRoom',
});
}
if (Apps.self?.isLoaded()) {
const prevent = await Apps.self?.triggerEvent(AppEvents.IPreRoomDeletePrevent, room);
if (prevent) {
throw new Meteor.Error('error-app-prevented-deleting', 'A Rocket.Chat App prevented the room erasing.');
}
}
await deleteRoom(room._id);
if (team) {
await Message.saveSystemMessage('user-deleted-room-from-team', team.roomId, room.name || '', user);
}
if (Apps.self?.isLoaded()) {
void Apps.self?.triggerEvent(AppEvents.IPostRoomDeleted, room);
}
}
View on GitHub (pinned to b2c16d5842)
Solutions
- Identify the vetoing App: review installed Apps and which ones listen to IPreRoomDeletePrevent
- Adjust the App's configuration/room filters so this room may be deleted, or disable/uninstall the App if the veto is unwanted
- Contact the App maintainer if the veto looks unintentional
Defensive patterns
Strategy: try-catch
Try / catch
try {
await eraseRoom(roomId, user);
} catch (err) {
if (err instanceof Meteor.Error && err.error === 'error-app-prevented-deleting') {
// an installed App vetoed the delete: inform the user, do not retry
return;
}
throw err;
} Prevention
- Audit which installed Apps hook IPreRoomDeletePrevent before running bulk-delete tooling
- Surface app vetoes explicitly in the UI instead of a generic failure
- Treat this error as policy, not a bug: retrying will not help
When it happens
Trigger: Any installed Rocket.Chat App implementing IPreRoomDeletePrevent (retention/legal-hold, DLP, archival apps) returns true when eraseRoom is called for a room it wants to keep.
Common situations: Compliance apps intentionally blocking deletion of retained rooms; an app bug vetoing every delete; app updated with stricter room filters.
Related errors
- error-app-prevented
- error-app-prevented
- Only channels, private groups and direct messages can be cre
- Invalid user
- Message converter not found
AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18).
Data as JSON: /api/errors/8ede1e5d323a7f24.
Report an issue: GitHub.