docker emqx4.0 报了一个难定位的错误

环境信息

  • EMQX 版本:4.0
  • 操作系统及版本:centos
  • 其他

问题描述

2022-08-31T08:24:26.753613+08:00 [error] at_state: #{expected_bytes => 34,parsed_header => {mqtt_packet_header,7,true,1,true},received_bytes => 0}, clientid: ECS00100220427, input_bytes: <<48,170,2,0,44,108,103,116,111,112,105,99,47,69,67,83,48,48,49,48,48,50,50,48,52,50,55,47,112,114,111,112,101,114,116,105,101,115,47,114,101,97,100,47,114,101,112,108,121,123,34,112,114,111,112,101,114,116,105,101,115,34,58,123,34,68,48,48,34,58,32,57,55,50,57,32,44,34,68,48,53,34,58,49,48,50,51,55,51,32,32,32,32,44,34,68,48,54,34,…>>, line: 783, mfa: emqx_connection:parse_incoming/2, parsed_packets: [], peername: 192.168.1.186:22804, reason: function_clause, stacktrace: [{emqx_frame,parse_packet,[{mqtt_packet_header,7,true,1,true},<<48,170,2,0,44,108,103,116,111,112,105,99,47,69,67,83,48,48,49,48,48,50,50,48,52,50,55,47,112,114,111,112,101,114>>,#{max_size => 1048576,strict_mode => false,version => 4}],[{file,“emqx_frame.erl”},{line,258}]},{emqx_frame,parse_frame,4,[{file,“emqx_frame.erl”},{line,231}]},{emqx_connection,parse_incoming,3,[{file,“emqx_connection.erl”},{line,761}]},{emqx_connection,handle_msg,2,[{file,“emqx_connection.erl”},{line,740}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,466}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,428}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,236}]}]

8月初安装的时候,一切还都正常,数据能订阅,到8月31日的时候,突然报这个异常,emqx也连接不上,一直报这个错误, 不知具体是哪里引起的这个错误,求解,谢谢。

社区有人帮忙协助看一下的吗? :grinning:

看日志应该是 5.0.x 能通过 emqx_ctl broker 命令看下具体的版本么?

看截图的日志还是客户端发送的报文不正确导致的。。

5.0也是报这个错,我换成了4.2版本,也是报同样的错误。
image

请问什么情况下会出现客户端发送的报文不正确呢?

这就很难讲了,例如有拿 HTTP 报文往 1883 发的这种,
不过看上面的截图,应该不是这样的问题。可能是客户端在组 MQTT 报文、或者发的时候有问题。这种比较难定位,建议是要把 这个客户端的 TCP 的报文都抓下来,一个个对才知道

2022-09-20T20:59:37.497918+00:00 [error] 117.187.173.32:60032 [MQTT] , Parse failed for function_clause, [{emqx_frame,parse_packet,[{mqtt_packet_header,4,false,3,true},<<"T / HTTP/1.1\r\nUser-Agent: curl/7.29.0\r\nHost: 120.92.106.222\r\nAccept: ">>,#{max_size => 1048576,strict_mode => false,version => 4}],[{file,“emqx_frame.erl”},{line,224}]},{emqx_frame,parse_frame,4,[{file,“emqx_frame.erl”},{line,201}]},{emqx_connection,parse_incoming,3,[{file,“emqx_connection.erl”},{line,655}]},{emqx_connection,handle_msg,2,[{file,“emqx_connection.erl”},{line,648}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,394}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,358}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,236}]}], Frame data:<<“GET / HTTP/1.1\r\nUser-Agent: curl/7.29.0\r\nHost: 120.92.106.222\r\nAccept: /\r\n\r\n”>>
这个报错是什么意思呀

就是前者,用 HTTP 报文发到了 MQTT 的 1883 端口