{"record":{"id":"b54d87565fd3b9ad","repo":"calesthio/OpenMontage","slug":"ark-query-returned-no-response","errorCode":null,"errorMessage":"Ark query returned no response","messagePattern":"Ark query returned no response","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"tools/video/seedance_ark.py","lineNumber":1291,"sourceCode":"                response = requests.get(\n                    url,\n                    headers=self._headers(api_key),\n                    timeout=30,\n                )\n                retryable_status = (\n                    response.status_code == 429 or response.status_code >= 500\n                )\n                if retryable_status and attempt < self.retry_policy.max_retries:\n                    time.sleep(self.retry_policy.backoff_seconds * (2**attempt))\n                    continue\n                self._raise_for_status(response)\n                break\n            except requests.RequestException:\n                if attempt >= self.retry_policy.max_retries:\n                    raise\n                time.sleep(self.retry_policy.backoff_seconds * (2**attempt))\n        if response is None:\n            raise RuntimeError(\"Ark query returned no response\")\n        data = response.json()\n        if not isinstance(data, dict):\n            raise RuntimeError(\"Ark query returned a non-object response\")\n        return data\n\n    def _cancel_task(self, task_id: str, api_key: str) -> None:\n        import requests\n\n        response = requests.delete(\n            f\"{self._get_base_url()}/contents/generations/tasks/{task_id}\",\n            headers=self._headers(api_key),\n            timeout=30,\n        )\n        # The official DELETE success body is undefined and may be empty.\n        self._raise_for_status(response)\n\n    def _poll_task(\n        self,","sourceCodeStart":1273,"sourceCodeEnd":1309,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/seedance_ark.py#L1273-L1309","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Back off and retry the whole operation after a pause — this usually indicates transient upstream load, not a bad request.","Increase retry_policy.backoff_seconds and/or max_retries so exponential backoff outlasts the rate-limit window.","Lengthen poll_interval_seconds to reduce query pressure when many tasks run concurrently.","Check Ark/Volcengine status pages and your account quota if 429/5xx persists."],"exampleFix":"# before\nretry = RetryPolicy(max_retries=1, backoff_seconds=1)\n\n# after\nretry = RetryPolicy(max_retries=5, backoff_seconds=5)","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    result = tool.run(inputs)\nexcept RuntimeError as e:\n    if \"no response\" in str(e):\n        time.sleep(60)\n        result = tool.run(inputs)  # upstream was rate-limiting/degraded\n    else:\n        raise","preventionTips":["Use exponential backoff with enough retries to outlast 429 windows.","Keep poll_interval_seconds >= 3 to avoid self-inflicted rate limits.","Monitor Ark status and account quota before blaming the client."],"tags":["network","retry","seedance","ark","polling"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}