BerriAI/litellm · error · AuthenticationError

GCP IAM authentication failed

Error message

GCP IAM authentication failed

What it means

Error "GCP IAM authentication failed" thrown in BerriAI/litellm.

Source

Thrown at litellm/_redis.py:201

        from redis.utils import str_if_bytes

        self._parser.on_connect(self)

        auth_args: Final = (_generate_gcp_iam_access_token(service_account),)
        self.send_command("AUTH", *auth_args, check_health=False)

        try:
            auth_response = self.read_response()
        except AuthenticationWrongNumberOfArgsError:
            # Fallback to password auth if IAM fails
            if hasattr(self, "password") and self.password:
                self.send_command("AUTH", self.password, check_health=False)
                auth_response = self.read_response()
            else:
                raise

        if str_if_bytes(auth_response) != "OK":
            raise AuthenticationError("GCP IAM authentication failed")

    return iam_connect


def _build_azure_credential(
    azure_client_id: str | None = None,
    azure_tenant_id: str | None = None,
    azure_client_secret: str | None = None,
):
    """
    Build a long-lived Azure credential object.

    Azure SDK credentials cache tokens internally and handle expiry/refresh
    transparently, so this should be called once and the result reused.
    """
    try:
        from azure.identity import (
            ClientSecretCredential,

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Verify GCP IAM credentials for Redis: ensure the service account has the redis.cloudaccess.provider role and google-cloud-iam is installed and configured.

When it happens

Trigger: Thrown at litellm/_redis.py:201 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/eb52557f006d94b2. Report an issue: GitHub.