{"record":{"id":"b91fb6f35765f99b","repo":"iflytek/astron-agent","slug":"21600-unsupported-e2b-code-language-language","errorCode":"21600","errorMessage":"Unsupported E2B code language: {language}","messagePattern":"Unsupported E2B code language: (.+?)","errorType":"error_code","errorClass":"CustomException","httpStatus":null,"severity":"error","filePath":"core/workflow/engine/nodes/code/executor/e2b/e2b_executor.py","lineNumber":452,"sourceCode":"            MAX_SANDBOX_COMMAND_OUTPUT_BYTES,\n            min(max(timeout_seconds, 1), 60),\n        )\n        return (\n            int(getattr(result, \"exit_code\", 0) or 0),\n            _decode_bounded_output(stdout_bytes, stdout_truncated),\n            _decode_bounded_output(stderr_bytes, stderr_truncated),\n        )\n    finally:\n        for output_path in (stdout_path, stderr_path):\n            try:\n                await sandbox.files.remove(output_path, user=\"root\")\n            except Exception:\n                pass\n\n\ndef _require_sandbox_config(language: str, value: Any) -> dict[str, Any]:\n    if language != \"python\":\n        raise CustomException(\n            err_code=CodeEnum.CODE_EXECUTION_ERROR,\n            err_msg=f\"Unsupported E2B code language: {language}\",\n        )\n    if not isinstance(value, dict):\n        raise CustomException(\n            err_code=CodeEnum.CODE_EXECUTION_ERROR,\n            err_msg=SANDBOX_RUNTIME_CONFIG_ERROR,\n        )\n    return value\n\n\nasync def _create_e2b_sandbox(sandbox_config: dict[str, Any]) -> tuple[Any, int]:\n    from e2b import AsyncSandbox\n\n    try:\n        api_key, execution_timeout, allow_internet_access = (\n            await _fetch_e2b_runtime_config(sandbox_config)\n        )","sourceCodeStart":434,"sourceCodeEnd":470,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/engine/nodes/code/executor/e2b/e2b_executor.py#L434-L470","documentation":"_require_sandbox_config validates the language argument of the E2B executor before sandbox creation; only 'python' is supported. Any other language raises CustomException code 21600 (CODE_EXECUTION_ERROR) with the unsupported language name.","triggerScenarios":"Calling execute() on the E2B executor with language values like 'javascript', 'js', 'python3', 'PY', or a node misconfigured to a non-Python language.","commonSituations":"Workflow node language dropdown set to JS while executor backend is E2B (which this build restricts to Python); case mismatch like 'Python'.","solutions":["Set the code node's language to exactly 'python' when using the E2B executor.","If JS execution is required, choose an executor branch that supports it or extend _require_sandbox_config with explicit support for additional E2B languages.","Normalize language strings at node-configuration load time (lowercase, canonical aliases) to avoid 'python3'/'Python' variants."],"exampleFix":"// before\nawait executor.execute(\"javascript\", code, config)\n// after\nawait executor.execute(\"python\", code, config)","handlingStrategy":"type-guard","validationCode":"LANGS = {\"python\"}\nassert language in LANGS, f\"E2B executor supports {sorted(LANGS)} only, got {language!r}\"","typeGuard":"def is_supported_language(lang: object) -> bool:\n    return isinstance(lang, str) and lang == \"python\"","tryCatchPattern":"try:\n    out = ex.execute(language, code, cfg)\nexcept CustomException as e:\n    if e.err_code == 21600 and \"language\" in e.err_msg: route to a language-capable executor or reject the node run","preventionTips":["Restrict the node UI language options to what the selected executor supports","Normalize language names to canonical lowercase values at config load","Add per-executor capability metadata checked before execution"],"tags":["validation","sandbox","unsupported-language"],"backgroundTag":"unsupported-enum-value","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}