Protocol message contained an invalid tag

 时间:2024-10-15 14:47:33

1、Protocol message contained an invalid tag (zero) ,剧安颌儿如下图所示,这个错误产生的原因是在解释协议数据时,数据中包含了无效的数据,基本上就是数据在传输的过程中被修改了

Protocol message contained an invalid tag

2、一种情况就是在网络上传输的过程中,数据可能被丢失,或者编码和解码不对等造成数据不一致,这种情况的排查就要检查对比数据了

Protocol message contained an invalid tag

3、另一种情况就是程序的逻辑代码有bug,比如多个线程同时对一块内存进行写操作,造成数据不一致,这种情况造成的机率比较大,这种的排查就要检查逻辑代码的实现,对比数据是否一致了

Protocol message contained an invalid tag

4、还有一种情况是你的proto协议文件版本不一致,即数据源的打包和解包两端的协议版本不一致,可以检查一下协议的版本

Protocol message contained an invalid tag

5、由于数据错乱还会抱出其它奇怪的异常,如Protobuf error:Protocol message tag had invalid wire type

Protocol message contained an invalid tag

6、再比如,还有这种异常:Protocol message end-group tag did not match expected tag

Protocol message contained an invalid tag

7、还有下面这种异常:诔罨租磊InvalidProtocolBufferException: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either that the input has been truncated or that an embedded message misreported its own length

Protocol message contained an invalid tag
  • 小艺输入法如何设置说话结束的等待时间?
  • sql server 连接超时设置
  • 百变大侦探三月三日剧本怎么玩
  • 怎样让div的大小随着背景图片的大小变大
  • dota2中先知的几种出装和打法攻略
  • 热门搜索
    关于法制的手抄报内容 历史手抄报版面设计图 心灵驿站手抄报 清明时节祭英烈手抄报 成长足迹手抄报资料 廉洁教育手抄报内容 健康知识手抄报图片 保护眼睛的手抄报 关于菊花的手抄报 健康手抄报资料