{"record":{"id":"9859dd95c26a288e","repo":"iflytek/astron-agent","slug":"sandbox-runtime-configuration-is-unavailable-e2b-executor","errorCode":null,"errorMessage":"Sandbox runtime configuration is unavailable","messagePattern":"Sandbox runtime configuration is unavailable","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"core/workflow/engine/nodes/code/executor/e2b/e2b_executor.py","lineNumber":204,"sourceCode":"    runtime_config_url = (os.getenv(RUNTIME_CONFIG_URL_ENV) or \"\").strip()\n    try:\n        parsed = urlsplit(runtime_config_url)\n        if (\n            not runtime_config_url\n            or len(runtime_config_url) > 2048\n            or any(char in runtime_config_url for char in (\"\\r\", \"\\n\", \"\\t\"))\n            or parsed.scheme not in {\"http\", \"https\"}\n            or not parsed.hostname\n            or parsed.username is not None\n            or parsed.password is not None\n            or parsed.path != RUNTIME_CONFIG_PATH\n            or bool(parsed.query)\n            or bool(parsed.fragment)\n        ):\n            raise ValueError\n        parsed.port\n    except (TypeError, ValueError):\n        raise RuntimeError(SANDBOX_RUNTIME_CONFIG_ERROR) from None\n    return runtime_config_url\n\n\ndef _load_runtime_credential_token() -> str:\n    token = (os.getenv(RUNTIME_CREDENTIAL_TOKEN_ENV) or \"\").strip()\n    if not token:\n        token_file = (os.getenv(RUNTIME_CREDENTIAL_TOKEN_FILE_ENV) or \"\").strip()\n        if token_file:\n            try:\n                token = Path(token_file).read_text(encoding=\"utf-8\").strip()\n            except (OSError, UnicodeError):\n                raise RuntimeError(SANDBOX_RUNTIME_CONFIG_ERROR) from None\n    if (\n        len(token) < MIN_RUNTIME_CREDENTIAL_TOKEN_LENGTH\n        or \"\\r\" in token\n        or \"\\n\" in token\n    ):\n        raise RuntimeError(SANDBOX_RUNTIME_CONFIG_ERROR)","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/engine/nodes/code/executor/e2b/e2b_executor.py#L186-L222","documentation":"_load_runtime_config_url validates the sandbox runtime-config URL the same way (parseable URL, no query/fragment, valid port). Failures raise RuntimeError(SANDBOX_RUNTIME_CONFIG_ERROR), meaning the E2B runtime configuration endpoint is not usable, which blocks sandbox creation via _fetch_e2b_runtime_config.","triggerScenarios":"RUNTIME_CONFIG_URL_ENV unset/empty or malformed (bad port, query string, fragment) when _create_e2b_sandbox triggers _fetch_e2b_runtime_config.","commonSituations":"Deployment env missing the runtime-config URL, typo in scheme/host, port range typo (e.g. :99999), URL copied with '#fragment' anchor.","solutions":["Set the runtime config URL env var to a clean absolute URL (no query/fragment) with a valid port.","Cross-check against the deployed sandbox runtime-config service address.","Redeploy/restart the workflow service after fixing the env so the value is picked up."],"exampleFix":"// before\nRUNTIME_CONFIG_URL=https://cfg.internal:8443?env=prod\n// after\nRUNTIME_CONFIG_URL=https://cfg.internal:8443","handlingStrategy":"validation","validationCode":"from urllib.parse import urlparse\nu = urlparse(os.environ.get(\"RUNTIME_CONFIG_URL\", \"\"))\nassert u.scheme in (\"http\", \"https\") and u.netloc and not u.query and not u.fragment, \"bad runtime config URL\"\n_ = u.port","typeGuard":null,"tryCatchPattern":"try:\n    sandbox = ex.create(...)\nexcept RuntimeError as e:\n    if \"runtime configuration\" in str(e): surface deployment misconfiguration; do not retry blindly","preventionTips":["Include the runtime-config URL in deploy-time config validation","Document the exact URL format expected","Restart services after env changes so values are re-read"],"tags":["config","url","sandbox"],"backgroundTag":"invalid-url-format","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"}