irpas技术客

【dubbo异常处理】Fail to decode request due to: RpcInvocation_羽裳醉月

未知 4047

生产中与其他厂商的微服务进行rpc间的调用时,dubbo抛出 Fail to decode request due to: RpcInvocation的异常。

目录 一、问题的起源二、问题的处理① 检查dubbo中comsuer、provider中接口方法是否注册②查看provider的实时日志发现,dubbo报出以下提示③对比provider、consumer中setlListInfoUpldA方法的入参④ 将provider、consumer中setlListInfoUpldA方法入参中相同字段的类型保持一致 三、问题的验证①观察实时日志发现,此时dubbo间服务的调用已经通了,只是服务抛出了dubbo的异常信息,并未将代码的错误信息真正抛出。


一、问题的起源

微服务通过dubbo的调用时报错信息如下:

{"output":null,"infcode":-1,"inf_refmsgi`d`":null,"refmsg_time":null,"respond_time":null,"err_msg":"fsi调用mbs异常:Failed to invoke the method setlListInfoUpldA in the service cn.hsa.mbs.fmi.api.medinfoupload.service.FmiMedInfoUploadService. Tried 3 times of the providers [10.130.128.178:20880] (1/1) from the registry powercloud.nginx:20003 on the consumer 10.130.130.109 using the dubbo version 2.7.3. Last error is: Failed to invoke remote method: setlListInfoUpldA, provider: dubbo://10.130.128.178:20880/cn.hsa.mbs.fmi.api.medinfoupload.service.FmiMedInfoUploadService?anyhost=true&application=hsa-mbs-fsi-nation&bean.name=cn.hsa.mbs.fmi.api.medinfoupload.service.FmiMedInfoUploadService&category=providers&check=false&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&group=rpc-mbs&interface=cn.hsa.mbs.fmi.api.medinfoupload.service.FmiMedInfoUploadService&lazy=false&methods=getTcmDiseByDiseName,setlListInfoUpldA,getWmDiseByDiseName,querySetlListInfo,querySetlDetail,setlListInfoUpld,querySetlList,ownpayPatnMdtrtUpld,queryAdmdvsTreeAll&path=cn.hsa.mbs.fmi.api.medinfoupload.service.FmiMedInfoUploadService&pid=115592&protocol=dubbo&qos.enable=false&register=true&register.ip=10.130.130.109&release=2.7.3&remote.application=hsa-mbs-local&revision=1.0.0&side=consumer&sticky=false&timeout=30000&timestamp=1651394722080&version=1.0.0, cause: org.apache.dubbo.remoting.RemotingException: Fail to decode request due to: RpcInvocation [methodName=setlListInfoUpldA, parameterTypes=null, arguments=null, attachments={path=cn.hsa.mbs.fmi.api.medinfoupload.service.FmiMedInfoUploadService, input=6565, dubbo=2.0.2, version=1.0.0}]"} 二、问题的处理 ① 检查dubbo中comsuer、provider中接口方法是否注册

consumer中的setlListInfoUpldA方法是注册到dubbo中的。 provider中的setlListInfoUpldA方法也是存在的。

②查看provider的实时日志发现,dubbo报出以下提示

发现provider实时日志中,只是Warn入参的字段类型转化异常,并未提示Error。

③对比provider、consumer中setlListInfoUpldA方法的入参

发现provider中setlListInfoUpldA方法入参中lv3NurscareDays字段的类型为BigDecimal,而consumer中lv3NurscareDays字段的类型为Integer。

④ 将provider、consumer中setlListInfoUpldA方法入参中相同字段的类型保持一致 三、问题的验证 ①观察实时日志发现,此时dubbo间服务的调用已经通了,只是服务抛出了dubbo的异常信息,并未将代码的错误信息真正抛出。 "err_msg": "fsi调用mbs异常:Failed to invoke the method setlListInfoUpldA in the service cn.hsa.mbs.fmi.api.medinfoupload.service.FmiMedInfoUploadService. Tried 3 times of the providers [10.130.128.178:20880] (1/1) from the registry powercloud.nginx:20003 on the consumer 10.130.130.109 using the dubbo version 2.7.3. Last error is: Failed to invoke remote method: setlListInfoUpldA, provider: dubbo://10.130.128.178:20880/cn.hsa.mbs.fmi.api.medinfoupload.service.FmiMedInfoUploadService?anyhost=true&application=hsa-mbs-fsi-nation&bean.name=cn.hsa.mbs.fmi.api.medinfoupload.service.FmiMedInfoUploadService&category=providers&check=false&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&group=rpc-mbs&interface=cn.hsa.mbs.fmi.api.medinfoupload.service.FmiMedInfoUploadService&lazy=false&methods=getTcmDiseByDiseName,setlListInfoUpldA,querySetlListInfo,getWmDiseByDiseName,setlListInfoUpld,querySetlDetail,ownpayPatnMdtrtUpld,querySetlList,queryAdmdvsTreeAll&path=cn.hsa.mbs.fmi.api.medinfoupload.service.FmiMedInfoUploadService&pid=139627&protocol=dubbo&qos.enable=false&register=true&register.ip=10.130.130.109&release=2.7.3&remote.application=hsa-mbs-local&revision=1.0.0&side=consumer&sticky=false&timeout=30000&timestamp=1652856548356&version=1.0.0, cause: org.apache.dubbo.remoting.RemotingException: java.io.IOException: Response data error, expect Throwable, but get {code=240000, suppressedExceptions=[], cause=(this Map), stackTrace=[Ljava.lang.StackTraceElement;@2f51191c, detailMessage=查询不到对应的医师或护士,请求确认蚕食是否正确}\njava.io.IOException: Response data error, expect Throwable, but get {code=240000, suppressedExceptions=[], cause=(this Map), stackTrace=[Ljava.lang.StackTraceElement;@2f51191c, detailMessage=查询不到对应的医师或护士,请求确认蚕食是否正确}\n\tat org.apache.dubbo.rpc.protocol.dubbo.DecodeableRpcResult.handleException(DecodeableRpcResult.java:146)\n\tat org.apache.dubbo.rpc.protocol.dubbo.DecodeableRpcResult.decode(DecodeableRpcResult.java:96)\n\tat org.apache.dubbo.rpc.protocol.dubbo.DecodeableRpcResult.decode(DecodeableRpcResult.java:112)\n\tat org.apache.dubbo.rpc.protocol.dubbo.DubboCodec.decodeBody(DubboCodec.java:92)\n\tat org.apache.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:122)\n\tat org.apache.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:82)\n\tat org.apache.dubbo.rpc.protocol.dubbo.DubboCountCodec.decode(DubboCountCodec.java:48)\n\tat org.apache.dubbo.remoting.transport.netty4.NettyCodecAdapter$InternalDecoder.decode(NettyCodecAdapter.java:90)\n\tat io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502)\n\tat io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:441)\n\tat io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:345)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:337)\n\tat io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1408)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:345)\n\tat io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930)\n\tat io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:677)\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:612)\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:529)\n\tat io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:491)\n\tat io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905)\n\tat io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)\n\tat java.lang.Thread.run(Thread.java:748)\n",


1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,会注明原创字样,如未注明都非原创,如有侵权请联系删除!;3.作者投稿可能会经我们编辑修改或补充;4.本站不提供任何储存功能只提供收集或者投稿人的网盘链接。

标签: #dubbo异常处理Fail #To #decode #request #due #RpcInvocation #dubbo抛出cause