EMQ 问答社区

Parse failed for function_clause这个错误是什么原因

环境信息

  • EMQ X 版本:4.1.2
  • 操作系统及版本:centos8
  • 其他

问题描述

2021-07-18 05:06:57.366 [error] <<"338221012345">>@39.144.5.45:18078 [MQTT] 
Parse failed for function_clause
[{emqx_frame,parse_packet,[{mqtt_packet_header,6,true,1,false},<<"3\",\"value\":\"0\"},{\"name\":\"dingshuashengjiangyc\",\"value\":\"0\"},{\"name\":\"moshi4\",\"value\":\"0\"},{\"name\":\"dingsh">>,#{max_size => 1048576,strict_mode => false,version => 3}],[{file,"/emqx-enterprise-rel/_checkouts/emqx/src/emqx_frame.erl"},{line,167}]},{emqx_frame,parse_frame,4,[{file,"/emqx-enterprise-rel/_checkouts/emqx/src/emqx_frame.erl"},{line,145}]},{emqx_connection,parse_incoming,3,[{file,"/emqx-enterprise-rel/_checkouts/emqx/src/emqx_connection.erl"},{line,508}]},{emqx_connection,handle_msg,2,[{file,"/emqx-enterprise-rel/_checkouts/emqx/src/emqx_connection.erl"},{line,501}]},{emqx_connection,process_msg,3,[{file,"/emqx-enterprise-rel/_checkouts/emqx/src/emqx_connection.erl"},{line,284}]},{proc_lib,wake_up,3,[{file,"proc_lib.erl"},{line,259}]}]
Frame data:<<"hi3\",\"value\":\"0\"},{\"name\":\"dingshuashengjiangyc\",\"value\":\"0\"},{\"name\":\"moshi4\",\"value\":\"0\"},{\"name\":\"dingshuaxuanzhuangz\",\"value\":\"0\"},{\"name\":\"cheliangchaoqian\",\"value\":\"0\"},{\"name\":\"moshi5\",\"value\":\"0\"},{\"name\":\"weijiancedaoche\",\"value\":\"0\"},{\"name\":\"longmenxingzouyc\",\"value\":\"0\"},{\"name\":\"qunshuagz\",\"value\":\"0\"},{\"name\":\"meiyoufuwei\",\"value\":\"0\"},{\"name\":\"moshi6\",\"value\":\"0\"},{\"name\":\"dalishuaxtgz\",\"value\":\"0\"},{\"name\":\"shuaxiyunxing\",\"value\":\"0\"},{\"name\":\"fengjijy\",\"value\":\"0\"},{\"name\":\"quexiangbaohu\",\"value\":\"0\"},{\"name\":\"fengjids\",\"value\":\"0\"},{\"name\":\"lunshuagz\",\"value\":\"0\"},{\"name\":\"yulinyunxing\",\"value\":\"0\"},{\"name\":\"fengjizs\",\"value\":\"0\"},{\"name\":\"paomoyunxing\",\"value\":\"0\"},{\"name\":\"dingfeng1gz\",\"value\":\"0\"},{\"name\":\"fengjigs\",\"value\":\"0\"},{\"name\":\"fengganyunxing\",\"value\":\"0\"},{\"name\":\"dingfeng2gz\",\"value\":\"0\"},{\"name\":\"qidong\",\"value\":\"0\"},{\"name\":\"tingzhi\",\"value\":\"0\"},{\"name\":\"dingfeng3gz\",\"value\":\"0\"},{\"name\":\"zan">>

日志里经常抛出这个错误

还有当重启时也有以下错误:

2021-07-18 10:08:26.018 [error]     supervisor: {local,gr_counter_sup}
    errorContext: child_terminated
    reason: killed
    offender: [{pid,<0.2385.0>},
               {id,gr_lager_default_tracer_counters},
               {mfargs,{gr_counter,start_link,
                                   [gr_lager_default_tracer_counters]}},
               {restart_type,transient},
               {shutdown,brutal_kill},
               {child_type,worker}]
2021-07-18 10:08:26.019 [error]     supervisor: {local,gr_param_sup}
    errorContext: child_terminated
    reason: killed
    offender: [{pid,<0.2384.0>},
               {id,gr_lager_default_tracer_params},
               {mfargs,{gr_param,start_link,[gr_lager_default_tracer_params]}},
               {restart_type,transient},
               {shutdown,brutal_kill},
               {child_type,worker}]

这是什么原因?如何解决?

报文解析错误,检查一下你的报文格式