{"record":{"id":"293e1e504fc0073b","repo":"iflytek/astron-agent","slug":"21600-no-isolated-code-executor-is-configured-the-local","errorCode":"21600","errorMessage":"No isolated code executor is configured. The local executor is disabled for security.","messagePattern":"No isolated code executor is configured\\. The local executor is disabled for security\\.","errorType":"error_code","errorClass":"CustomException","httpStatus":null,"severity":"error","filePath":"core/workflow/engine/nodes/code/executor/base_executor.py","lineNumber":52,"sourceCode":"class CodeExecutorFactory:\n    \"\"\"\n    Factory class for creating code executors.\n\n    Provides a centralized way to instantiate different types of code executors\n    based on configuration or runtime requirements.\n    \"\"\"\n\n    @staticmethod\n    def create_executor(executor: str) -> BaseExecutor:\n        \"\"\"\n        Create a code executor instance based on the specified type.\n\n        :param executor: Executor type identifier (\"langchain\", \"ifly\", \"ifly-v2\", or \"e2b\")\n        :return: Configured executor instance\n        :raises Exception: If the specified executor type is not supported\n        \"\"\"\n        if executor in {\"\", \"disabled\", \"local\"}:\n            raise CustomException(\n                err_code=CodeEnum.CODE_EXECUTION_ERROR,\n                err_msg=(\n                    \"No isolated code executor is configured. \"\n                    \"The local executor is disabled for security.\"\n                ),\n            )\n        elif executor == \"langchain\":\n            # Langchain sandbox execution environment\n            from workflow.engine.nodes.code.executor.langchain.langchain_executor import (\n                LangchainExecutor,\n            )\n\n            return LangchainExecutor()\n        elif executor == \"ifly\":\n            # IFly remote execution service\n            from workflow.engine.nodes.code.executor.ifly.ifly_executor import (\n                IFlyExecutor,\n            )","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/engine/nodes/code/executor/base_executor.py#L34-L70","documentation":"The executor factory create_executor in base_executor.py rejects executor identifiers \"\", \"disabled\", and \"local\", raising CODE_EXECUTION_ERROR (21600) because in-process local code execution is disabled for security. All user code must run in an isolated sandbox (e.g. E2B), so requesting the local executor is always a hard configuration error.","triggerScenarios":"Calling create_executor with executor='local' (legacy configs), an empty CODE_EXEC_TYPE, or 'disabled'; legacy workflows/migrations still referencing the removed local executor; defaults pointing at the deprecated local executor after an upgrade.","commonSituations":"Upgrading from a version where local execution was allowed; env files copied from old deployments; documentation/examples referencing CODE_EXEC_TYPE=local; infrastructure where the sandbox env vars were never provisioned so the code falls back to 'local'/'disabled'.","solutions":["Set the executor to an isolated type, e.g. `export CODE_EXEC_TYPE=e2b`, and configure the sandbox (E2B API key/endpoint).","Grep deployment configs (docker/.env, helm values) for CODE_EXEC_TYPE=local|disabled and replace them.","If this call comes from your own code, pass a supported executor identifier ('langchain', 'ifly', 'ifly-v2', 'e2b').","Update old workflow templates that implicitly relied on local execution.","Redeploy and run a test code node to confirm the sandbox executor initializes."],"exampleFix":"# before\nexecutor = create_executor(\"local\")\n\n# after\nexecutor = create_executor(os.getenv(\"CODE_EXEC_TYPE\", \"e2b\"))","handlingStrategy":"validation","validationCode":"exec_type = os.getenv(\"CODE_EXEC_TYPE\", \"\")\nif exec_type.strip().lower() in {\"\", \"disabled\", \"local\"}:\n    raise ValueError(\"CODE_EXEC_TYPE must be an isolated executor (e.g. e2b); local is disabled\")","typeGuard":"def is_allowed_executor(v: str) -> bool:\n    return v.strip().lower() not in {\"\", \"disabled\", \"local\"}","tryCatchPattern":"try:\n    executor = create_executor(requested)\nexcept CustomException as e:\n    if e.err_code == CodeEnum.CODE_EXECUTION_ERROR and \"local executor is disabled\" in (e.err_msg or \"\"):\n        executor = create_executor(\"e2b\")  # fallback to configured sandbox\n    else:\n        raise","preventionTips":["Remove legacy CODE_EXEC_TYPE=local entries from all env files","Use create_executor only with supported identifiers ('langchain','ifly','ifly-v2','e2b')","After upgrades, audit code-execution configs for removed executor types","Provision sandbox credentials as part of standard deployment"],"tags":["config","sandbox","security","code-execution","deprecated"],"backgroundTag":"invalid-config-value","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}