RocketChat/Rocket.Chat · error · Error

license-prevented

license-prevented

Error message

license-prevented

What it means

Thrown by _canEnableApp when the app's installation source resolves to 'private' and License.shouldPreventAction('privateApps') is true — the license does not permit private (non-marketplace) apps. Plain Error code 'license-prevented'. Same code as error 235 but distinct branch (private vs default/marketplace).

Source

Thrown at apps/meteor/ee/server/lib/license/canEnableApp.ts:32

	if (!(await Apps.isInitialized())) {
		throw new Error('apps-engine-not-initialized');
	}

	// Migrated apps were installed before the validation was implemented
	// so they're always allowed to be enabled
	if (app.migrated) {
		return;
	}

	if (app.info.addon && !License.hasModule(app.info.addon as LicenseModule)) {
		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

  1. Upgrade to a license that allows private apps.
  2. Install an equivalent app from the marketplace instead, if one exists.
  3. Disable the private-app restriction in the license terms (requires license change).

Example fix

// before
const source = getInstallationSourceFromAppStorageItem(app); // 'private'
await canEnableApp(app); // throws license-prevented

// after: gate the UI/API on entitlement
if (await License.shouldPreventAction('privateApps')) {
  return informAdmin('This license does not allow private apps');
}
Defensive patterns

Strategy: validation

Validate before calling

async function canEnablePrivateApp(): Promise<boolean> {
  return !(await License.shouldPreventAction('privateApps'));
}

Type guard

const isPrivateSource = (app: IAppStorageItem): boolean =>
  getInstallationSourceFromAppStorageItem(app) === 'private';

Try / catch

try { await canEnableApp(app); } catch (e) {
  if (e instanceof Error && e.message === 'license-prevented' && isPrivateSource(app)) { /* upgrade license for private apps */ } else throw e;
}

Prevention

When it happens

Trigger: Enabling a privately-installed app (uploaded directly, not from marketplace) on a license whose 'privateApps' entitlement prevents it; trial license that only allows marketplace apps.

Common situations: Customer uploaded a custom internal app but their license tier restricts to marketplace apps; license downgrade after private apps were installed.

Related errors


AI-assisted analysis of RocketChat/Rocket.Chat@f9d3ec372b (2026-08-12). Data as JSON: /api/errors/89c8d7d33a51cf0d. Report an issue: GitHub.