{"record":{"id":"fb9c3eadd929e98c","repo":"BerriAI/litellm","slug":"missing-required-environment-variable-google-app","errorCode":null,"errorMessage":"Missing required environment variable - GOOGLE_APPLICATION_CREDENTIALS","messagePattern":"Missing required environment variable - GOOGLE_APPLICATION_CREDENTIALS","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/secret_managers/google_kms.py","lineNumber":20,"sourceCode":"This is a file for the Google KMS integration\n\nRelevant issue: https://github.com/BerriAI/litellm/issues/1235\n\nRequires:\n* `os.environ[\"GOOGLE_APPLICATION_CREDENTIALS\"], os.environ[\"GOOGLE_KMS_RESOURCE_NAME\"]`\n* `pip install google-cloud-kms`\n\"\"\"\n\nimport os\nfrom typing import Final\n\nimport litellm\nfrom litellm.proxy._types import KeyManagementSystem\n\n\ndef validate_environment():\n    if \"GOOGLE_APPLICATION_CREDENTIALS\" not in os.environ:\n        raise ValueError(\"Missing required environment variable - GOOGLE_APPLICATION_CREDENTIALS\")\n    if \"GOOGLE_KMS_RESOURCE_NAME\" not in os.environ:\n        raise ValueError(\"Missing required environment variable - GOOGLE_KMS_RESOURCE_NAME\")\n\n\ndef load_google_kms(use_google_kms: bool | None):\n    if use_google_kms is None or use_google_kms is False:\n        return\n    try:\n        from google.cloud import kms_v1\n\n        validate_environment()\n\n        # Create the KMS client\n        client: Final = kms_v1.KeyManagementServiceClient()\n        litellm.secret_manager_client = client\n        litellm._key_management_system = KeyManagementSystem.GOOGLE_KMS\n        litellm._google_kms_resource_name = os.getenv(\"GOOGLE_KMS_RESOURCE_NAME\")\n    except Exception as e:","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/secret_managers/google_kms.py#L2-L38","documentation":"First environment check in the Google KMS integration's validate_environment: GOOGLE_APPLICATION_CREDENTIALS is not set, so the Google KMS client cannot authenticate. Set the service-account credentials file path before using Google KMS decryption.","triggerScenarios":"Thrown at litellm/secret_managers/google_kms.py:20 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set GOOGLE_APPLICATION_CREDENTIALS to the path of a valid service-account JSON key.","Or run on GCP with application default credentials available."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}