数据桥接webhook报错,需要点击更新后才正常

环境信息

  • EMQ X 版本:v5.0.14
  • 操作系统及版本:centos7
  • 其他

问题描述

配置文件及日志

emqx5 | 2023-02-17T10:28:04.111823+08:00 [error] crasher: initial call: gun:proc_lib_hack/5, pid: <0.25284.3>, registered_name: [], exit: {{function_clause,[{gun_http,request,[{http_state,<0.2515.0>,#Port<0.25156>,gun_tcp,‘HTTP/1.1’,[gun_data_h],keepalive,<<>>,[{stream,#Ref<0.3324919381.1989672961.137541>,<0.2515.0>,<<“POST”>>,true,undefined}],head,{0,0},body_chunked,#Fun<gun_http.0.8701081>},#Ref<0.3324919381.1989672961.141745>,<0.2515.0>,<<“POST”>>,“api”,8091,<<“/api/mqtt/webhook”>>,[{<<“keep-alive”>>,<<“timeout=5”>>},{<<“content-type”>>,<<“application/json”>>},{<<“connection”>>,<<“keep-alive”>>},{<<“cache-control”>>,<<“no-cache”>>},{<<“accept”>>,<<“application/json”>>}]],[{file,“gun_http.erl”},{line,332}]},{gun,loop,1,[{file,“gun.erl”},{line,795}]},{gun,proc_lib_hack,5,[{file,“gun.erl”},{line,649}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]},[{gun,proc_lib_hack,5,[{file,“gun.erl”},{line,654}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]}, ancestors: [gun_sup,<0.1961.0>], message_queue_len: 0, messages: [], links: [<0.1962.0>,#Port<0.25156>], dictionary: [], trap_exit: false, status: running, heap_size: 987, stack_size: 29, reductions: 1149; neighbours:

emqx5 | 2023-02-17T10:28:04.112318+08:00 [error] Supervisor: {local,gun_sup}. Context: child_terminated. Reason: {function_clause,[{gun_http,request,[{http_state,<0.2515.0>,#Port<0.25156>,gun_tcp,‘HTTP/1.1’,[gun_data_h],keepalive,<<>>,[{stream,#Ref<0.3324919381.1989672961.137541>,<0.2515.0>,<<“POST”>>,true,undefined}],head,{0,0},body_chunked,#Fun<gun_http.0.8701081>},#Ref<0.3324919381.1989672961.141745>,<0.2515.0>,<<“POST”>>,“api”,8091,<<“/api/mqtt/webhook”>>,[{<<“keep-alive”>>,<<“timeout=5”>>},{<<“content-type”>>,<<“application/json”>>},{<<“connection”>>,<<“keep-alive”>>},{<<“cache-control”>>,<<“no-cache”>>},{<<“accept”>>,<<“application/json”>>}]],[{file,“gun_http.erl”},{line,332}]},{gun,loop,1,[{file,“gun.erl”},{line,795}]},{gun,proc_lib_hack,5,[{file,“gun.erl”},{line,649}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]}. Offender: id=gun,pid=<0.25284.3>.

接收请求的服务端报错截图:

规避手段:进控制台->数据桥接->什么都不动,点击规则 更新 然后就正常了

你好,这应该是一个 Bug,但是我不确定是怎么引起的,我们会尽快调查一下

方便提供一下 WebHook 桥接的配置吗?

你好 配置如下: 容器部署的

EMQX_BRIDGES__WEBHOOK__WEB_SERVER={url="http://api:8091/api/mqtt/webhook",body=""}
EMQX_RULE_ENGINE__RULES__RULE_A={actions=["webhook:web_server"],sql = "SELECT * FROM \"$events/client_connected\",\"$events/client_disconnected\"",description="终端连接成功/断开事件"}
EMQX_RULE_ENGINE__RULES__RULE_B={actions=["webhook:web_server"],sql = "SELECT * FROM \"$events/message_delivered\" WHERE topic =~ \"t/#\"",description="消息已投递"}
EMQX_RULE_ENGINE__RULES__RULE_C={actions=["webhook:web_server"],sql = "SELECT * FROM \"$events/message_acked\" WHERE topic =~ \"testtopic/#\"",description="消息应答"}

你好,请问一下 这问题有进展吗, 我自己试了下 最新版本 错误依旧,但是降级为5.0.13就正常了

你好,已经确认是 Bug 了,最快也需要在下一版本中修复。

我确认了一下,5.0.13 和 5.0.17 这部分的代码是一致的,所以不应该会出现这种情况才对。你的 HTTP Server 没有任何变更吗?

是的,没做变更。5.0.13 确实不会出现这个问题

了解,我也一并反馈给研发团队。目前只能麻烦您先使用 5.0.13 了。修复后我会及时和你同步。