BerriAI/litellm · error · ValueError
Invalid authentication configuration: no valid credentials f
Error message
Invalid authentication configuration: no valid credentials found.
What it means
Token acquisition fallback: none of the configured authentication paths (client secret, inline cert/key, file-based cert/key) produced valid credentials, so the authentication configuration as a whole is invalid and no token is requested.
Source
Thrown at litellm/llms/sap/credentials.py:468
f.write(cert_str_fixed)
with open(key_path, "w") as f:
f.write(key_str_fixed)
return _request_token(
auth_url=auth_url,
client_id=client_id,
timeout=timeout,
cert_pair=(cert_path, key_path),
)
# Case 3: file-based cert/key
if cert_file_path is not None and key_file_path is not None:
return _request_token(
auth_url=auth_url,
client_id=client_id,
timeout=timeout,
cert_pair=(cert_file_path, key_file_path),
)
# Defensive guard: should never reach here due to validate_credentials()
raise ValueError("Invalid authentication configuration: no valid credentials found. ")
def get_token() -> str:
nonlocal token, token_expiry
with lock:
now: Final = datetime.now(timezone.utc)
if token is None or token_expiry is None or token_expiry - now < timedelta(minutes=expiry_buffer_minutes):
token, token_expiry = _fetch_token()
return token
return get_token, credentials["base_url"], credentials["resource_group"]
View on GitHub (pinned to 77b7c6c40c)
Solutions
- Provide valid SAP AI Core credentials via env vars or config file.
- Check that all required credential fields are set and well-formed.
Example fix
# set AICORE_CLIENT_ID/AICORE_CLIENT_SECRET and related env vars.
Defensive patterns
Strategy: validation
When it happens
Trigger: Triggered when the SAP authentication configuration has no valid credentials.
Common situations: See trigger scenarios.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/e4c0e7f376d55d72.
Report an issue: GitHub.