BerriAI/litellm · error · AzureOpenAIError

Operation polling timed out.

Error message

Operation polling timed out.

What it means

Error "Operation polling timed out." thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/azure/azure.py:927

                headers=headers,
            )

            await response.aread()

            timeout_secs: Final[int] = AZURE_OPERATION_POLLING_TIMEOUT
            start_time: Final = time.time()
            if "status" not in response.json():
                # Don't reflect the raw response body — when the polling
                # URL points at an internal JSON API (cloud metadata
                # service etc.) reflecting it here turns Blind SSRF into
                # Full-Read SSRF. VERIA-51.
                raise AzureOpenAIError(
                    status_code=502,
                    message="Polling response missing 'status' field",
                )
            while response.json()["status"] not in ["succeeded", "failed"]:
                if time.time() - start_time > timeout_secs:
                    raise AzureOpenAIError(status_code=408, message="Operation polling timed out.")

                await asyncio.sleep(int(response.headers.get("retry-after") or 10))
                response = await async_handler.get(
                    url=operation_location_url,
                    headers=headers,
                )
                await response.aread()

            if response.json()["status"] == "failed":
                error_data: Final = response.json()
                # Preserve Azure error details (e.g. content_policy_violation,
                # inner_error, content_filter_results) as structured body so
                # exception_type() can route them correctly.
                _error_body: Final = error_data.get("error", error_data)
                _error_msg: Final = (
                    _error_body.get("message", "Image generation failed")
                    if isinstance(_error_body, dict)
                    else json.dumps(error_data)

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Increase the polling timeout or check the Azure operation status manually.

When it happens

Trigger: Thrown at litellm/llms/azure/azure.py:927 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/0bd7a870407f0abb. Report an issue: GitHub.