{"record":{"id":"9cafc33e00ad0a0a","repo":"RocketChat/Rocket.Chat","slug":"app-addon-not-valid","errorCode":"app-addon-not-valid","errorMessage":"app-addon-not-valid","messagePattern":"app-addon-not-valid","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/ee/server/lib/license/canEnableApp.ts","lineNumber":25,"sourceCode":"\ntype _canEnableAppDependencies = {\n\tApps: typeof Apps;\n\tLicense: LicenseImp;\n};\n\nexport const _canEnableApp = async ({ Apps, License }: _canEnableAppDependencies, app: IAppStorageItem): Promise<void> => {\n\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');","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/ee/server/lib/license/canEnableApp.ts#L7-L43","documentation":"The app being enabled declares an addon (app.info.addon) that names a licensed module, and the current license does not include that module (License.hasModule returns false). Apps tagged as requiring an add-on cannot be enabled without it. Apps marked migrated (installed before validation existed) are exempt.","triggerScenarios":"Enabling a marketplace or private app whose info declares an addon on a workspace whose license lacks that module; e.g. after a trial including the module expires.","commonSituations":"Trial license lapsed; app updated to require a new paid add-on; license downgraded to a tier without the module.","solutions":["Apply a license that includes the app's required module (Administration -> License)","Request a trial/evaluation license that covers the add-on","If the app should not require the module, fix its info.addon declaration and rebuild/re-publish the app"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { License } from '@rocket.chat/license';\n\nconst requiredModule = app.info.addon;\nif (requiredModule && !License.hasModule(requiredModule)) {\n\t// show 'module not licensed' notice and skip the enable call\n}","typeGuard":null,"tryCatchPattern":"try {\n\tawait Apps.enableApp(appId);\n} catch (err) {\n\tif (err instanceof Error && err.message === 'app-addon-not-valid') {\n\t\t// surface license/upgrade prompt for the app's add-on\n\t} else {\n\t\tthrow err;\n\t}\n}","preventionTips":["Check app.info.addon against License.hasModule before showing an enable button","Track license module coverage when installing apps that declare add-ons","Re-validate add-on requirements after license renewals/downgrades"],"tags":["apps-engine","license","marketplace","addon"],"backgroundTag":"license-module-missing","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"}