shutdown,protocol_error

环境

  • EMQX 版本:
  • 操作系统版本:

重现此问题的步骤

  1. xxx
  2. xxx
  3. xxx

预期行为

客户端连接EMQX服务端报错:shutdown,protocol_error,导致连接不上,数据上报有问题

实际行为

错误日志如下:
2024-05-31T04:20:41+08:00 [MQTT]msg: mqtt_packet_received, packet: CONNECT(Q0, R0, D0),ClientId=669, ProtoName=MQTT, ProtoVsn=4, CleanStart=true, KeepAlive=120, Username=ouke, Password=
2024-05-31T04:20:41+08:00 [SOCKET] msg: socket_force_closed, reason: protocol_error
2024-05-31T04:20:41+08:00 [SOCKET] msg: emqx_connection_terminated, reason: {shutdown,protocol_error}

protocol_error 是你的 MQTT 报文格式不对时出现的,建议检查下报文, 也可以将 EMQX 的日志等级设置为 debug 再来看看