BerriAI/litellm · error · AzureOpenAIError

Rejected polling URL

Error message

Rejected polling URL: {ssrf_err}

What it means

Error "Rejected polling URL: {ssrf_err}" thrown in BerriAI/litellm.

Solutions

  1. The operation polling URL failed SSRF validation; ensure api_base is your trusted Azure endpoint and not a redirect to an untrusted host.

When it happens

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

Common situations: See trigger scenarios.


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

Appendix: source

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

                "model", None
            )  # REMOVE 'model' from dall-e-2 arg https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#request-a-generated-image-dall-e-2-preview
            response = await async_handler.post(
                url=api_base,
                data=json.dumps(data),
                headers=headers,
            )
            if "operation-location" in response.headers:
                operation_location_url: Final = response.headers["operation-location"]
            else:
                raise AzureOpenAIError(status_code=500, message=response.text)
            # Reject polling URLs that don't share an origin with ``api_base``.
            # Without this an upstream-controlled or attacker-controlled
            # value would receive the operator's Azure API key in the
            # request headers below. VERIA-51.
            try:
                assert_same_origin(operation_location_url, api_base)
            except SSRFError as ssrf_err:
                raise AzureOpenAIError(
                    status_code=502,
                    message=f"Rejected polling URL: {ssrf_err}",
                )
            response = await async_handler.get(
                url=operation_location_url,
                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(

View on GitHub (pinned to 77b7c6c40c)