{"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/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/ee/server/lib/license/canEnableApp.ts#L7-L43","documentation":"Thrown by _canEnableApp when app.info.addon is set and License.hasModule(<addon>) is false — the app declares a required addon module that the current license does not include. Plain Error. Migrated apps return early before this check, so it only affects apps installed after the addon validation was introduced.","triggerScenarios":"Enabling an app whose manifest declares an addon module (e.g. a premium/bundled module) on a server whose license lacks that module; installing a marketplace app that later gained an addon requirement.","commonSituations":"License downgrade removed the module; app updated to require a new addon; community edition used to enable a premium app.","solutions":["Acquire/apply a license that includes the required addon module and retry.","Install a version of the app that does not require the addon, if available.","If the app was migrated from a pre-validation install, mark app.migrated = true (only valid for genuine migrations)."],"exampleFix":"// before\nawait canEnableApp(app); // throws app-addon-not-valid\n\n// after\nif (app.info.addon && !License.hasModule(app.info.addon)) {\n  throw new Error(`Apply a license including module '${app.info.addon}' before enabling ${app.info.name}`);\n}","handlingStrategy":"validation","validationCode":"async function canEnableAddonApp(app: IAppStorageItem): Promise<boolean> {\n  return !app.info.addon || License.hasModule(app.info.addon as LicenseModule);\n}","typeGuard":"const declaresAddon = (app: IAppStorageItem): boolean => Boolean(app?.info?.addon);","tryCatchPattern":"try { await canEnableApp(app); } catch (e) {\n  if (e instanceof Error && e.message === 'app-addon-not-valid') { /* apply license with module or use other app version */ } else throw e;\n}","preventionTips":["Check License.hasModule(app.info.addon) in the marketplace UI before showing Enable.","Document addon requirements on app listings."],"tags":["apps-engine","license","addon","enterprise"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}