-
Notifications
You must be signed in to change notification settings - Fork 2k
Google Vertex AI not working with gRPC transport #1300
-
I am facing an issue when using the grpc transport for the spring.ai.vertex.ai.gemini configuration in my Spring Boot application. The error occurs as follows:
io.grpc.StatusRuntimeException: UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
at io.grpc.Status.asRuntimeException(Status.java:533) ~[grpc-api-1.62.2.jar:1.62.2]
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:538) ~[grpc-stub-1.62.2.jar:1.62.2]
at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39) ~[grpc-api-1.62.2.jar:1.62.2]
at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) ~[grpc-api-1.62.2.jar:1.62.2]
This error is encountered with the following configuration:
spring.ai.vertex.ai.gemini.project-id=${PROJECT_ID} spring.ai.vertex.ai.gemini.location=${PROJECT_ZONE} spring.ai.vertex.ai.gemini.credentials-uri=${API_KEY} spring.ai.vertex.ai.gemini.transport=grpc # Default config
However, when I switch to using the rest transport, the configuration works fine without any authentication errors:
spring.ai.vertex.ai.gemini.project-id=${PROJECT_ID} spring.ai.vertex.ai.gemini.location=${PROJECT_ZONE} spring.ai.vertex.ai.gemini.credentials-uri=${API_KEY} spring.ai.vertex.ai.gemini.transport=rest # change to rest
Question:
Is there a specific reason why the grpc transport is resulting in authentication errors? Are there additional steps or configurations needed to use grpc with OAuth 2 credentials in this context?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 1 reply
-
@KushParsaniya i stumbled upon the same issue in my project - could you please share what resolved the issue for you (as you closed the question as resolved). Thank you very much.
Beta Was this translation helpful? Give feedback.
All reactions
-
It wasn't resolved yet at the time — I was just testing, so I switched to other models.
Beta Was this translation helpful? Give feedback.