BerriAI/litellm · error · ValueError

HTTP error occurred: {err.response.text}

Error message

HTTP error occurred: {err.response.text}

What it means

Error-mapping handler for the async secret-creation call: the httpx request completed but raise_for_status() raised HTTPStatusError, and this re-raises the raw HTTP error body so the caller sees exactly what AWS Secrets Manager returned (e.g. InvalidParameterException payload).

Source

Thrown at litellm/secret_managers/aws_secret_manager_v2.py:308

            optional_params=optional_params,
            request_data=data,
        )

        async_client: Final = get_async_httpx_client(
            llm_provider=httpxSpecialProvider.SecretManager,
            params={"timeout": timeout},
        )

        try:
            response: Final = await async_client.post(
                url=endpoint_url,
                headers=headers,
                data=body.decode("utf-8"),
            )
            response.raise_for_status()
            create_response: Final = response.json()
        except httpx.HTTPStatusError as err:
            raise ValueError(f"HTTP error occurred: {err.response.text}")
        except httpx.TimeoutException:
            raise ValueError("Timeout error occurred")

        if self.replica_regions:
            try:
                await self.async_replicate_secret(
                    secret_name=secret_name,
                    replica_regions=self.replica_regions,
                    optional_params=optional_params,
                    timeout=timeout,
                )
                verbose_logger.debug(
                    "Replicated secret '%s' to regions: %s",
                    secret_name,
                    self.replica_regions,
                )
            except Exception as replication_err:  # noqa: BLE001
                verbose_logger.warning(

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Inspect err.response.status_code and err.response.text for the AWS-side cause (auth, permissions, throttling).
  2. Fix IAM permissions for secretsmanager/kms actions or correct the request parameters, then retry.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at litellm/secret_managers/aws_secret_manager_v2.py:308 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/136da7f93cf513fa. Report an issue: GitHub.