{"record":{"id":"89c8d7d33a51cf0d","repo":"RocketChat/Rocket.Chat","slug":"license-prevented","errorCode":"license-prevented","errorMessage":"license-prevented","messagePattern":"license-prevented","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/ee/server/lib/license/canEnableApp.ts","lineNumber":32,"sourceCode":"\tif (!(await Apps.isInitialized())) {\n\t\tthrow new Error('apps-engine-not-initialized');\n\t}\n\n\t// Migrated apps were installed before the validation was implemented\n\t// so they're always allowed to be enabled\n\tif (app.migrated) {\n\t\treturn;\n\t}\n\n\tif (app.info.addon && !License.hasModule(app.info.addon as LicenseModule)) {\n\t\tthrow new Error('app-addon-not-valid');\n\t}\n\n\tconst source = getInstallationSourceFromAppStorageItem(app);\n\tswitch (source) {\n\t\tcase 'private':\n\t\t\tif (await License.shouldPreventAction('privateApps')) {\n\t\t\t\tthrow new Error('license-prevented');\n\t\t\t}\n\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tif (await License.shouldPreventAction('marketplaceApps')) {\n\t\t\t\tthrow new Error('license-prevented');\n\t\t\t}\n\n\t\t\tconst marketplaceInfo = app.marketplaceInfo?.[0];\n\t\t\tif (marketplaceInfo?.isEnterpriseOnly && !License.hasValidLicense()) {\n\t\t\t\tthrow new Error('invalid-license');\n\t\t\t}\n\n\t\t\tbreak;\n\t}\n};\n\nexport const canEnableApp = async (app: IAppStorageItem): Promise<void> => _canEnableApp({ Apps, License }, app);","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/ee/server/lib/license/canEnableApp.ts#L14-L50","documentation":"Enable guard for apps installed from a private source: License.shouldPreventAction('privateApps') returned true, meaning the license does not allow (more) enabled private apps, so enabling is blocked with 'license-prevented'.","triggerScenarios":"Enabling a privately-installed app (installed from a zip/private URL rather than the marketplace) when the number of enabled private apps already meets the licensed limit, or the license tier allows none.","commonSituations":"Community/no license where privateApps allowance is zero; expired trial; enabling more internal apps than the tier permits.","solutions":["Disable another private app to free a slot, then retry the enable","Upgrade or renew the license to one that allows more private apps","Check the license's privateApps limit in Administration -> License before enabling"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { License } from '@rocket.chat/license';\n\nif (await License.shouldPreventAction('privateApps')) {\n\t// block enable with a 'private app limit reached' notice\n}\nawait Apps.enableApp(appId);","typeGuard":null,"tryCatchPattern":"try {\n\tawait Apps.enableApp(appId);\n} catch (err) {\n\tif (err instanceof Error && err.message === 'license-prevented') {\n\t\t// check which counter (privateApps/marketplaceApps) is exhausted and prompt upgrade\n\t} else {\n\t\tthrow err;\n\t}\n}","preventionTips":["Surface the enabled private-apps count vs licensed limit in admin UI before enabling","Disable unused private apps instead of leaving them enabled","Recheck allowances after any license change"],"tags":["license","apps-engine","private-apps"],"backgroundTag":"license-limit-exceeded","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"}