{"record":{"id":"170ce6aaa1536d1d","repo":"BerriAI/litellm","slug":"google-secret-manager-requires-a-project-id-pleas","errorCode":null,"errorMessage":"Google Secret Manager requires a project ID, please set 'GOOGLE_SECRET_MANAGER_PROJECT_ID' in your .env","messagePattern":"Google Secret Manager requires a project ID, please set 'GOOGLE_SECRET_MANAGER_PROJECT_ID' in your \\.env","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/secret_managers/google_secret_manager.py","lineNumber":34,"sourceCode":"        self,\n        refresh_interval: int | None = SECRET_MANAGER_REFRESH_INTERVAL,\n        always_read_secret_manager: bool | None = False,\n    ) -> None:\n        \"\"\"\n        Args:\n            refresh_interval (int, optional): The refresh interval in seconds. Defaults to 86400. (24 hours)\n            always_read_secret_manager (bool, optional): Whether to always read from the secret manager. Defaults to False. Since we do want to cache values\n        \"\"\"\n        from litellm.proxy.proxy_server import premium_user\n\n        if premium_user is not True:\n            raise ValueError(\n                f\"Google Secret Manager requires an Enterprise License {CommonProxyErrors.not_premium_user.value}\"\n            )\n        super().__init__()\n        self.PROJECT_ID = os.environ.get(\"GOOGLE_SECRET_MANAGER_PROJECT_ID\", None)\n        if self.PROJECT_ID is None:\n            raise ValueError(\n                \"Google Secret Manager requires a project ID, please set 'GOOGLE_SECRET_MANAGER_PROJECT_ID' in your .env\"\n            )\n        self.sync_httpx_client = _get_httpx_client()\n        litellm.secret_manager_client = self\n        litellm._key_management_system = KeyManagementSystem.GOOGLE_SECRET_MANAGER\n        _refresh_interval = os.environ.get(\"GOOGLE_SECRET_MANAGER_REFRESH_INTERVAL\", refresh_interval)\n        _refresh_interval = int(_refresh_interval) if _refresh_interval else refresh_interval\n        self.cache = InMemoryCache(default_ttl=_refresh_interval)  # store in memory for 1 day\n\n        _always_read_secret_manager: Final = os.environ.get(\n            \"GOOGLE_SECRET_MANAGER_ALWAYS_READ_SECRET_MANAGER\",\n        )\n        if _always_read_secret_manager and _always_read_secret_manager.lower() == \"true\":\n            self.always_read_secret_manager = True\n        else:\n            # by default this should be False, we want to use in memory caching for this. It's a bad idea to fetch from secret manager for all requests\n            self.always_read_secret_manager = always_read_secret_manager or False\n","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/secret_managers/google_secret_manager.py#L16-L52","documentation":"Configuration check in GoogleSecretManager.__init__ after the enterprise-license gate: no project ID could be resolved. Google Secret Manager is project-scoped, so the manager requires GOOGLE_SECRET_MANAGER_PROJECT_ID (typically in .env) to know which project to read secrets from.","triggerScenarios":"Thrown at litellm/secret_managers/google_secret_manager.py:34 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set GOOGLE_SECRET_MANAGER_PROJECT_ID in the environment or .env to your GCP project id."],"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"}