{"record":{"id":"b959104bd090c3ab","repo":"RocketChat/Rocket.Chat","slug":"restricted-workspace","errorCode":null,"errorMessage":"restricted-workspace","messagePattern":"restricted-workspace","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/ee/server/patches/airGappedRestrictionsWrapper.ts","lineNumber":7,"sourceCode":"import { AirGappedRestriction } from '@rocket.chat/license';\n\nimport { applyAirGappedRestrictionsValidation } from '../../../server/lib/cloud/license/airGappedRestrictionsWrapper';\n\napplyAirGappedRestrictionsValidation.patch(async <T>(_: any, fn: () => Promise<T>): Promise<T> => {\n\tif (AirGappedRestriction.restricted) {\n\t\tthrow new Error('restricted-workspace');\n\t}\n\treturn fn();\n});\n","sourceCodeStart":1,"sourceCodeEnd":11,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/ee/server/patches/airGappedRestrictionsWrapper.ts#L1-L11","documentation":"Thrown by the air-gapped restriction patcher whenever AirGappedRestriction.restricted is true. Rocket.Chat Enterprise wraps certain cloud-touching operations with applyAirGappedRestrictionsValidation; if the workspace is detected as air-gapped (no contact with the licensing cloud) and the restriction is active, every wrapped call is short-circuited and throws this plain Error before the real function runs.","triggerScenarios":"Invoking any function patched by applyAirGappedRestrictionsValidation while the server cannot reach the Rocket.Chat cloud and the license module has flagged the workspace as restricted.","commonSituations":"Offline/firewalled deployment whose Enterprise license requires periodic cloud validation; proxy/DNS outage blocking cloud.rocket.chat; expired or revoked air-gapped license; time skew on the server making the license appear invalid.","solutions":["Restore outbound connectivity to the Rocket.Chat cloud so the license can re-validate.","Renew or install a valid Enterprise license that permits the air-gapped mode you are running in.","Check that AirGappedRestriction.restricted is not stuck true after a transient outage (restart/reload the license module).","If the operation should be allowed offline, confirm the wrapped function is meant to be gated and contact Rocket.Chat support about your license tier."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"function isWorkspaceRestricted(): boolean {\n  return AirGappedRestriction.restricted;\n}\n// if (isWorkspaceRestricted()) surface a license/connectivity warning to admins.","typeGuard":null,"tryCatchPattern":"try {\n  await cloudWrappedOperation();\n} catch (e) {\n  if (e.message === 'restricted-workspace') {\n    // surface a 'workspace is air-gapped / license cannot validate' message\n  } else throw e;\n}","preventionTips":["Maintain outbound connectivity to the Rocket.Chat cloud for license validation.","Use a license tier that matches your deployment (offline vs online).","Monitor AirGappedRestriction.restricted and alert admins before it bites user flows.","Restart the license module after a known transient outage to clear a stuck flag."],"tags":["enterprise","license","air-gapped","cloud","restriction"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}