iflytek/astron-agent · error · RuntimeError

Artifact upload configuration is unavailable

Error message

Artifact upload configuration is unavailable

What it means

_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.

Solutions

  1. Set the artifact upload URL env var to an absolute, well-formed URL like https://host:port/path with no query or fragment.
  2. Validate the URL with python -c "from urllib.parse import urlparse; urlparse('...')" and confirm the port parses.
  3. Confirm the URL matches the deployed artifact-upload service endpoint.

Example fix

// before
ARTIFACT_UPLOAD_URL=https://host:abc  # invalid port
// after
ARTIFACT_UPLOAD_URL=https://artifact-upload.internal:8443
Defensive patterns

Strategy: validation

Validate before calling

from urllib.parse import urlparse
u = urlparse(os.environ.get("ARTIFACT_UPLOAD_URL", ""))
assert u.scheme in ("http", "https") and u.netloc and not u.query and not u.fragment, "bad artifact upload URL"
_ = u.port  # raises ValueError early if the port is malformed

Try / catch

try:
    ex.upload(...)
except RuntimeError as e:
    if "configuration" in str(e): fail fast with a config-error report listing the expected env vars

Prevention

When it happens

Trigger: ARTIFACT_UPLOAD_URL_ENV unset/empty, or set to a malformed URL (bad scheme, invalid port, contains '?'/'#') — checked by is_configured() and upload().

Common situations: Wrong URL pasted into env config, service DNS name not resolvable but port garbled, someone appended an access token as a query parameter.

Understand the failure class

Background: "Invalid URL" errors: why new URL(), URI.parse, and reqwest::Url reject your string — missing scheme, whitespace, and bad path format — this error's family across 39 libraries.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/b069a2111e85aa58. Report an issue: GitHub.

Appendix: source

Thrown at core/workflow/engine/nodes/code/executor/e2b/e2b_executor.py:181

    artifact_upload_url = (os.getenv(ARTIFACT_UPLOAD_URL_ENV) or "").strip()
    try:
        parsed = urlsplit(artifact_upload_url)
        if (
            not artifact_upload_url
            or len(artifact_upload_url) > 2048
            or any(char in artifact_upload_url for char in ("\r", "\n", "\t"))
            or parsed.scheme not in {"http", "https"}
            or not parsed.hostname
            or parsed.username is not None
            or parsed.password is not None
            or parsed.path != ARTIFACT_UPLOAD_PATH
            or bool(parsed.query)
            or bool(parsed.fragment)
        ):
            raise ValueError
        parsed.port
    except (TypeError, ValueError):
        raise RuntimeError(ARTIFACT_UPLOAD_CONFIG_ERROR) from None
    return artifact_upload_url


def _load_runtime_config_url() -> str:
    runtime_config_url = (os.getenv(RUNTIME_CONFIG_URL_ENV) or "").strip()
    try:
        parsed = urlsplit(runtime_config_url)
        if (
            not runtime_config_url
            or len(runtime_config_url) > 2048
            or any(char in runtime_config_url for char in ("\r", "\n", "\t"))
            or parsed.scheme not in {"http", "https"}
            or not parsed.hostname
            or parsed.username is not None
            or parsed.password is not None
            or parsed.path != RUNTIME_CONFIG_PATH
            or bool(parsed.query)
            or bool(parsed.fragment)

View on GitHub (pinned to 5e758547a8)