diff --git a/apps/emqx_bridge/src/emqx_bridge_api.erl b/apps/emqx_bridge/src/emqx_bridge_api.erl index 7a03b24ca..57933029d 100644 --- a/apps/emqx_bridge/src/emqx_bridge_api.erl +++ b/apps/emqx_bridge/src/emqx_bridge_api.erl @@ -985,9 +985,13 @@ call_operation(NodeOrAll, OperFunc, Args = [_Nodes, BridgeType, BridgeName]) -> {error, timeout} -> ?SERVICE_UNAVAILABLE(<<"Request timeout">>); {error, {start_pool_failed, Name, Reason}} -> - ?SERVICE_UNAVAILABLE( - bin(io_lib:format("Failed to start ~p pool for reason ~p", [Name, Reason])) - ); + Msg = bin(io_lib:format("Failed to start ~p pool for reason ~p", [Name, Reason])), + case Reason of + nxdomain -> + ?BAD_REQUEST(Msg); + _ -> + ?SERVICE_UNAVAILABLE(Msg) + end; {error, not_found} -> BridgeId = emqx_bridge_resource:bridge_id(BridgeType, BridgeName), ?SLOG(warning, #{ diff --git a/apps/emqx_mysql/rebar.config b/apps/emqx_mysql/rebar.config index 58b6665ad..668e437f3 100644 --- a/apps/emqx_mysql/rebar.config +++ b/apps/emqx_mysql/rebar.config @@ -3,7 +3,7 @@ {erl_opts, [debug_info]}. {deps, [ %% NOTE: mind ecpool version when updating eredis_cluster version - {mysql, {git, "https://github.com/emqx/mysql-otp", {tag, "1.7.2"}}}, + {mysql, {git, "https://github.com/emqx/mysql-otp", {tag, "1.7.3"}}}, {emqx_connector, {path, "../../apps/emqx_connector"}}, {emqx_resource, {path, "../../apps/emqx_resource"}} ]}. diff --git a/changes/ee/fix-11175.en.md b/changes/ee/fix-11175.en.md new file mode 100644 index 000000000..24a9def70 --- /dev/null +++ b/changes/ee/fix-11175.en.md @@ -0,0 +1 @@ +Now when using a nonexistent hostname for connecting to MySQL will result in a 400 error rather than 503 in the HTTP API.