Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Google Vertex AI not working with gRPC transport #1300

Unanswered
KushParsaniya asked this question in Q&A
Discussion options

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?

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

@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.

You must be logged in to vote
1 reply
Comment options

It wasn't resolved yet at the time — I was just testing, so I switched to other models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /