io.grpc.StatusRuntimeException: CANCELLED: io.grpc.Context was cancelled without error

在2023年5月17日的一次日志记录中,发现了一个关于GRPC服务的问题。服务端接收到一个缺少Trailers头的请求,这可能是因为某个中间代理不支持Trailers。随后,在尝试保存人口面部信息时,遇到了一个被取消的异常,具体表现为io.grpc.StatusRuntimeException:CANCELLED。这个问题涉及到服务调用、客户端调用、以及Spring事务处理的多个层面。
摘要由CSDN通过智能技术生成
May 17, 2023 2:00:44 PM io.grpc.netty.shaded.io.grpc.netty.NettyServerHandler onHeadersRead
WARNING: Expected header TE: trailers, but null is received. This means some intermediate proxy may not support trailers
2023-05-17 14:00:44,842 INFO  [grpc-default-executor-3] PopulationFaceServiceImpl-save req:face_url: "rj-resident/face/1684303242444.jpg"
people_id: "355521113008173375"

2023-05-17 14:01:14,829 ERROR [grpc-default-executor-3] PopulationFaceServiceImpl-save exception info
io.grpc.StatusRuntimeException: CANCELLED: io.grpc.Context was cancelled without error
	at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:262) ~[grpc-stub-1.31.1.jar!/:1.31.1]
	at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:243) ~[grpc-stub-1.31.1.jar!/:1.31.1]
	at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:156) ~[grpc-stub-1.31.1.jar!/:1.31.1]
	at com.casic.gx.third.dahuaiccapi.DahuaIccApiGrpc$DahuaIccApiBlockingStub.addPerson(DahuaIccApiGrpc.java:319) ~[rj-service-grpc-lib-1.0-SNAPSHOT.jar!/:?]
	at com.casic.gx.rj.resident.app.api.service.impl.PopulationFaceServiceImpl.save(PopulationFaceServiceImpl.java:230) ~[classes!/:?]
	at com.casic.gx.rj.resident.app.api.service.impl.PopulationFaceServiceImpl$$FastClassBySpringCGLIB$$303546d0.invoke(<generated>) ~[classes!/:?]
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771) ~[spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) ~[spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:367) [spring-tx-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118) [spring-tx-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at com.casic.gx.rj.resident.app.api.service.impl.PopulationFaceServiceImpl$$EnhancerBySpringCGLIB$$1d409b6e.save(<generated>) [classes!/:?]
	at com.casic.gx.rj.resident.app.api.grpc.ResidentPopulationFaceProvider.save(ResidentPopulationFaceProvider.java:28) [classes!/:?]
	at com.casic.gx.rj.resident.app.api.grpc.ResidentPopulationFaceProvider$$FastClassBySpringCGLIB$$e6d9cce1.invoke(<generated>) [classes!/:?]
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) [spring-core-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at com.casic.gx.grpc.server.starter.HuishiGrpcServiceAspect.process(HuishiGrpcServiceAspect.java:84) [huishi-common-grpc-server-starter-3.0.0-SNAPSHOT.jar!/:?]
	at sun.reflect.GeneratedMethodAccessor210.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_202]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202]
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at com.casic.gx.grpc.server.starter.HuishiGrpcServiceAspect.process(HuishiGrpcServiceAspect.java:84) [huishi-common-grpc-server-starter-3.0.0-SNAPSHOT.jar!/:?]
	at sun.reflect.GeneratedMethodAccessor210.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_202]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202]
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691) [spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
	at com.casic.gx.rj.resident.app.api.grpc.ResidentPopulationFaceProvider$$EnhancerBySpringCGLIB$$c5ba79de.save(<generated>) [classes!/:?]
	at com.casic.gx.rj.resident.app.populationfaceapi.PopulationFaceApiGrpc$MethodHandlers.invoke(PopulationFaceApiGrpc.java:338) [rj-service-grpc-lib-1.0-SNAPSHOT.jar!/:?]
	at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:180) [grpc-stub-1.31.1.jar!/:1.31.1]
	at io.grpc.PartialForwardingServerCallListener.onHalfClose(PartialForwardingServerCallListener.java:35) [grpc-api-1.31.1.jar!/:1.31.1]
	at io.grpc.ForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:23) [grpc-api-1.31.1.jar!/:1.31.1]
	at io.grpc.ForwardingServerCallListener$SimpleForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:40) [grpc-api-1.31.1.jar!/:1.31.1]
	at io.grpc.PartialForwardingServerCallListener.onHalfClose(PartialForwardingServerCallListener.java:35) [grpc-api-1.31.1.jar!/:1.31.1]
	at io.grpc.ForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:23) [grpc-api-1.31.1.jar!/:1.31.1]
	at io.grpc.ForwardingServerCallListener$SimpleForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:40) [grpc-api-1.31.1.jar!/:1.31.1]
	at io.grpc.PartialForwardingServerCallListener.onHalfClose(PartialForwardingServerCallListener.java:35) [grpc-api-1.31.1.jar!/:1.31.1]
	at io.grpc.ForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:23) [grpc-api-1.31.1.jar!/:1.31.1]
	at io.grpc.ForwardingServerCallListener$SimpleForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:40) [grpc-api-1.31.1.jar!/:1.31.1]
	at io.grpc.Contexts$ContextualizedServerCallListener.onHalfClose(Contexts.java:86) [grpc-api-1.31.1.jar!/:1.31.1]
	at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:331) [grpc-core-1.31.1.jar!/:1.31.1]
	at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:814) [grpc-core-1.31.1.jar!/:1.31.1]
	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) [grpc-core-1.31.1.jar!/:1.31.1]
	at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) [grpc-core-1.31.1.jar!/:1.31.1]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_202]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_202]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_202]

接口内部创建grpc客户端失败汇报这个错

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值