diff --git a/deps/rabbitmq_amqp1_0/BUILD.bazel b/deps/rabbitmq_amqp1_0/BUILD.bazel index 3c5a1d767c07..8880ca385337 100644 --- a/deps/rabbitmq_amqp1_0/BUILD.bazel +++ b/deps/rabbitmq_amqp1_0/BUILD.bazel @@ -30,6 +30,7 @@ rabbitmq_app( app_description = APP_DESCRIPTION, app_name = APP_NAME, beam_files = [":beam_files"], + extra_apps = ["rabbit"], license_files = [":license_files"], priv = [":priv"], deps = [ diff --git a/deps/rabbitmq_ct_client_helpers/BUILD.bazel b/deps/rabbitmq_ct_client_helpers/BUILD.bazel index 8fa9dfa34f41..1141dd990501 100644 --- a/deps/rabbitmq_ct_client_helpers/BUILD.bazel +++ b/deps/rabbitmq_ct_client_helpers/BUILD.bazel @@ -33,6 +33,7 @@ rabbitmq_app( hdrs = [":public_hdrs"], app_name = "rabbitmq_ct_client_helpers", beam_files = [":beam_files"], + extra_apps = ["rabbit_common"], license_files = [":license_files"], priv = [":priv"], deps = [ diff --git a/deps/rabbitmq_ct_helpers/BUILD.bazel b/deps/rabbitmq_ct_helpers/BUILD.bazel index 1002b4289a8a..c4319137c279 100644 --- a/deps/rabbitmq_ct_helpers/BUILD.bazel +++ b/deps/rabbitmq_ct_helpers/BUILD.bazel @@ -39,6 +39,7 @@ rabbitmq_app( hdrs = [":public_hdrs"], app_name = "rabbitmq_ct_helpers", beam_files = [":beam_files"], + extra_apps = ["inet_tcp_proxy"], license_files = [":license_files"], priv = [":priv"], deps = [ diff --git a/deps/rabbitmq_management/src/rabbit_mgmt_util.erl b/deps/rabbitmq_management/src/rabbit_mgmt_util.erl index 62b3aa4be508..68ef793c1cba 100644 --- a/deps/rabbitmq_management/src/rabbit_mgmt_util.erl +++ b/deps/rabbitmq_management/src/rabbit_mgmt_util.erl @@ -750,8 +750,9 @@ do_read_complete_body_with_limit(Req0, Acc, BodySizeLimit) -> with_decode(Keys, ReqData, Context, Fun) -> case read_complete_body(ReqData) of - {error, Reason} -> - bad_request(Reason, ReqData, Context); + {error, http_body_limit_exceeded, LimitApplied, BytesRead} -> + rabbit_log:warning("HTTP API: request exceeded maximum allowed payload size (limit: ~tp bytes, payload size: ~tp bytes)", [LimitApplied, BytesRead]), + bad_request("Exceeded HTTP request body size limit", ReqData, Context); {ok, Body, ReqData1} -> with_decode(Keys, Body, ReqData1, Context, Fun) end. diff --git a/deps/rabbitmq_management/src/rabbit_mgmt_wm_definitions.erl b/deps/rabbitmq_management/src/rabbit_mgmt_wm_definitions.erl index c0ad53826194..3790ca97b90c 100644 --- a/deps/rabbitmq_management/src/rabbit_mgmt_wm_definitions.erl +++ b/deps/rabbitmq_management/src/rabbit_mgmt_wm_definitions.erl @@ -86,10 +86,10 @@ all_definitions(ReqData, Context) -> accept_json(ReqData0, Context) -> BodySizeLimit = application:get_env(rabbitmq_management, max_http_body_size, ?MANAGEMENT_DEFAULT_HTTP_MAX_BODY_SIZE), case rabbit_mgmt_util:read_complete_body_with_limit(ReqData0, BodySizeLimit) of - {error, Reason} -> - _ = rabbit_log:warning("HTTP API: uploaded definition file exceeded the maximum request body limit of ~p bytes. " - "Use the 'management.http.max_body_size' key in rabbitmq.conf to increase the limit if necessary", [BodySizeLimit]), - rabbit_mgmt_util:bad_request(Reason, ReqData0, Context); + {error, http_body_limit_exceeded, LimitApplied, BytesRead} -> + _ = rabbit_log:warning("HTTP API: uploaded definition file size (~tp) exceeded the maximum request body limit of ~tp bytes. " + "Use the 'management.http.max_body_size' key in rabbitmq.conf to increase the limit if necessary", [BytesRead, LimitApplied]), + rabbit_mgmt_util:bad_request("Exceeded HTTP request body size limit", ReqData0, Context); {ok, Body, ReqData} -> accept(Body, ReqData, Context) end.