出现invalid_topic

目前设备端低功耗时,会定时发送状态信息至EMQX,服务端收到后,会发送响应报文。但是在2024-01-18T12:06:18.188071+08:00,突然出现了一个报错,此后一直处于离线状态,报错日志如下,不清楚是什么原因造成的

2024-01-18T12:04:05.174384+08:00 [PUBLISH] AQ78U4RQgQRU.6X39m9u1R4rANesw0Tkb9t|securemode=3,signmethod=hmacsha1|@39.144.182.31:44899 msg: publish_to, topic: mqtt/AQ78U4RQgQRU/6X39m9u1R4rANesw0Tkb9t/IOV/thing/T-BOX/event/property/request, payload: {"VIN":"LMY1A22A00001","terminalID":"02","frameID":4,"sysDataType":1002,"timestamp":1705550639,"code":"01","data":{"prop":"099154840d010001","RCU":"0000000000000000","BCM":"0000000000000000","DC":"0000000000000000","EHB1":"0000020000000200","EHB2":"0000000000000000","EPB1":"0000000000000000","EPB2":"0000000000000000","EPS1":"0000000000000000","EPS2":"0000000000000000","BMS1":"0000000000000000","BMS2":"0000000000000000","BMS3":"0000000000000000","BMS4":"0000000000000000","MCU1":"3700000000292e00","MCU2":"0000000000000000","VEH1":"000000e803220000","VEH2":"000018c703e97c35","VEH3":"2100000029541c00","event":"0320000000037e01"}}
2024-01-18T12:04:05.183698+08:00 [MQTT] AQ78U4RQgQRU.6X39m9u1R4rANesw0Tkb9t|securemode=3,signmethod=hmacsha1|@39.144.182.31:44899 msg: mqtt_packet_sent, packet: PUBLISH(Q0, R0, D0, Topic=/AQ78U4RQgQRU/6X39m9u1R4rANesw0Tkb9t/IOV/thing/T-BOX/event/property/response, PacketId=undefined, Payload={"VIN":"LMY1A22A00001","code":"10","frameId":1,"sysDataType":1002,"terminalID":"02","timeStamp":1705550645175})
2024-01-18T12:04:16.271936+08:00 [MQTT] AQ78U4RQgQRU.6X39m9u1R4rANesw0Tkb9t|securemode=3,signmethod=hmacsha1|@39.144.182.31:44899 msg: mqtt_packet_received, packet: PUBLISH(Q0, R0, D0, Topic=/AQ78U4RQgQRU/6X39m9u1R4rANesw0Tkb9t/IOV/thing/T-BOX/event/property/request, PacketId=undefined, Payload={"VIN":"LMY1A22A00001","terminalID":"02","frameID":4,"sysDataType":1002,"timestamp":1705550650,"code":"01","data":{"prop":"099154840d010001","RCU":"0000000000000000","BCM":"0000000000000000","DC":"0000000000000000","EHB1":"0000020000000500","EHB2":"0000000000000000","EPB1":"0000000000000000","EPB2":"0000000000000000","EPS1":"0000000000000000","EPS2":"0000000000000000","BMS1":"0000000000000000","BMS2":"0000000000000000","BMS3":"0000000000000000","BMS4":"0000000000000000","MCU1":"3700000000292e00","MCU2":"0000000000000000","VEH1":"000000e803220000","VEH2":"000018c703e97c35","VEH3":"2100000029541c00","event":"0320000000037e01"}})
2024-01-18T12:04:16.272115+08:00 [PUBLISH] AQ78U4RQgQRU.6X39m9u1R4rANesw0Tkb9t|securemode=3,signmethod=hmacsha1|@39.144.182.31:44899 msg: publish_to, topic: mqtt/AQ78U4RQgQRU/6X39m9u1R4rANesw0Tkb9t/IOV/thing/T-BOX/event/property/request, payload: {"VIN":"LMY1A22A00001","terminalID":"02","frameID":4,"sysDataType":1002,"timestamp":1705550650,"code":"01","data":{"prop":"099154840d010001","RCU":"0000000000000000","BCM":"0000000000000000","DC":"0000000000000000","EHB1":"0000020000000500","EHB2":"0000000000000000","EPB1":"0000000000000000","EPB2":"0000000000000000","EPS1":"0000000000000000","EPS2":"0000000000000000","BMS1":"0000000000000000","BMS2":"0000000000000000","BMS3":"0000000000000000","BMS4":"0000000000000000","MCU1":"3700000000292e00","MCU2":"0000000000000000","VEH1":"000000e803220000","VEH2":"000018c703e97c35","VEH3":"2100000029541c00","event":"0320000000037e01"}}
2024-01-18T12:04:16.280535+08:00 [MQTT] AQ78U4RQgQRU.6X39m9u1R4rANesw0Tkb9t|securemode=3,signmethod=hmacsha1|@39.144.182.31:44899 msg: mqtt_packet_sent, packet: PUBLISH(Q0, R0, D0, Topic=/AQ78U4RQgQRU/6X39m9u1R4rANesw0Tkb9t/IOV/thing/T-BOX/event/property/response, PacketId=undefined, Payload={"VIN":"LMY1A22A00001","code":"10","frameId":1,"sysDataType":1002,"terminalID":"02","timeStamp":1705550656271})
2024-01-18T12:04:27.382406+08:00 [MQTT] AQ78U4RQgQRU.6X39m9u1R4rANesw0Tkb9t|securemode=3,signmethod=hmacsha1|@39.144.182.31:44899 msg: mqtt_packet_received, packet: PUBLISH(Q0, R0, D0, Topic=/AQ78U4RQgQRU/6X39m9u1R4rANesw0Tkb9t/IOV/thing/T-BOX/event/property/request, PacketId=undefined, Payload={"VIN":"LMY1A22A00001","terminalID":"02","frameID":4,"sysDataType":1002,"timestamp":1705550661,"code":"01","data":{"prop":"099154840d010001","RCU":"0000000000000000","BCM":"0000000000000000","DC":"0000000000000000","EHB1":"0000020000000e00","EHB2":"0000000000000000","EPB1":"0000000000000000","EPB2":"0000000000000000","EPS1":"0000000000000000","EPS2":"0000000000000000","BMS1":"0000000000000000","BMS2":"0000000000000000","BMS3":"0000000000000000","BMS4":"0000000000000000","MCU1":"3700000000292e00","MCU2":"0000000000000000","VEH1":"000000e803220000","VEH2":"000018c703e67c35","VEH3":"2100000029541c00","event":"0320000000037e01"}})
2024-01-18T12:04:27.382654+08:00 [PUBLISH] AQ78U4RQgQRU.6X39m9u1R4rANesw0Tkb9t|securemode=3,signmethod=hmacsha1|@39.144.182.31:44899 msg: publish_to, topic: mqtt/AQ78U4RQgQRU/6X39m9u1R4rANesw0Tkb9t/IOV/thing/T-BOX/event/property/request, payload: {"VIN":"LMY1A22A00001","terminalID":"02","frameID":4,"sysDataType":1002,"timestamp":1705550661,"code":"01","data":{"prop":"099154840d010001","RCU":"0000000000000000","BCM":"0000000000000000","DC":"0000000000000000","EHB1":"0000020000000e00","EHB2":"0000000000000000","EPB1":"0000000000000000","EPB2":"0000000000000000","EPS1":"0000000000000000","EPS2":"0000000000000000","BMS1":"0000000000000000","BMS2":"0000000000000000","BMS3":"0000000000000000","BMS4":"0000000000000000","MCU1":"3700000000292e00","MCU2":"0000000000000000","VEH1":"000000e803220000","VEH2":"000018c703e67c35","VEH3":"2100000029541c00","event":"0320000000037e01"}}
2024-01-18T12:04:27.390923+08:00 [MQTT] AQ78U4RQgQRU.6X39m9u1R4rANesw0Tkb9t|securemode=3,signmethod=hmacsha1|@39.144.182.31:44899 msg: mqtt_packet_sent, packet: PUBLISH(Q0, R0, D0, Topic=/AQ78U4RQgQRU/6X39m9u1R4rANesw0Tkb9t/IOV/thing/T-BOX/event/property/response, PacketId=undefined, Payload={"VIN":"LMY1A22A00001","code":"10","frameId":1,"sysDataType":1002,"terminalID":"02","timeStamp":1705550667384})
2024-01-18T12:04:38.472388+08:00 [MQTT] AQ78U4RQgQRU.6X39m9u1R4rANesw0Tkb9t|securemode=3,signmethod=hmacsha1|@39.144.182.31:44899 msg: mqtt_packet_received, packet: PUBLISH(Q0, R0, D0, Topic=/AQ78U4RQgQRU/6X39m9u1R4rANesw0Tkb9t/IOV/thing/T-BOX/event/property/request, PacketId=undefined, Payload={"VIN":"LMY1A22A00001","terminalID":"02","frameID":4,"sysDataType":1002,"timestamp":1705550672,"code":"01","data":{"prop":"099154840d010001","RCU":"0000000000000000","BCM":"0000000000000000","DC":"0000000000000000","EHB1":"0000020000000800","EHB2":"0000000000000000","EPB1":"0000000000000000","EPB2":"0000000000000000","EPS1":"0000000000000000","EPS2":"0000000000000000","BMS1":"0000000000000000","BMS2":"0000000000000000","BMS3":"0000000000000000","BMS4":"0000000000000000","MCU1":"3700000000292e00","MCU2":"0000000000000000","VEH1":"000000e803220000","VEH2":"000018c703e67c35","VEH3":"2100000029541c00","event":"0320000000037e01"}})
2024-01-18T12:04:38.472576+08:00 [PUBLISH] AQ78U4RQgQRU.6X39m9u1R4rANesw0Tkb9t|securemode=3,signmethod=hmacsha1|@39.144.182.31:44899 msg: publish_to, topic: mqtt/AQ78U4RQgQRU/6X39m9u1R4rANesw0Tkb9t/IOV/thing/T-BOX/event/property/request, payload: {"VIN":"LMY1A22A00001","terminalID":"02","frameID":4,"sysDataType":1002,"timestamp":1705550672,"code":"01","data":{"prop":"099154840d010001","RCU":"0000000000000000","BCM":"0000000000000000","DC":"0000000000000000","EHB1":"0000020000000800","EHB2":"0000000000000000","EPB1":"0000000000000000","EPB2":"0000000000000000","EPS1":"0000000000000000","EPS2":"0000000000000000","BMS1":"0000000000000000","BMS2":"0000000000000000","BMS3":"0000000000000000","BMS4":"0000000000000000","MCU1":"3700000000292e00","MCU2":"0000000000000000","VEH1":"000000e803220000","VEH2":"000018c703e67c35","VEH3":"2100000029541c00","event":"0320000000037e01"}}
2024-01-18T12:04:38.482293+08:00 [MQTT] AQ78U4RQgQRU.6X39m9u1R4rANesw0Tkb9t|securemode=3,signmethod=hmacsha1|@39.144.182.31:44899 msg: mqtt_packet_sent, packet: PUBLISH(Q0, R0, D0, Topic=/AQ78U4RQgQRU/6X39m9u1R4rANesw0Tkb9t/IOV/thing/T-BOX/event/property/response, PacketId=undefined, Payload={"VIN":"LMY1A22A00001","code":"10","frameId":1,"sysDataType":1002,"terminalID":"02","timeStamp":1705550678471})
2024-01-18T12:04:49.591707+08:00 [MQTT] AQ78U4RQgQRU.6X39m9u1R4rANesw0Tkb9t|securemode=3,signmethod=hmacsha1|@39.144.182.31:44899 msg: mqtt_packet_received, packet: PUBLISH(Q0, R0, D0, Topic=/AQ78U4RQgQRU/6X39m9u1R4rANesw0Tkb9t/IOV/thing/T-BOX/event/property/request, PacketId=undefined, Payload={"VIN":"LMY1A22A00001","terminalID":"02","frameID":4,"sysDataType":1002,"timestamp":1705550684,"code":"01","data":{"prop":"099154840d010001","RCU":"0000000000000000","BCM":"0000000000000000","DC":"0000000000000000","EHB1":"0000020000000000","EHB2":"0000000000000000","EPB1":"0000000000000000","EPB2":"0000000000000000","EPS1":"0000000000000000","EPS2":"0000000000000000","BMS1":"0000000000000000","BMS2":"0000000000000000","BMS3":"0000000000000000","BMS4":"0000000000000000","MCU1":"3700000000292e00","MCU2":"0000000000000000","VEH1":"000000e803220000","VEH2":"000018c703e97c35","VEH3":"2100000029541c00","event":"0320000000037e01"}})
2024-01-18T12:04:49.591909+08:00 [PUBLISH] AQ78U4RQgQRU.6X39m9u1R4rANesw0Tkb9t|securemode=3,signmethod=hmacsha1|@39.144.182.31:44899 msg: publish_to, topic: mqtt/AQ78U4RQgQRU/6X39m9u1R4rANesw0Tkb9t/IOV/thing/T-BOX/event/property/request, payload: {"VIN":"LMY1A22A00001","terminalID":"02","frameID":4,"sysDataType":1002,"timestamp":1705550684,"code":"01","data":{"prop":"099154840d010001","RCU":"0000000000000000","BCM":"0000000000000000","DC":"0000000000000000","EHB1":"0000020000000000","EHB2":"0000000000000000","EPB1":"0000000000000000","EPB2":"0000000000000000","EPS1":"0000000000000000","EPS2":"0000000000000000","BMS1":"0000000000000000","BMS2":"0000000000000000","BMS3":"0000000000000000","BMS4":"0000000000000000","MCU1":"3700000000292e00","MCU2":"0000000000000000","VEH1":"000000e803220000","VEH2":"000018c703e97c35","VEH3":"2100000029541c00","event":"0320000000037e01"}}
2024-01-18T12:04:49.598765+08:00 [MQTT] AQ78U4RQgQRU.6X39m9u1R4rANesw0Tkb9t|securemode=3,signmethod=hmacsha1|@39.144.182.31:44899 msg: mqtt_packet_sent, packet: PUBLISH(Q0, R0, D0, Topic=/AQ78U4RQgQRU/6X39m9u1R4rANesw0Tkb9t/IOV/thing/T-BOX/event/property/response, PacketId=undefined, Payload={"VIN":"LMY1A22A00001","code":"10","frameId":1,"sysDataType":1002,"terminalID":"02","timeStamp":1705550689593})
2024-01-18T12:06:18.188071+08:00 [MQTT] AQ78U4RQgQRU.6X39m9u1R4rANesw0Tkb9t|securemode=3,signmethod=hmacsha1|@39.144.182.31:44899 msg: mqtt_packet_received, packet: {frame_error,#{hint => invalid_topic,parsed_length => 12336,
               remaining_bytes_length => 46}}
2024-01-18T12:06:18.188222+08:00 [SOCKET] AQ78U4RQgQRU.6X39m9u1R4rANesw0Tkb9t|securemode=3,signmethod=hmacsha1|@39.144.182.31:44899 msg: socket_force_closed, reason: [hint: invalid_topic, parsed_length: 12336, remaining_bytes_length: 46]
2024-01-18T12:06:18.188408+08:00 [SOCKET] AQ78U4RQgQRU.6X39m9u1R4rANesw0Tkb9t|securemode=3,signmethod=hmacsha1|@39.144.182.31:44899 msg: emqx_connection_terminated, reason: {shutdown,#{hint => invalid_topic,parsed_length => 12336,remaining_bytes_length => 46}}
2024-01-19T10:54:20.892613+08:00 [API] AQ78U4RQgQRU.6X39m9u1R4rANesw0Tkb9t|securemode=3,signmethod=hmacsha1|@ msg: trace_stopping, 

2024-01-18T12:06:18.188071+08:00 [MQTT] AQ78U4RQgQRU.6X39m9u1R4rANesw0Tkb9t|securemode=3,signmethod=hmacsha1|@39.144.182.31:44899 msg: mqtt_packet_received, packet: {frame_error,#{hint => invalid_topic,parsed_length => 12336, remaining_bytes_length => 46}}

是客户端发送了不合法的 MQTT 报文,emqx 解析失败。如果能复现你可以通过抓包来定位这种问题。

好的,感谢

我是用4G模块基于MQTT协议向emqx发送数据时,我上传的数据量比较大,通过查看服务器的数据发现出现粘包,emqx强制断开socket,出现的报错跟你一样。请问你是怎么解决的?谢谢!