{"record":{"id":"7f117fae27ca041a","repo":"RocketChat/Rocket.Chat","slug":"invalid-license","errorCode":"invalid-license","errorMessage":"invalid-license","messagePattern":"invalid-license","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/ee/server/lib/license/canEnableApp.ts","lineNumber":43,"sourceCode":"\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);\n","sourceCodeStart":25,"sourceCodeEnd":51,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/ee/server/lib/license/canEnableApp.ts#L25-L51","documentation":"The app's first marketplaceInfo entry marks it isEnterpriseOnly, and License.hasValidLicense() is false (no license applied, or it is expired/invalid). Enterprise-only marketplace apps refuse to enable without a valid license.","triggerScenarios":"Enabling an enterprise-only marketplace app on an unlicensed (Community) workspace or one whose license has expired.","commonSituations":"Community edition installing an enterprise app from the marketplace; license removed or expired after the app was previously enabled and then disabled.","solutions":["Apply a valid Enterprise license (Administration -> License)","If the license exists but is rejected, verify its signature/dates and re-apply a current one","Use a non-enterprise alternative app if licensing is not an option"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { License } from '@rocket.chat/license';\n\nconst isEnterpriseOnly = Boolean(app.marketplaceInfo?.[0]?.isEnterpriseOnly);\nif (isEnterpriseOnly && !License.hasValidLicense()) {\n\t// hide/lock the enable action with an enterprise-license prompt\n}\nawait Apps.enableApp(appId);","typeGuard":null,"tryCatchPattern":"try {\n\tawait Apps.enableApp(appId);\n} catch (err) {\n\tif (err instanceof Error && err.message === 'invalid-license') {\n\t\t// prompt for a valid enterprise license\n\t} else {\n\t\tthrow err;\n\t}\n}","preventionTips":["Mark enterprise-only apps in listings before the user attempts to enable them","Validate the license state after renewal to avoid silent invalidity","Prefer non-enterprise alternatives on Community workloads"],"tags":["license","apps-engine","marketplace","enterprise-only"],"backgroundTag":"invalid-license","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"}