RocketChat/Rocket.Chat · error · Error
invalid-license
invalid-license
Error message
invalid-license
What it means
Thrown by _canEnableApp after the marketplace branch passes shouldPreventAction('marketplaceApps'), when app.marketplaceInfo[0].isEnterpriseOnly is true and License.hasValidLicense() is false. Plain Error code 'invalid-license'. It only triggers for apps explicitly flagged enterprise-only.
Source
Thrown at apps/meteor/ee/server/lib/license/canEnableApp.ts:43
throw new Error('app-addon-not-valid');
}
const source = getInstallationSourceFromAppStorageItem(app);
switch (source) {
case 'private':
if (await License.shouldPreventAction('privateApps')) {
throw new Error('license-prevented');
}
break;
default:
if (await License.shouldPreventAction('marketplaceApps')) {
throw new Error('license-prevented');
}
const marketplaceInfo = app.marketplaceInfo?.[0];
if (marketplaceInfo?.isEnterpriseOnly && !License.hasValidLicense()) {
throw new Error('invalid-license');
}
break;
}
};
export const canEnableApp = async (app: IAppStorageItem): Promise<void> => _canEnableApp({ Apps, License }, app);
View on GitHub (pinned to f9d3ec372b)
Solutions
- Apply a valid enterprise license and retry.
- Resolve whatever invalidates the license (clock sync, connectivity to the license service, renewal).
- Install a non-enterprise alternative app if one exists.
Example fix
// before
await canEnableApp(app); // isEnterpriseOnly + no valid license -> throws
// after
if (marketplaceInfo?.isEnterpriseOnly && !License.hasValidLicense()) {
return informAdmin('Apply a valid enterprise license to enable this app');
} Defensive patterns
Strategy: validation
Validate before calling
async function canEnableEnterpriseApp(app: IAppStorageItem): Promise<boolean> {
const mi = app.marketplaceInfo?.[0];
return !mi?.isEnterpriseOnly || License.hasValidLicense();
} Type guard
const isEnterpriseOnly = (app: IAppStorageItem): boolean => Boolean(app.marketplaceInfo?.[0]?.isEnterpriseOnly);
Try / catch
try { await canEnableApp(app); } catch (e) {
if (e instanceof Error && e.message === 'invalid-license') { /* apply/renew enterprise license, then retry */ } else throw e;
} Prevention
- Check License.hasValidLicense() before enabling enterprise-only apps.
- Monitor license expiry and warn admins before lapse.
- Sync server clock to avoid false invalid-license results.
When it happens
Trigger: Enabling an enterprise-only marketplace app on a server with no valid license (expired, missing, or invalid); license lapsed after an enterprise-only app was already installed but is being re-enabled.
Common situations: Trial/expired license; license validation failing due to offline server / clock skew; reinstalling an enterprise-only app after the license expired.
Related errors
- app-addon-not-valid
- license-prevented
- Invalid response from API
- App not found
- Failed to build external url
AI-assisted analysis of RocketChat/Rocket.Chat@f9d3ec372b (2026-08-12).
Data as JSON: /api/errors/7f117fae27ca041a.
Report an issue: GitHub.