{"record":{"id":"61cd524c1baafaf6","repo":"RocketChat/Rocket.Chat","slug":"integration-scripts-disabled","errorCode":null,"errorMessage":"integration-scripts-disabled","messagePattern":"integration-scripts-disabled","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/lib/integrations/lib/validateScriptEngine.ts","lineNumber":9,"sourceCode":"import type { IntegrationScriptEngine } from '@rocket.chat/core-typings';\nimport { wrapExceptions } from '@rocket.chat/tools';\n\nconst FREEZE_INTEGRATION_SCRIPTS_VALUE = String(process.env.FREEZE_INTEGRATION_SCRIPTS).toLowerCase();\nconst FREEZE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(FREEZE_INTEGRATION_SCRIPTS_VALUE);\n\nexport const validateScriptEngine = (engine?: IntegrationScriptEngine) => {\n\tif (FREEZE_INTEGRATION_SCRIPTS) {\n\t\tthrow new Error('integration-scripts-disabled');\n\t}\n\n\tif (engine && engine !== 'isolated-vm') {\n\t\tthrow new Error('integration-scripts-unknown-engine');\n\t}\n\n\tconst engineCode = 'ivm';\n\n\tif (engineCode === FREEZE_INTEGRATION_SCRIPTS_VALUE) {\n\t\tthrow new Error('integration-scripts-isolated-vm-disabled');\n\t}\n\n\treturn true;\n};\n\nexport const isScriptEngineFrozen = (engine?: IntegrationScriptEngine) =>\n\twrapExceptions(() => !validateScriptEngine(engine)).catch(() => true);\n","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/integrations/lib/validateScriptEngine.ts#L1-L27","documentation":"validateScriptEngine throws this plain Error when the environment variable FREEZE_INTEGRATION_SCRIPTS is 'yes' or 'true' (case-insensitive). This deployment mode freezes integration scripting entirely — no integration may declare or run a Script — so any code path that validates a script engine (saving integrations with scripts, executing Prepare/Process scripts) aborts. The companion helper isScriptEngineFrozen() reports the state without throwing.","triggerScenarios":"Saving a new or existing integration that has a Script while the server runs with FREEZE_INTEGRATION_SCRIPTS=yes (or =true); also any server-side code calling validateScriptEngine() directly, e.g. when the trigger handler instantiates the engine for a scripted integration. Values are lowercased, so 'YES' and 'True' also trigger it.","commonSituations":"Rocket.Chat 9.x deployments where integration scripts are frozen by default (official images set the flag) after the vm2 removal; hardened/self-hosted installs opting out of script execution; upgrading a workspace that relied heavily on integration scripts.","solutions":["If scripting must stay enabled, set FREEZE_INTEGRATION_SCRIPTS=no (or unset it) in the deployment environment and restart the server","Otherwise remove the Script from the integration and move the logic into the receiving service (an external middleware that the webhook calls)","Use Apps Engine (Rocket.Chat Apps) as the supported replacement for integration scripts","Before shipping code that depends on scripts, call isScriptEngineFrozen() to branch behavior"],"exampleFix":"# before — docker-compose.yml\nenvironment:\n  - FREEZE_INTEGRATION_SCRIPTS=yes\n\n# after\nenvironment:\n  - FREEZE_INTEGRATION_SCRIPTS=no\n# then restart; or clear the Script field in Admin -> Integrations","handlingStrategy":"validation","validationCode":"import { isScriptEngineFrozen } from './validateScriptEngine';\n\nif (await isScriptEngineFrozen()) {\n  throw new Error('integration scripts are frozen (FREEZE_INTEGRATION_SCRIPTS) — do not save scripted integrations');\n}","typeGuard":null,"tryCatchPattern":"try {\n  validateScriptEngine(engine);\n} catch (err) {\n  if (err instanceof Error && err.message === 'integration-scripts-disabled') {\n    // deployment has FREEZE_INTEGRATION_SCRIPTS=yes|true; skip script features gracefully\n  } else {\n    throw err;\n  }\n}","preventionTips":["Check FREEZE_INTEGRATION_SCRIPTS during deployment review on Rocket.Chat 9+","Prefer Apps Engine or an external middleware over integration scripts for new work"],"tags":["integrations","script-engine","environment-variable","deployment"],"backgroundTag":"feature-disabled-by-env-flag","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}