calesthio/OpenMontage · error · RuntimeError

Ark query returned no response

Error message

Ark query returned no response

What it means

RuntimeError raised after the _query_task retry loop finishes with response still None. In the loop, a retryable status (429 or 5xx) followed by 'continue' consumes attempts; the loop can only exit with response unset if every iteration hit the retryable-status continue path without ever reaching _raise_for_status or the break — practically, when retries are exhausted on retryable statuses or an iteration pattern leaves the loop via loop exhaustion. It means the task status query never obtained a usable HTTP response object.

Source

Thrown at tools/video/seedance_ark.py:1291

                response = requests.get(
                    url,
                    headers=self._headers(api_key),
                    timeout=30,
                )
                retryable_status = (
                    response.status_code == 429 or response.status_code >= 500
                )
                if retryable_status and attempt < self.retry_policy.max_retries:
                    time.sleep(self.retry_policy.backoff_seconds * (2**attempt))
                    continue
                self._raise_for_status(response)
                break
            except requests.RequestException:
                if attempt >= self.retry_policy.max_retries:
                    raise
                time.sleep(self.retry_policy.backoff_seconds * (2**attempt))
        if response is None:
            raise RuntimeError("Ark query returned no response")
        data = response.json()
        if not isinstance(data, dict):
            raise RuntimeError("Ark query returned a non-object response")
        return data

    def _cancel_task(self, task_id: str, api_key: str) -> None:
        import requests

        response = requests.delete(
            f"{self._get_base_url()}/contents/generations/tasks/{task_id}",
            headers=self._headers(api_key),
            timeout=30,
        )
        # The official DELETE success body is undefined and may be empty.
        self._raise_for_status(response)

    def _poll_task(
        self,

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Back off and retry the whole operation after a pause — this usually indicates transient upstream load, not a bad request.
  2. Increase retry_policy.backoff_seconds and/or max_retries so exponential backoff outlasts the rate-limit window.
  3. Lengthen poll_interval_seconds to reduce query pressure when many tasks run concurrently.
  4. Check Ark/Volcengine status pages and your account quota if 429/5xx persists.

Example fix

# before
retry = RetryPolicy(max_retries=1, backoff_seconds=1)

# after
retry = RetryPolicy(max_retries=5, backoff_seconds=5)
Defensive patterns

Strategy: retry

Try / catch

try:
    result = tool.run(inputs)
except RuntimeError as e:
    if "no response" in str(e):
        time.sleep(60)
        result = tool.run(inputs)  # upstream was rate-limiting/degraded
    else:
        raise

Prevention

When it happens

Trigger: Sustained 429 rate limiting or repeated 5xx responses from the Ark task-query endpoint across all retry attempts; combined with retry_policy.max_retries set such that each attempt falls into the 'retryable_status and attempt < max_retries' continue branch until the for-loop ends without break.

Common situations: Aggressive polling loops hammering the query endpoint, a degraded Ark region returning 502/503 for minutes, or API-key quota exhaustion manifesting as persistent 429s.

Related errors


AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15). Data as JSON: /api/errors/b54d87565fd3b9ad. Report an issue: GitHub.