BerriAI/litellm · error · ValueError
secret {secret_name} not found in Google Secret Manager. Err
Error message
secret {secret_name} not found in Google Secret Manager. Error: {response.text} What it means
Raised when the Google Secret Manager REST access call for a secret returns a non-success status — typically 404/403 for a missing secret or missing IAM permission. The API error body is appended to identify which case occurred.
Source
Thrown at litellm/secret_managers/google_secret_manager.py:80
"""
if self.always_read_secret_manager is not True:
cached_secret: Final = self.cache.get_cache(secret_name)
if cached_secret is not None:
return cached_secret
if secret_name in self.cache.cache_dict:
return cached_secret
_secret_name: Final = f"projects/{self.PROJECT_ID}/secrets/{secret_name}/versions/latest"
headers: Final = self.sync_construct_request_headers()
url: Final = f"https://secretmanager.googleapis.com/v1/{_secret_name}:access"
# Send the GET request to retrieve the secret
response: Final = self.sync_httpx_client.get(url=url, headers=headers)
if response.status_code != 200:
verbose_logger.error("Google Secret Manager retrieval error: %s", str(response.text))
self.cache.set_cache(secret_name, None) # Cache that the secret was not found
raise ValueError(f"secret {secret_name} not found in Google Secret Manager. Error: {response.text}")
verbose_logger.debug(
"Google Secret Manager retrieval response status code: %s",
response.status_code,
)
# Parse the JSON response and return the secret value
secret_data: Final = response.json()
_base64_encoded_value: Final = secret_data.get("payload", {}).get("data")
# decode the base64 encoded value
if _base64_encoded_value is not None:
_decoded_value: Final = base64.b64decode(_base64_encoded_value).decode("utf-8")
self.cache.set_cache(secret_name, _decoded_value) # Cache the retrieved secret
return _decoded_value
self.cache.set_cache(secret_name, None) # Cache that the secret was not found
raise ValueError(f"secret {secret_name} not found in Google Secret Manager")View on GitHub (pinned to 77b7c6c40c)
Solutions
- Confirm secret {secret_name} exists in the project and the service account has secretmanager.secretAccessor.
- Inspect response.text for the exact Google API error (404 vs 403).
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at litellm/secret_managers/google_secret_manager.py:80 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/9ec7dda21ec31b9f.
Report an issue: GitHub.