{"record":{"id":"a9ae118e3c0ed2e8","repo":"BerriAI/litellm","slug":"could-not-resolve-credentials","errorCode":null,"errorMessage":"Could not resolve credentials","messagePattern":"Could not resolve credentials","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/vertex_llm_base.py","lineNumber":488,"sourceCode":"        return _TokenState.INVALID\n\n    async def _load_and_cache_credentials(\n        self,\n        credentials: VERTEX_CREDENTIALS_TYPES | None,\n        project_id: str | None,\n        credential_cache_key: tuple,\n    ) -> tuple[Any, str | None]:\n        \"\"\"Load credentials via load_auth (in thread) and cache the result.\"\"\"\n        try:\n            _credentials, credential_project_id = await asyncify(self.load_auth)(\n                credentials=credentials,\n                project_id=project_id,\n            )\n        except Exception as e:\n            verbose_logger.exception(\"Failed to load vertex credentials: %s\", str(e))\n            raise\n        if _credentials is None:\n            raise ValueError(\"Could not resolve credentials\")\n        self._credentials_project_mapping[credential_cache_key] = (\n            _credentials,\n            credential_project_id,\n        )\n        return _credentials, credential_project_id\n\n    async def _background_refresh_credentials(\n        self,\n        credentials: Any,\n        credential_cache_key: tuple,\n        credential_project_id: str | None,\n    ) -> None:\n        \"\"\"\n        Refresh credentials in the background without blocking the calling request.\n\n        Called when the token is still valid but nearing expiry (proactive refresh).\n        Errors are logged but not raised — the current token is still usable.\n        \"\"\"","sourceCodeStart":470,"sourceCodeEnd":506,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/vertex_llm_base.py#L470-L506","documentation":"Generic sentinel when the async load-and-cache credential path fails: load_auth threw (via asyncify) and no more specific error applies, so no (credentials, project_id) tuple can be produced or cached for the request.","triggerScenarios":"Thrown at litellm/llms/vertex_ai/vertex_llm_base.py:488 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide credentials via vertex_credentials, the GOOGLE_APPLICATION_CREDENTIALS env var, or a service account JSON env var.","Verify the credential source is valid and accessible (file exists, JSON parses) in the runtime environment."],"exampleFix":null,"handlingStrategy":"try-catch","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"}