{"record":{"id":"eb52557f006d94b2","repo":"BerriAI/litellm","slug":"gcp-iam-authentication-failed","errorCode":null,"errorMessage":"GCP IAM authentication failed","messagePattern":"GCP IAM authentication failed","errorType":"exception","errorClass":"AuthenticationError","httpStatus":null,"severity":"error","filePath":"litellm/_redis.py","lineNumber":201,"sourceCode":"        from redis.utils import str_if_bytes\n\n        self._parser.on_connect(self)\n\n        auth_args: Final = (_generate_gcp_iam_access_token(service_account),)\n        self.send_command(\"AUTH\", *auth_args, check_health=False)\n\n        try:\n            auth_response = self.read_response()\n        except AuthenticationWrongNumberOfArgsError:\n            # Fallback to password auth if IAM fails\n            if hasattr(self, \"password\") and self.password:\n                self.send_command(\"AUTH\", self.password, check_health=False)\n                auth_response = self.read_response()\n            else:\n                raise\n\n        if str_if_bytes(auth_response) != \"OK\":\n            raise AuthenticationError(\"GCP IAM authentication failed\")\n\n    return iam_connect\n\n\ndef _build_azure_credential(\n    azure_client_id: str | None = None,\n    azure_tenant_id: str | None = None,\n    azure_client_secret: str | None = None,\n):\n    \"\"\"\n    Build a long-lived Azure credential object.\n\n    Azure SDK credentials cache tokens internally and handle expiry/refresh\n    transparently, so this should be called once and the result reused.\n    \"\"\"\n    try:\n        from azure.identity import (\n            ClientSecretCredential,","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/_redis.py#L183-L219","documentation":"Error \"GCP IAM authentication failed\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/_redis.py:201 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify GCP IAM credentials for Redis: ensure the service account has the redis.cloudaccess.provider role and google-cloud-iam is installed and configured."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}