BerriAI/litellm · error · ValueError

Unknown RunwayML task status: {status}

Error message

Unknown RunwayML task status: {status}

What it means

Status-mapping fallback in RunwayML normalization: the task reported a status outside SUCCEEDED/FAILED/CANCELLED (new or unexpected state), so LiteLLM cannot map it and raises with the raw status string.

Source

Thrown at litellm/llms/runwayml/image_generation/transformation.py:186

        Raises:
            ValueError: If task failed or status is unknown
        """
        status: Final = response_data.get("status", "").upper()

        verbose_logger.debug("RunwayML task status: %s", status)

        if status == "SUCCEEDED":
            return "succeeded"
        elif status == "FAILED":
            failure_reason: Final = response_data.get("failure", "Unknown error")
            failure_code: Final = response_data.get("failureCode", "unknown")
            raise ValueError(f"RunwayML image generation failed: {failure_reason} (code: {failure_code})")
        elif status == "CANCELLED":
            raise ValueError("RunwayML image generation was cancelled")
        elif status in ["PENDING", "RUNNING", "THROTTLED"]:
            return "running"
        else:
            raise ValueError(f"Unknown RunwayML task status: {status}")

    def _poll_task_sync(
        self,
        task_id: str,
        api_base: str,
        headers: dict[str, str],
        timeout_secs: float = 600,
    ) -> httpx.Response:
        """
        Poll RunwayML task until completion (sync).

        RunwayML POST returns immediately with a task that has status PENDING/RUNNING.
        We need to poll GET /v1/tasks/{task_id} until status is SUCCEEDED or FAILED.

        Args:
            task_id: The task ID to poll
            api_base: Base URL for RunwayML API
            headers: Request headers (including auth)

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. The task returned an unrecognized status; check RunwayML API changelog for new statuses.
  2. Upgrade litellm if a newer version handles the status.

Example fix

pip install -U litellm
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Triggered when a RunwayML image generation task reports an unrecognized status value.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/b0c95d64b0eab3c5. Report an issue: GitHub.