You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Spring Cloud GCP连接Firestore模拟器时遭遇INTERNAL: http2 exception错误的排查与解决请求

Spring Cloud GCP连接Firestore模拟器时遭遇INTERNAL: http2 exception错误的排查与解决请求

大家好,我目前正在本地使用Firestore模拟器测试Spring应用,通过com.google.cloud:spring-cloud-gcp-data-firestore依赖来配置数据库连接。

我的依赖配置如下:

<dependency>
    <groupId>com.google.cloud</groupId>
    <artifactId>spring-cloud-gcp-data-firestore</artifactId>
</dependency>

本地配置文件内容:

spring.cloud.gcp.firestore.emulator.enabled=true
spring.cloud.gcp.firestore.emulator.host-port=localhost:8082
spring.cloud.gcp.firestore.emulator.project-id=local-project

我已经完成模拟器的安装,启动命令为:gcloud emulators firestore start --host-port=localhost:8082,模拟器能正常启动,但当我调用Repository的保存方法时:

myObjectRepository.save(myObjectLocal).block();

会抛出异常,核心报错信息如下:

Caused by: io.grpc.StatusRuntimeException: INTERNAL: http2 exception
at io.grpc.Status.asRuntimeException(Status.java:537) ~[grpc-api-1.59.0.jar:1.59.0]
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:481) ~[grpc-stub-1.59.0.jar:1.59.0]
at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:103) ~[reactor-core-3.5.11.jar:3.5.11]
at reactor.core.publisher.Mono.block(Mono.java:1712) ~[reactor-core-3.5.11.jar:3.5.11]
...
Caused by: io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2Exception: First received frame was not SETTINGS. Hex dump for first 5 bytes: 1503010002
at io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2Exception.connectionError(Http2Exception.java:109) ~[grpc-netty-shaded-1.59.0.jar:1.59.0]

需要说明的是,当我配置连接远程GCP官方Firestore数据库时,代码可以正常运行,能够成功保存myObject。有没有朋友能帮忙排查下模拟器连接的问题?

备注:内容来源于stack exchange,提问作者Roland

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.21 08:09:51