{"record":{"id":"8f5109c56d95ea3a","repo":"RocketChat/Rocket.Chat","slug":"error-app-prevented-8f5109","errorCode":"error-app-prevented","errorMessage":"error.message","messagePattern":"error\\.message","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/lib/rooms/createRoom.ts","lineNumber":267,"sourceCode":"\t\tts: now,\n\t\tro: readOnly === true,\n\t};\n\n\tif (teamId) {\n\t\tconst team = await Team.getOneById(teamId, { projection: { _id: 1 } });\n\t\tif (team) {\n\t\t\troomProps.teamId = team._id;\n\t\t}\n\t}\n\n\tconst tmp = {\n\t\t...roomProps,\n\t\t_USERNAMES: memberList,\n\t};\n\n\tconst prevent = await Apps.self?.triggerEvent(AppEvents.IPreRoomCreatePrevent, tmp).catch((error) => {\n\t\tif (error.name === AppsEngineException.name) {\n\t\t\tthrow new Meteor.Error('error-app-prevented', error.message);\n\t\t}\n\n\t\tthrow error;\n\t});\n\n\tif (prevent) {\n\t\tthrow new Meteor.Error('error-app-prevented', 'A Rocket.Chat App prevented the room creation.');\n\t}\n\n\tconst eventResult = await Apps.self?.triggerEvent(\n\t\tAppEvents.IPreRoomCreateModify,\n\t\tawait Apps.triggerEvent(AppEvents.IPreRoomCreateExtend, tmp),\n\t);\n\n\tif (eventResult && typeof eventResult === 'object' && delete eventResult._USERNAMES) {\n\t\tObject.assign(roomProps, eventResult);\n\t}\n","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/rooms/createRoom.ts#L249-L285","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await createRoom(type, name, owner, members, extraData);\n} catch (err) {\n  if (err instanceof Meteor.Error && err.error === 'error-app-prevented') {\n    // err.message carries the app's exception text — surface it to the admin/operator\n  }\n  throw err;\n}","preventionTips":["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"],"tags":["apps-engine","room-creation","app-lifecycle","governance"],"backgroundTag":"app-blocked-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"}