RocketChat/Rocket.Chat · warning

App could not be enabled

Error message

App could not be enabled

What it means

Logged by the Enterprise Apps orchestrator during startup when enabling an installed app fails. Each app first passes canEnableApp() (a license gate in ee/server/lib/license/canEnableApp.ts that rejects with 'apps-engine-not-initialized', 'app-addon-not-valid', 'license-prevented', or 'invalid-license') and then manager.loadOne(id, true). The per-app try/catch keeps one failing app from blocking the rest, so only that app stays disabled; the real reason is in the log entry's err field.

Source

Thrown at apps/meteor/ee/server/apps/orchestrator.ts:251

		// Don't try to load it again if it has
		// already been loaded
		if (this.isLoaded()) {
			return;
		}

		await this.getManager().load();

		// Before enabling each app we verify if there is still room for it
		const apps = await this.getManager().get();

		// This needs to happen sequentially to keep track of app limits
		for (const app of apps) {
			try {
				await canEnableApp(app.getStorageItem());

				await this.getManager().loadOne(app.getID(), true);
			} catch (error) {
				this._rocketchatLogger.warn({
					msg: 'App could not be enabled',
					appName: app.getInfo().name,
					err: error,
				});
			}
		}

		await this._bridges.getSchedulerBridge().startScheduler();

		const appCount = (await this.getManager().get({ enabled: true })).length;

		this._rocketchatLogger.info({
			msg: 'Loaded the Apps Framework and apps',
			appCount,
		});
	}

	async migratePrivateApps(): Promise<void> {

View on GitHub (pinned to b2c16d5842)

Solutions

  1. Read the err field of the log entry — 'license-prevented' means app-count entitlement was exceeded, 'invalid-license'/'app-addon-not-valid' mean licensing, anything else is a load failure
  2. For license errors: uninstall or disable apps until under the entitled private/marketplace app limits, or apply a license that covers them
  3. For load errors: update or remove the app whose appName appears in the log; check its compatibility with the server's apps-engine version
  4. Restart the server — the orchestrator retries enabling all apps on every start
Defensive patterns

Strategy: try-catch

Validate before calling

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

// before enabling, confirm the entitlement path that canEnableApp checks
async function canSafelyEnableApp(app: { migrated?: boolean; info: { addon?: string } }): Promise<boolean> {
	if (app.migrated) return true;
	if (app.info.addon && !(await License.hasModule(app.info.addon as never))) return false;
	return !(await License.shouldPreventAction('marketplaceApps'));
}

Try / catch

for (const app of apps) {
	try {
		await canEnableApp(app.getStorageItem());
		await manager.loadOne(app.getID(), true);
	} catch (error) {
		// log with the app id AND the error; keep other apps enabling
		logger.warn({ msg: 'App could not be enabled', appId: app.getID(), err: error });
	}
}

Prevention

When it happens

Trigger: Startup enable loop hitting: (1) License.shouldPreventAction('privateApps'|'marketplaceApps') true — more apps installed than the license entitlement allows (private vs marketplace apps are counted separately); (2) an app whose info.addon module is not in the license ('app-addon-not-valid'); (3) a marketplace app flagged isEnterpriseOnly with no valid license ('invalid-license'); (4) loadOne throwing because the app package is incompatible with the installed apps-engine version or throws during its own initialization.

Common situations: Workspace downgraded/expired its Enterprise license while more apps than entitled remain installed; installing enterprise-only marketplace apps on a community license; apps built for a newer apps-engine after a server downgrade; Apps engine not fully initialized when the orchestrator ran.

Related errors


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