{"record":{"id":"b069a2111e85aa58","repo":"iflytek/astron-agent","slug":"artifact-upload-configuration-is-unavailable-e2b-executor","errorCode":null,"errorMessage":"Artifact upload configuration is unavailable","messagePattern":"Artifact upload configuration is unavailable","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"core/workflow/engine/nodes/code/executor/e2b/e2b_executor.py","lineNumber":181,"sourceCode":"    artifact_upload_url = (os.getenv(ARTIFACT_UPLOAD_URL_ENV) or \"\").strip()\n    try:\n        parsed = urlsplit(artifact_upload_url)\n        if (\n            not artifact_upload_url\n            or len(artifact_upload_url) > 2048\n            or any(char in artifact_upload_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 != ARTIFACT_UPLOAD_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(ARTIFACT_UPLOAD_CONFIG_ERROR) from None\n    return artifact_upload_url\n\n\ndef _load_runtime_config_url() -> str:\n    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)","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/engine/nodes/code/executor/e2b/e2b_executor.py#L163-L199","documentation":"_load_artifact_upload_url reads the artifact upload URL env var and validates it is a well-formed URL with no query string, fragment, and a valid port. On TypeError/ValueError from parsing it raises RuntimeError(ARTIFACT_UPLOAD_CONFIG_ERROR), meaning the artifact-upload endpoint configuration is unusable.","triggerScenarios":"ARTIFACT_UPLOAD_URL_ENV unset/empty, or set to a malformed URL (bad scheme, invalid port, contains '?'/'#') — checked by is_configured() and upload().","commonSituations":"Wrong URL pasted into env config, service DNS name not resolvable but port garbled, someone appended an access token as a query parameter.","solutions":["Set the artifact upload URL env var to an absolute, well-formed URL like https://host:port/path with no query or fragment.","Validate the URL with python -c \"from urllib.parse import urlparse; urlparse('...')\" and confirm the port parses.","Confirm the URL matches the deployed artifact-upload service endpoint."],"exampleFix":"// before\nARTIFACT_UPLOAD_URL=https://host:abc  # invalid port\n// after\nARTIFACT_UPLOAD_URL=https://artifact-upload.internal:8443","handlingStrategy":"validation","validationCode":"from urllib.parse import urlparse\nu = urlparse(os.environ.get(\"ARTIFACT_UPLOAD_URL\", \"\"))\nassert u.scheme in (\"http\", \"https\") and u.netloc and not u.query and not u.fragment, \"bad artifact upload URL\"\n_ = u.port  # raises ValueError early if the port is malformed","typeGuard":null,"tryCatchPattern":"try:\n    ex.upload(...)\nexcept RuntimeError as e:\n    if \"configuration\" in str(e): fail fast with a config-error report listing the expected env vars","preventionTips":["Store endpoint URLs without query strings/fragments","Validate all endpoint URLs in a startup config check","Use fully qualified internal DNS names"],"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"}