Call DataChatServiceClient with Conversation leads to --> Suppressed: java.lang.RuntimeException: Asynchronous task failed at com.google.api.gax.rpc.ServerStreamIterator.hasNext(ServerStreamIterator.java:105)

未關閉
#13,566 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
48/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
冷清
技術堆疊
google-cloud, java
領域
api, backend

研究方向

首先,使用 conversationId 重現失敗,並將其與不帶 conversationId 的正常請求進行比較。閱讀 DataChatService.chat 和 forEachChatMessage,然後檢查 buildChatRequest 以及 ConversationReference/DataAgentContext 的建構。完成的標準是基於 conversation 的聊天不需 INTERNAL 錯誤即可成功,同時無 conversation 路徑持續正常運作。

由索引模型根據 Issue 內容生成。

描述

priority: p3 type: bug

Issue Details

I am using

<google.cloud.libraries-bom.version>26.84.0</google.cloud.libraries-bom.version>
---
 <dependency>
         <groupId>com.google.cloud</groupId>
         <artifactId>libraries-bom</artifactId>
         <version>${google.cloud.libraries-bom.version}</version>
         <type>pom</type>
                <scope>import</scope>
</dependency>
-----
 <dependency>
       <groupId>com.google.cloud</groupId>
      <artifactId>google-cloud-geminidataanalytics</artifactId>
</dependency>

When calling the DataChatServiceClient with a conversation i got:

com.google.api.gax.rpc.InternalException: io.grpc.StatusRuntimeException: INTERNAL: Internal error encountered.
	at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:120)
	at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:86)
	at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:41)
	at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:86)
	at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:66)
	at com.google.api.gax.grpc.ExceptionResponseObserver.onErrorImpl(ExceptionResponseObserver.java:82)
	at com.google.api.gax.rpc.StateCheckingResponseObserver.onError(StateCheckingResponseObserver.java:84)
	at com.google.api.gax.grpc.GrpcDirectStreamController$ResponseObserverAdapter.onClose(GrpcDirectStreamController.java:148)
	at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
	at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
	at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
	at com.google.api.gax.grpc.ChannelPool$ReleasingClientCall$1.onClose(ChannelPool.java:651)
	at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
	at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
	at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
	at com.google.api.gax.grpc.GrpcLoggingInterceptor$1$1.onClose(GrpcLoggingInterceptor.java:98)
	at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:566)
	at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:72)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:734)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:715)
	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
	at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
	at java.base/java.lang.Thread.run(Thread.java:1474)
	Suppressed: java.lang.RuntimeException: Asynchronous task failed
		at com.google.api.gax.rpc.ServerStreamIterator.hasNext(ServerStreamIterator.java:105)
		at io.gec.bigquery.control.DataAgentChatService.forEachChatMessage(DataAgentChatService.java:120)
		at io.gec.bigquery.control.DataAgentChatService.chat(DataAgentChatService.java:102)
		at io.gec.bigquery.control.DataAgentChatService_ClientProxy.chat(Unknown Source)
		at io.gec.bigquery.boundary.ChatResource.chat(ChatResource.java:30)
		at io.gec.bigquery.boundary.ChatResource_ClientProxy.chat(Unknown Source)
		at io.gec.bigquery.boundary.ChatResource$quarkusrestinvoker$chat_6f06d6f38f3e27ba1e41c7eaa780f3bbd3a1ade8.invoke(Unknown Source)
		at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)
		at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:190)
		at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:147)
		at io.quarkus.vertx.core.runtime.VertxCoreRecorder$15.runWith(VertxCoreRecorder.java:695)
		at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2651)
		at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2630)
		at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1622)
		at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1589)
		at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:11)
		at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:11)
		at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
		... 1 more
Caused by: io.grpc.StatusRuntimeException: INTERNAL: Internal error encountered.
	at io.grpc.Status.asRuntimeException(Status.java:532)
	... 18 more

Here my Implementation:

 private ChatRequest buildChatRequest(String question, String conversationId) {
        String parent = locationName();

        Message userMessage = Message.newBuilder()
                .setUserMessage(UserMessage.newBuilder().setText(question).build())
                .build();

        ChatRequest.Builder requestBuilder = ChatRequest.newBuilder()
                .setParent(parent)
                .addMessages(userMessage);

        if (conversationId != null && !conversationId.isBlank()) {
            String conversationName = conversationName(conversationId);
            ConversationReference conversationReference = ConversationReference.newBuilder()
                    .setConversation(conversationName)
                    .setDataAgentContext(DataAgentContext.newBuilder()
                            .setDataAgent(configuredDataAgentName())
                            .build())
                    .build();
            requestBuilder.setConversationReference(conversationReference);
        } else {
            requestBuilder.setDataAgentContext(DataAgentContext.newBuilder()
                    .setDataAgent(configuredDataAgentName())
                    .build());
        }

        return requestBuilder.build();
    }

When calling without conversationId everything is working as expected.

Environment

  • Linux
  • JDK 25.0.2
  • 26.84.0
主要語言
Java
星號
2.1k
分支
1.2k
平均合併
2 天 14 小時
30 天內合併 PR
192

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

googleapis/google-cloud-java 的其他 Issue

查看 googleapis/google-cloud-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。