RocketChat/Rocket.Chat · error · CloudOfflineLicenseError

Cloud connectivity is disabled by the offline license applie

Error message

Cloud connectivity is disabled by the offline license applied to this workspace

What it means

assertNotOfflineLicense() guards every interactive cloud flow (registration, OAuth, billing): when the workspace runs under an offline/air-gapped license (License.hasOfflineLicense() === true), it throws CloudOfflineLicenseError. The license itself forbids cloud connectivity; background jobs are expected to check the flag themselves and skip silently instead of calling this guard.

Source

Thrown at apps/meteor/server/lib/cloud/offlineLicense.ts:11

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

import { CloudOfflineLicenseError } from '../../../lib/errors/CloudOfflineLicenseError';

/**
 * Guard for interactive cloud flows (registration, OAuth, billing). Background
 * jobs should instead skip silently by checking {@link License.hasOfflineLicense}.
 */
export function assertNotOfflineLicense(): void {
	if (License.hasOfflineLicense()) {
		throw new CloudOfflineLicenseError('Cloud connectivity is disabled by the offline license applied to this workspace');
	}
}

View on GitHub (pinned to b2c16d5842)

Solutions

  1. Do not offer or invoke cloud flows on offline-licensed workspaces — disable or hide the registration UI paths.
  2. If cloud connectivity is actually required, apply a license that permits it instead of the offline license.
  3. In background jobs, branch on License.hasOfflineLicense() and skip cloud calls silently.

Example fix

// before
await finishOAuthAuthorization(code, state);

// after
import { License } from '@rocket.chat/license';
if (!License.hasOfflineLicense()) {
  await finishOAuthAuthorization(code, state);
}
Defensive patterns

Strategy: type-guard

Validate before calling

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

if (License.hasOfflineLicense()) {
  // offline-licensed workspace: skip cloud flows instead of calling them
  return;
}
await Meteor.callAsync('cloud:connectWorkspace', token);

Type guard

const cloudFlowsAllowed = (): boolean => !License.hasOfflineLicense();

Try / catch

import { CloudOfflineLicenseError } from '<lib/errors>';

try {
  await finishOAuthAuthorization(code, state);
} catch (e) {
  if (e instanceof CloudOfflineLicenseError) {
    // expected on offline deployments: hide cloud UI and skip — no retry will help
  }
  throw e;
}

Prevention

When it happens

Trigger: Any attempt to run cloud:connectWorkspace, finishOAuthAuthorization, or other guarded cloud flows on a workspace whose applied license is an offline license.

Common situations: Air-gapped enterprise deployments with an offline license; admin tooling or scripts calling cloud methods although the deployment is deliberately offline; setup wizard flows invoked by mistake on such installs.

Related errors


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