RocketChat/Rocket.Chat · error · Error

license-prevented

license-prevented

Error message

license-prevented

What it means

Enable guard for apps installed from a private source: License.shouldPreventAction('privateApps') returned true, meaning the license does not allow (more) enabled private apps, so enabling is blocked with 'license-prevented'.

Solutions

  1. Disable another private app to free a slot, then retry the enable
  2. Upgrade or renew the license to one that allows more private apps
  3. Check the license's privateApps limit in Administration -> License before enabling
Defensive patterns

Strategy: validation

Validate before calling

import { License } from '@rocket.chat/license';

if (await License.shouldPreventAction('privateApps')) {
	// block enable with a 'private app limit reached' notice
}
await Apps.enableApp(appId);

Try / catch

try {
	await Apps.enableApp(appId);
} catch (err) {
	if (err instanceof Error && err.message === 'license-prevented') {
		// check which counter (privateApps/marketplaceApps) is exhausted and prompt upgrade
	} else {
		throw err;
	}
}

Prevention

When it happens

Trigger: Enabling a privately-installed app (installed from a zip/private URL rather than the marketplace) when the number of enabled private apps already meets the licensed limit, or the license tier allows none.

Common situations: Community/no license where privateApps allowance is zero; expired trial; enabling more internal apps than the tier permits.

Related errors


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

Appendix: 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 b2c16d5842)