{"record":{"id":"746d6c1cbacb1cd2","repo":"BerriAI/litellm","slug":"could-not-resolve-project-id","errorCode":null,"errorMessage":"Could not resolve project_id","messagePattern":"Could not resolve project_id","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/vertex_llm_base.py","lineNumber":193,"sourceCode":"            else:\n                creds = self._credentials_from_service_account(\n                    json_obj,\n                    scopes=[\"https://www.googleapis.com/auth/cloud-platform\"],\n                )\n\n            if project_id is None:\n                project_id = getattr(creds, \"project_id\", None)\n        else:\n            creds, creds_project_id = self._credentials_from_default_auth(\n                scopes=[\"https://www.googleapis.com/auth/cloud-platform\"]\n            )\n            if project_id is None:\n                project_id = creds_project_id\n\n        self.refresh_auth(creds)\n\n        if not project_id:\n            raise ValueError(\"Could not resolve project_id\")\n\n        if not isinstance(project_id, str):\n            raise TypeError(f\"Expected project_id to be a str but got {type(project_id)}\")\n\n        return creds, project_id\n\n    # Google Auth Helpers -- extracted for mocking purposes in tests\n    def _credentials_from_identity_pool(self, json_obj, scopes):\n        try:\n            from google.auth import identity_pool\n        except ImportError:\n            raise ImportError(GOOGLE_IMPORT_ERROR_MESSAGE)\n\n        creds = identity_pool.Credentials.from_info(json_obj)\n        if scopes and hasattr(creds, \"requires_scopes\") and creds.requires_scopes:\n            creds = creds.with_scopes(scopes)\n        return creds\n","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/vertex_llm_base.py#L175-L211","documentation":"Raised at the end of load_auth: credentials resolved, but no project_id could be determined from the argument, the service-account JSON, or Application Default Credentials — Vertex requires a project for its URLs, so auth cannot complete.","triggerScenarios":"Thrown at litellm/llms/vertex_ai/vertex_llm_base.py:193 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the project explicitly via vertex_project parameter or the VERTEXAI_PROJECT environment variable.","Ensure the credentials in use contain a project_id (service account JSON includes it)."],"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"}