webhook有时未能推送上下线消息

环境信息

  • EMQX 版本:4.4.1
  • 操作系统及版本:CentOS 7.8 64位
  • 单节点

问题描述

webhook有时未能推送上下线消息。某设备重复上线下线后,都不能触发webhook,尤其是上线通知,而与此同时其他设备上下线就能收到触发的消息。

配置文件及日志

webhook配置

web.hook.url = http://127.0.0.1:8870/mqttauth/webhook/advance

web.hook.rule.client.connected.1 = {“action”: “on_client_connected”}
web.hook.rule.client.disconnected.1 = {“action”: “on_client_disconnected”}

emqx.log
2022-06-22T16:23:51.893631+08:00 [warning] iedu_9161a7851@42.84.45.101:53733 [Channel] The PUBACK PacketId 100 is not found.
2022-06-22T16:23:51.893815+08:00 [warning] iedu_9161a7851@42.84.45.101:53733 [Channel] The PUBCOMP PacketId 8762 is not found
2022-06-22T16:54:48.015935+08:00 [error] iedu_9161a7851@42.84.45.101:53851 [WebHook] HTTP request error: timeout
2022-06-22T16:54:48.327939+08:00 [error] iedu_ser_1655888082017@121.196.28.130:50020 [WebHook] HTTP request error: timeout
2022-06-22T16:54:48.497948+08:00 [error] ehttpc: Received ‘gun_error’ message from unknown stream ref: #Ref<0.3794944198.3918790657.53369>
2022-06-22T16:54:48.501100+08:00 [error] ehttpc: Received ‘gun_error’ message from unknown stream ref: #Ref<0.3794944198.3918790657.53380>
2022-06-22T16:57:37.077676+08:00 [warning] iedu_9161a7851@42.84.45.101:53851 [Channel] The PUBACK PacketId 100 is not found.
2022-06-22T16:57:37.077850+08:00 [warning] iedu_9161a7851@42.84.45.101:53851 [Channel] The PUBCOMP PacketId 14901 is not found
2022-06-22T16:57:37.077949+08:00 [warning] iedu_9161a7851@42.84.45.101:53851 [Channel] The PUBCOMP PacketId 8762 is not found
2022-06-22T16:57:37.078031+08:00 [warning] iedu_9161a7851@42.84.45.101:53851 [Channel] The PUBCOMP PacketId 14901 is not found
2022-06-22T16:57:37.078103+08:00 [warning] iedu_9161a7851@42.84.45.101:53851 [Channel] The PUBACK PacketId 100 is not found.
2022-06-22T16:58:07.076474+08:00 [warning] iedu_9161a7851@42.84.45.101:53851 [Channel] The PUBACK PacketId 100 is not found.
2022-06-22T17:08:04.751521+08:00 [error] 101.251.194.51:49370 [MQTT] , Parse failed for function_clause, [{emqx_frame,parse_utf8_string,[<<1,1,32>>],[{file,“emqx_frame.erl”},{line,482}]},{emqx_frame,parse_packet,3,[{file,“emqx_frame.erl”},{line,225}]},{emqx_frame,parse_frame,4,[{file,“emqx_frame.erl”},{line,201}]},{emqx_connection,parse_incoming,3,[{file,“emqx_connection.erl”},{line,657}]},{emqx_connection,handle_msg,2,[{file,“emqx_connection.erl”},{line,650}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,396}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,360}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,236}]}], Frame data:<<22,3,1,1,32,1,0,1,28,3,3,106,234,221,222,222,139,46,45,122,132,98,226,64,23,239,221,149,23,208,153,108,219,252,42,165,0,98,41,145,208,237,216,32,27,210,5,205,72,21,52,241,35,128,12,154,89,88,198,89,123,77,4,155,255,90,240,138,119,14,56,198,42,251,80,34,0,62,19,2,19,3,19,1,192,44,192,48,0,159,204,169,204,168,204,170,192,43,192,…>>
2022-06-22T17:08:04.824505+08:00 [error] 101.251.194.51:43145 [MQTT] , Parse failed for function_clause, [{emqx_frame,parse_utf8_string,[<<1,0,189>>],[{file,“emqx_frame.erl”},{line,482}]},{emqx_frame,parse_packet,3,[{file,“emqx_frame.erl”},{line,225}]},{emqx_frame,parse_frame,4,[{file,“emqx_frame.erl”},{line,201}]},{emqx_connection,parse_incoming,3,[{file,“emqx_connection.erl”},{line,657}]},{emqx_connection,handle_msg,2,[{file,“emqx_connection.erl”},{line,650}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,396}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,360}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,236}]}], Frame data:<<22,3,1,0,189,1,0,0,185,3,3,139,219,141,180,242,30,12,18,117,100,45,170,188,90,79,75,117,46,97,226,169,102,139,110,222,171,76,248,72,233,119,210,0,0,56,192,44,192,48,0,159,204,169,204,168,204,170,192,43,192,47,0,158,192,36,192,40,0,107,192,35,192,39,0,103,192,10,192,20,0,57,192,9,192,19,0,51,0,157,0,156,0,61,0,60,0,53,0,…>>
2022-06-22T17:08:04.902787+08:00 [error] 101.251.194.51:59132 [MQTT] , Parse failed for function_clause, [{emqx_frame,parse_utf8_string,[<<1,0,99>>],[{file,“emqx_frame.erl”},{line,482}]},{emqx_frame,parse_packet,3,[{file,“emqx_frame.erl”},{line,225}]},{emqx_frame,parse_frame,4,[{file,“emqx_frame.erl”},{line,201}]},{emqx_connection,parse_incoming,3,[{file,“emqx_connection.erl”},{line,657}]},{emqx_connection,handle_msg,2,[{file,“emqx_connection.erl”},{line,650}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,396}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,360}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,236}]}], Frame data:<<22,3,1,0,99,1,0,0,95,3,2,53,43,147,190,76,92,146,72,131,233,136,202,130,4,149,166,181,117,77,71,107,164,100,121,81,21,192,96,61,147,208,238,0,0,18,192,10,192,20,0,57,192,9,192,19,0,51,0,53,0,47,0,255,1,0,0,36,0,11,0,4,3,0,1,2,0,10,0,12,0,10,0,29,0,23,0,30,0,25,0,24,0,35,0,0,0,22,0,…>>
2022-06-22T17:08:04.968775+08:00 [error] 101.251.194.51:49952 [MQTT] , Parse failed for function_clause, [{emqx_frame,parse_utf8_string,[<<1,0,99>>],[{file,“emqx_frame.erl”},{line,482}]},{emqx_frame,parse_packet,3,[{file,“emqx_frame.erl”},{line,225}]},{emqx_frame,parse_frame,4,[{file,“emqx_frame.erl”},{line,201}]},{emqx_connection,parse_incoming,3,[{file,“emqx_connection.erl”},{line,657}]},{emqx_connection,handle_msg,2,[{file,“emqx_connection.erl”},{line,650}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,396}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,360}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,236}]}], Frame data:<<22,3,1,0,99,1,0,0,95,3,1,35,113,214,63,111,159,198,103,201,235,249,128,137,17,46,23,41,86,112,39,232,174,219,229,74,76,183,84,12,81,143,52,0,0,18,192,10,192,20,0,57,192,9,192,19,0,51,0,53,0,47,0,255,1,0,0,36,0,11,0,4,3,0,1,2,0,10,0,12,0,10,0,29,0,23,0,30,0,25,0,24,0,35,0,0,0,22,0,…>>
2022-06-22T17:08:08.075856+08:00 [error] test@101.251.194.51:52427 [Auth http] Deny connection from path: /mqttauth/mqtt/auth, response http code: 403
2022-06-22T17:08:08.076045+08:00 [warning] test@101.251.194.51:52427 [Channel] Client test (Username: ‘undefined’) login failed for not_authorized
2022-06-22T17:25:53.055937+08:00 [error] iedu_9161a7851@42.84.45.101:51683 [WebHook] HTTP request error: timeout
2022-06-22T17:25:53.370002+08:00 [error] iedu_ser_1655889947057@121.196.28.130:58536 [WebHook] HTTP request error: timeout
2022-06-22T17:25:53.585632+08:00 [error] ehttpc: Received ‘gun_error’ message from unknown stream ref: #Ref<0.3794944198.3917742082.89768>
2022-06-22T17:25:53.586633+08:00 [error] ehttpc: Received ‘gun_error’ message from unknown stream ref: #Ref<0.3794944198.3918790657.90268>
2022-06-22T21:02:40.307361+08:00 [error] MqttClient@65.49.20.68:41518 [Auth http] Deny connection from path: /mqttauth/mqtt/auth, response http code: 403
2022-06-22T21:02:40.307573+08:00 [warning] MqttClient@65.49.20.68:41518 [Channel] Client MqttClient (Username: ‘undefined’) login failed for not_authorized
2022-06-22T21:45:39.764994+08:00 [error] CENSYS@167.248.133.63:52688 [Auth http] Deny connection from path: /mqttauth/mqtt/auth, response http code: 403
2022-06-22T21:45:39.765207+08:00 [warning] CENSYS@167.248.133.63:52688 [Channel] Client CENSYS (Username: ‘undefined’) login failed for not_authorized
2022-06-23T03:33:30.161282+08:00 [error] 91.240.118.237:58973 [MQTT] , Parse failed for function_clause, [{emqx_frame,parse_utf8_string,[<<0>>],[{file,“emqx_frame.erl”},{line,482}]},{emqx_frame,parse_packet,3,[{file,“emqx_frame.erl”},{line,225}]},{emqx_frame,parse_frame,4,[{file,“emqx_frame.erl”},{line,201}]},{emqx_connection,parse_incoming,3,[{file,“emqx_connection.erl”},{line,657}]},{emqx_connection,handle_msg,2,[{file,“emqx_connection.erl”},{line,650}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,396}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,360}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,236}]}], Frame data:<<18,1,0,52,0,0,1,0,0,0,21,0,6,1,0,27,0,1,2,0,28,0,12,3,0,40,0,4,255,8,0,1,85,0,0,0,77,83,83,81,76,83,101,114,118,101,114,0,201,183,0,0>>
2022-06-23T08:11:44.031105+08:00 [error] 180.149.125.171:5592 [MQTT] , Parse failed for function_clause, [{emqx_frame,parse_packet,[{mqtt_packet_header,4,false,3,true},<<“T / HTTP/1.1\r\nHost: 121.196.28.130:1883\r\nUser-Agent: Mozilla/5.0 (Win”>>,#{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,657}]},{emqx_connection,handle_msg,2,[{file,“emqx_connection.erl”},{line,650}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,396}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,360}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,236}]}], Frame data:<<“GET / HTTP/1.1\r\nHost: 121.196.28.130:1883\r\nUser-Agent: Mozilla/5.0 (Windows NT 5.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36\r\nAccept: /\r\nAccept-Encoding: gzip\r\n\r\n”>>
2022-06-23T08:47:32.194835+08:00 [error] MqttClient@65.49.20.69:18876 [Auth http] Deny connection from path: /mqttauth/mqtt/auth, response http code: 403
2022-06-23T08:47:32.195056+08:00 [warning] MqttClient@65.49.20.69:18876 [Channel] Client MqttClient (Username: ‘undefined’) login failed for not_authorized
2022-06-23T09:33:39.001220+08:00 [error] WX@161.189.192.94:53404 [Auth http] Deny connection from path: /mqttauth/mqtt/auth, response http code: 403
2022-06-23T09:33:39.001471+08:00 [warning] WX@161.189.192.94:53404 [Channel] Client WX (Username: ‘undefined’) login failed for not_authorized
2022-06-23T09:35:09.045413+08:00 [error] 161.189.192.94:40698 [MQTT] , Parse failed for function_clause, [{emqx_frame,parse_utf8_string,[<<“376664383365633861643436333364396336396238653665353”>>],[{file,“emqx_frame.erl”},{line,482}]},{emqx_frame,parse_packet,3,[{file,“emqx_frame.erl”},{line,267}]},{emqx_frame,parse_frame,4,[{file,“emqx_frame.erl”},{line,201}]},{emqx_connection,parse_incoming,3,[{file,“emqx_connection.erl”},{line,657}]},{emqx_connection,handle_msg,2,[{file,“emqx_connection.erl”},{line,650}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,396}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,360}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,236}]}], Frame data:<<“333766643833656338616434363333643963363962386536653538383937393235613033653338636434”>>
2022-06-23T10:02:50.626994+08:00 [error] iedu_9161a7851@42.84.45.101:60489 [WebHook] HTTP request error: timeout
2022-06-23T10:02:50.938985+08:00 [error] iedu_ser_1655949764627@121.196.28.130:50558 [WebHook] HTTP request error: timeout
2022-06-23T10:02:51.167010+08:00 [error] ehttpc: Received ‘gun_error’ message from unknown stream ref: #Ref<0.3794944198.3918266370.168052>
2022-06-23T10:02:51.167207+08:00 [error] ehttpc: Received ‘gun_error’ message from unknown stream ref: #Ref<0.3794944198.3919314945.155465>
2022-06-23T12:23:14.506819+08:00 [error] 101.133.143.217:48918 [MQTT] , Parse failed for function_clause, [{emqx_frame,parse_utf8_string,[<<3,0,136>>],[{file,“emqx_frame.erl”},{line,482}]},{emqx_frame,parse_packet,3,[{file,“emqx_frame.erl”},{line,225}]},{emqx_frame,parse_frame,4,[{file,“emqx_frame.erl”},{line,201}]},{emqx_connection,parse_incoming,3,[{file,“emqx_connection.erl”},{line,657}]},{emqx_connection,handle_msg,2,[{file,“emqx_connection.erl”},{line,650}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,396}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,360}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,236}]}], Frame data:<<22,3,3,0,136,1,0,0,132,3,3,98,179,234,178,215,143,33,16,232,219,14,200,147,205,187,116,140,159,25,91,161,125,0,61,127,10,109,178,218,241,0,78,0,0,22,192,20,0,53,192,19,0,47,192,44,192,43,192,48,0,157,192,47,0,156,0,10,1,0,0,69,0,10,0,22,0,20,0,23,0,24,0,25,0,9,0,10,0,11,0,12,0,13,0,14,0,22,0,…>>
2022-06-23T22:46:43.091060+08:00 [error] CENSYS@162.142.125.211:44064 [Auth http] Deny connection from path: /mqttauth/mqtt/auth, response http code: 403
2022-06-23T22:46:43.091284+08:00 [warning] CENSYS@162.142.125.211:44064 [Channel] Client CENSYS (Username: ‘undefined’) login failed for not_authorized
2022-06-24T03:37:23.705372+08:00 [error] CENSYS@167.94.138.61:48762 [Auth http] Deny connection from path: /mqttauth/mqtt/auth, response http code: 403
2022-06-24T03:37:23.705588+08:00 [warning] CENSYS@167.94.138.61:48762 [Channel] Client CENSYS (Username: ‘undefined’) login failed for not_authorized
2022-06-24T11:45:58.762514+08:00 [error] MqttClient@184.105.139.69:56710 [Auth http] Deny connection from path: /mqttauth/mqtt/auth, response http code: 403
2022-06-24T11:45:58.762761+08:00 [warning] MqttClient@184.105.139.69:56710 [Channel] Client MqttClient (Username: ‘undefined’) login failed for not_authorized
2022-06-24T14:51:28.624686+08:00 [error] iedu_9161a7851@116.3.197.73:49317 [WebHook] HTTP request error: timeout
2022-06-24T14:51:28.933981+08:00 [error] iedu_ser_1656053482623@121.196.28.130:51644 [WebHook] HTTP request error: timeout
2022-06-24T14:51:29.105746+08:00 [error] ehttpc: Received ‘gun_error’ message from unknown stream ref: #Ref<0.3794944198.3920363521.183987>
2022-06-24T14:51:29.105974+08:00 [error] ehttpc: Received ‘gun_error’ message from unknown stream ref: #Ref<0.3794944198.3920363521.183998>