emqx5.0http认证接口有时可以自动跳转有时无法自动跳转

错误报告

2022-12-26T14:29:28.396856+08:00 [warning] action: <<“webhook:my1”>>, clientid: pins-mqx1, line: 333, mfa: emqx_rule_runtime:handle_action/4, msg: out_of_service, peername: 10.1.0.99:50539
2022-12-26T14:29:28.397351+08:00 [warning] action: <<“webhook:webhook_con_discon”>>, clientid: pins-mqx1, line: 333, mfa: emqx_rule_runtime:handle_action/4, msg: out_of_service, peername: 10.1.0.99:50539
2022-12-26T14:29:32.484924+08:00 [error] line: 341, mfa: emqx_connector_http:do_get_status/2, msg: ehttpc_health_check_failed, reason: econnrefused, worker: <0.21404.8>
2022-12-26T14:29:32.484900+08:00 [error] line: 341, mfa: emqx_connector_http:do_get_status/2, msg: ehttpc_health_check_failed, reason: econnrefused, worker: <0.21408.8>
2022-12-26T14:29:32.485049+08:00 [error] line: 341, mfa: emqx_connector_http:do_get_status/2, msg: ehttpc_health_check_failed, reason: econnrefused, worker: <0.21407.8>
2022-12-26T14:29:32.485114+08:00 [error] line: 341, mfa: emqx_connector_http:do_get_status/2, msg: ehttpc_health_check_failed, reason: econnrefused, worker: <0.21403.8>
2022-12-26T14:29:32.486158+08:00 [error] line: 341, mfa: emqx_connector_http:do_get_status/2, msg: ehttpc_health_check_failed, reason: econnrefused, worker: <0.21406.8>
2022-12-26T14:29:32.486413+08:00 [error] line: 341, mfa: emqx_connector_http:do_get_status/2, msg: ehttpc_health_check_failed, reason: econnrefused, worker: <0.21410.8>
2022-12-26T14:29:33.518070+08:00 [error] line: 341, mfa: emqx_connector_http:do_get_status/2, msg: ehttpc_health_check_failed, reason: econnrefused, worker: <0.21405.8>
2022-12-26T14:29:33.518047+08:00 [error] line: 341, mfa: emqx_connector_http:do_get_status/2, msg: ehttpc_health_check_failed, reason: econnrefused, worker: <0.21409.8>
2022-12-26T14:29:33.518513+08:00 [error] line: 325, mfa: emqx_connector_http:on_get_status/2, msg: http_connector_get_status_failed, state: #{base_path => “/”,connect_timeout => 5000,host => {10,1,0,99},pool_name => ‘emqx_authn_http:6:5961’,port => 8088,request => undefined}
2022-12-26T14:29:33.518943+08:00 [warning] line: 411, message: <<“resource down: emqx_authn_http:6”>>, mfa: emqx_alarm:do_actions/3, msg: alarm_is_activated, name: <<“emqx_authn_http:6”>>
2022-12-26T14:29:33.519357+08:00 [error] id: <<“emqx_authn_http:6”>>, line: 491, mfa: emqx_resource_manager:handle_connected_health_check/1, msg: health_check_failed, status: disconnected
2022-12-26T14:29:39.605747+08:00 [warning] line: 417, mfa: emqx_alarm:do_actions/3, msg: alarm_is_deactivated, name: <<“emqx_authn_http:6”>>

环境

  • EMQX 版本:emqx-5.0.8
  • 操作系统版本:CentOS Linux release 7.4.1708 (Core)

重现此问题的步骤

  1. 项目中编写了连接emqx的代码(连接代码执行时机是项目启动后自动执行),并且该项目中编写了http认证接口
  2. Dashboard开启了http认证,对应认证url就是项目里编写的认证接口url
  3. 启动项目,有时可以自动跳转到认证接口,有时没有跳转到认证接口报错信息如上

预期行为

预期:因为连接代码是项目启动后执行的那么认证接口也已经启动了预期是项目启动后执行连接代码时跳转到认证接口

实际行为

有时可以自动跳转认证接口连接上了,有时没有进行跳转显示无权连接,请问是什么原因导致的呢?

连接被拒绝,你得检查下 HTTP Server 的配置,是不是限制了最大连接数或者连接频率

这些都没问题的,只有我这一个项目去连接emqx连接数是1。但是问题是多次启动项目有时候可以跳转到认证接口有时候就无法跳转。会不会还有什么其他原因导致呢?

这个就不清楚了,你 HTTP Server 的情况我也不了解…

请问一下,emqx5.0 http认证时可以给某个客户端设置白名单让他不用进行验证就能连接吗?

你可以让这些客户端连到另外一个端口上去,然后那个端口上不启用认证就可以了