{"record":{"id":"e4c0e7f376d55d72","repo":"BerriAI/litellm","slug":"invalid-authentication-configuration-no-valid-cre","errorCode":null,"errorMessage":"Invalid authentication configuration: no valid credentials found. ","messagePattern":"Invalid authentication configuration: no valid credentials found\\. ","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/sap/credentials.py","lineNumber":468,"sourceCode":"                    f.write(cert_str_fixed)\n                with open(key_path, \"w\") as f:\n                    f.write(key_str_fixed)\n                return _request_token(\n                    auth_url=auth_url,\n                    client_id=client_id,\n                    timeout=timeout,\n                    cert_pair=(cert_path, key_path),\n                )\n        # Case 3: file-based cert/key\n        if cert_file_path is not None and key_file_path is not None:\n            return _request_token(\n                auth_url=auth_url,\n                client_id=client_id,\n                timeout=timeout,\n                cert_pair=(cert_file_path, key_file_path),\n            )\n        # Defensive guard: should never reach here due to validate_credentials()\n        raise ValueError(\"Invalid authentication configuration: no valid credentials found. \")\n\n    def get_token() -> str:\n        nonlocal token, token_expiry\n        with lock:\n            now: Final = datetime.now(timezone.utc)\n            if token is None or token_expiry is None or token_expiry - now < timedelta(minutes=expiry_buffer_minutes):\n                token, token_expiry = _fetch_token()\n            return token\n\n    return get_token, credentials[\"base_url\"], credentials[\"resource_group\"]\n","sourceCodeStart":450,"sourceCodeEnd":479,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/sap/credentials.py#L450-L479","documentation":"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.","triggerScenarios":"Triggered when the SAP authentication configuration has no valid credentials.","commonSituations":"See trigger scenarios.","solutions":["Provide valid SAP AI Core credentials via env vars or config file.","Check that all required credential fields are set and well-formed."],"exampleFix":"# set AICORE_CLIENT_ID/AICORE_CLIENT_SECRET and related env vars.","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"}