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
- Do not offer or invoke cloud flows on offline-licensed workspaces — disable or hide the registration UI paths.
- If cloud connectivity is actually required, apply a license that permits it instead of the offline license.
- 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
- Gate all cloud-related UI and scripts behind License.hasOfflineLicense() so the guard is never hit in production.
- Use assertNotOfflineLicense only for interactive flows; background jobs should check the flag and skip silently.
- Document which license types disable cloud connectivity so admins pick licenses matching their deployment.
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
- restricted-workspace
- Failed to connect to Rocket.Chat Cloud: ${error}
- Failed to connect to Rocket.Chat Cloud: ${response.statusTex
- Invalid registration token
- error-invalid-state
AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18).
Data as JSON: /api/errors/b8bb12158333918b.
Report an issue: GitHub.