From 2a348c812c4eae355fd3b47a689e16e8fe7d33a8 Mon Sep 17 00:00:00 2001 From: zhongwencool Date: Thu, 19 May 2022 11:21:57 +0800 Subject: [PATCH 1/9] chore: show more error msg when check_erlang_start failed --- bin/emqx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/emqx b/bin/emqx index a3843ec7e..756d2f705 100755 --- a/bin/emqx +++ b/bin/emqx @@ -37,15 +37,15 @@ assert_node_alive() { fi } -check_eralng_start() { - "$BINDIR/$PROGNAME" -noshell -boot "$REL_DIR/start_clean" -s crypto start -s init stop +check_erlang_start() { + "$BINDIR/$PROGNAME" -boot "$REL_DIR/start_clean" -eval "crypto:start(),halt()" } -if ! check_eralng_start >/dev/null 2>&1; then +if ! check_erlang_start >/dev/null 2>&1; then BUILT_ON="$(head -1 "${REL_DIR}/BUILT_ON")" ## failed to start, might be due to missing libs, try to be portable export LD_LIBRARY_PATH="$DYNLIBS_DIR:$LD_LIBRARY_PATH" - if ! check_eralng_start; then + if ! check_erlang_start; then ## it's hopeless echoerr "FATAL: Unable to start Erlang." echoerr "Please make sure openssl-1.1.1 (libcrypto) and libncurses are installed." From e57e2f68d4cf6332079a94f516458b45442a74b4 Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Fri, 20 May 2022 16:14:23 -0300 Subject: [PATCH 2/9] fix(mgmt): allow binding to specific interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When one tries to define the management http listener as, for example, `172.25.0.2:8081`, ranch is given `{port, {"172.25.0.2",8081}}` and breaks. ```sh env EMQX_MANAGEMENT__LISTENER__HTTP=172.25.0.2:8081 make quickrun ``` ``` 2022-05-20T13:14:19.451272-03:00 [error] Supervisor: {<0.2485.0>,ranch_listener_sup}. Context: start_error. Reason: badarg. Offender: id=ranch_acceptors_sup,pid=undefined. 2022-05-20T13:14:19.451400-03:00 [error] crasher: initial call: supervisor:ranch_acceptors_sup/1, pid: <0.2487.0>, registered_name: [], exit: {badarg,[{inet_tcp,listen,2,[{file,"inet_tcp.erl"},{line,166}]},{ranch_acceptors_sup,init,1,[{file,"ranch_acceptors_sup.erl"},{line,39}]},{supervisor,init,1,[{file,"supervisor.erl"},{line,330}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,423}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,390}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,226}]}]}, ancestors: [<0.2485.0>,ranch_sup,<0.2187.0>], message_queue_len: 0, messages: [], links: [<0.2485.0>], dictionary: [{logger,error_logger}], trap_exit: true, status: running, heap_size: 610, stack_size: 29, reductions: 612; neighbours: 2022-05-20T13:14:19.451754-03:00 [error] Minirest(Handler): Start http:management listener on {"172.25.0.2",8081} unsuccessfully: ``` So, it’s currently not possible to make the management listener bind to a specific interface. --- apps/emqx_management/priv/emqx_management.schema | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/emqx_management/priv/emqx_management.schema b/apps/emqx_management/priv/emqx_management.schema index 343a70de6..a30a20e4d 100644 --- a/apps/emqx_management/priv/emqx_management.schema +++ b/apps/emqx_management/priv/emqx_management.schema @@ -227,6 +227,13 @@ end}. Prefix = "management.listener." ++ atom_to_list(Proto), case cuttlefish:conf_get(Prefix, Conf, undefined) of undefined -> Acc; + {IPStr, Port} -> + {ok, IP} = inet:parse_address(IPStr), + [{Proto, Port, [{ip, IP}] ++ TcpOpts(Prefix) ++ Opts(Prefix) + ++ case Proto of + http -> []; + https -> SslOpts(Prefix) + end} | Acc]; Port -> [{Proto, Port, TcpOpts(Prefix) ++ Opts(Prefix) ++ case Proto of @@ -236,4 +243,3 @@ end}. end end, [], [http, https]) end}. - From e73cd57b5a1e046d80b826625dd0572cd766837a Mon Sep 17 00:00:00 2001 From: DDDHuang <44492639+DDDHuang@users.noreply.github.com> Date: Mon, 23 May 2022 14:35:23 +0800 Subject: [PATCH 3/9] fix: epgsql use emqx fork --- apps/emqx_auth_pgsql/rebar.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/emqx_auth_pgsql/rebar.config b/apps/emqx_auth_pgsql/rebar.config index be395993b..7a6aaf411 100644 --- a/apps/emqx_auth_pgsql/rebar.config +++ b/apps/emqx_auth_pgsql/rebar.config @@ -1,5 +1,5 @@ {deps, - [{epgsql, {git, "https://github.com/epgsql/epgsql.git", {tag, "4.6.0"}}} + [{epgsql, {git, "https://github.com/emqx/epgsql.git", {tag, "4.6.0"}}} ]}. {erl_opts, [warn_unused_vars, From 6dcdb58482b5469899be290e4e899fa9d88d08b8 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Mon, 23 May 2022 11:39:29 +0200 Subject: [PATCH 4/9] docs: add missing docs for changes made in bin/emqx and upgrade script --- CHANGES-4.3.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES-4.3.md b/CHANGES-4.3.md index b74eae09e..53ceb8c0c 100644 --- a/CHANGES-4.3.md +++ b/CHANGES-4.3.md @@ -14,6 +14,8 @@ File format: ### Enhancements +* Refactored `bin/emqx` help messages. +* Upgrade script refuses upgrade from incompatible versions. (e.g. hot upgrade from 4.3 to 4.4 will fail fast). * Made possible for EMQX to boot from a Linux directory which has white spaces in its path. * Add support for JWT authorization [#7596] Now MQTT clients may be authorized with respect to a specific claim containing publish/subscribe topic whitelists. From c93626e97f976a9d1a31a060c576984dc00a2441 Mon Sep 17 00:00:00 2001 From: JianBo He Date: Mon, 23 May 2022 18:05:41 +0800 Subject: [PATCH 5/9] chore: update changes and appup.src for emqx_management --- CHANGES-4.3.md | 1 + apps/emqx_management/src/emqx_management.appup.src | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES-4.3.md b/CHANGES-4.3.md index b74eae09e..2a4715a7a 100644 --- a/CHANGES-4.3.md +++ b/CHANGES-4.3.md @@ -24,6 +24,7 @@ File format: * Mnesia auth/acl http api support multiple condition queries. * Inflight QoS1 Messages for shared topics are now redispatched to another alive subscribers upon chosen subscriber session termination. * Make auth metrics name more understandable. +* Allow emqx_management http listener binding to specific interface [#8005] ### Bug fixes * List subscription topic (/api/v4/subscriptions), the result do not match with multiple conditions. diff --git a/apps/emqx_management/src/emqx_management.appup.src b/apps/emqx_management/src/emqx_management.appup.src index 9265913e6..15aef0463 100644 --- a/apps/emqx_management/src/emqx_management.appup.src +++ b/apps/emqx_management/src/emqx_management.appup.src @@ -1,13 +1,13 @@ %% -*- mode: erlang -*- {VSN, - [ {<<"4\\.3\\.([0-9]|1[0-2])">>, + [ {<<"4\\.3\\.([0-9]|1[0-4])">>, [ {apply,{minirest,stop_http,['http:management']}}, {apply,{minirest,stop_http,['https:management']}}, {restart_application, emqx_management} ]}, {<<".*">>, []} ], - [ {<<"4\\.3\\.([0-9]|1[0-2])">>, + [ {<<"4\\.3\\.([0-9]|1[0-4])">>, [ {apply,{minirest,stop_http,['http:management']}}, {apply,{minirest,stop_http,['https:management']}}, {restart_application, emqx_management} From 2b81839126c92c0a54f930b6aa112992f849a376 Mon Sep 17 00:00:00 2001 From: JianBo He Date: Mon, 23 May 2022 20:21:21 +0800 Subject: [PATCH 6/9] chore(pgsql): restart emqx_auth_pgsql due to the egpsql upgraded We have to restart the emqx_auth_pgsql because epgsql has upgraded 4.4.0 to 4.6.0 see: #8001 --- .../src/emqx_auth_pgsql.appup.src | 26 +++++-------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/apps/emqx_auth_pgsql/src/emqx_auth_pgsql.appup.src b/apps/emqx_auth_pgsql/src/emqx_auth_pgsql.appup.src index d1c10d6fa..494cc94c9 100644 --- a/apps/emqx_auth_pgsql/src/emqx_auth_pgsql.appup.src +++ b/apps/emqx_auth_pgsql/src/emqx_auth_pgsql.appup.src @@ -1,25 +1,11 @@ %% -*- mode: erlang -*- %% Unless you know what you are doing, DO NOT edit manually!! {VSN, - [{<<"4\\.3\\.[1-2]">>, - %% epgsql 4.4.0 -> 4.6.0. - %% epgsql has no appup ,so we can only restart it. - [{restart_application,epgsql}, - {load_module,emqx_auth_pgsql_app,brutal_purge,soft_purge,[]}, - {load_module,emqx_auth_pgsql,brutal_purge,soft_purge,[]}]}, - {"4.3.0", - [{restart_application,epgsql}, - {load_module,emqx_auth_pgsql_app,brutal_purge,soft_purge,[]}, - {load_module,emqx_auth_pgsql,brutal_purge,soft_purge,[]}, - {load_module,emqx_acl_pgsql,brutal_purge,soft_purge,[]}]}, + [{<<"4\\.3\\.[0-2]">>, + %% restart it due to epgsql upgraded from 4.4.0 to 4.6.0 + %% in emqx_auth_pgsql:v4.3.3 + [{restart_application,emqx_auth_pgsql}]}, {<<".*">>,[]}], - [{<<"4\\.3\\.[1-2]">>, - [{restart_application,epgsql}, - {load_module,emqx_auth_pgsql_app,brutal_purge,soft_purge,[]}, - {load_module,emqx_auth_pgsql,brutal_purge,soft_purge,[]}]}, - {"4.3.0", - [{load_module,emqx_auth_pgsql,brutal_purge,soft_purge,[]}, - {restart_application,epgsql}, - {load_module,emqx_auth_pgsql_app,brutal_purge,soft_purge,[]}, - {load_module,emqx_acl_pgsql,brutal_purge,soft_purge,[]}]}, + [{<<"4\\.3\\.[0-2]">>, + [{restart_application,emqx_auth_pgsql}]}, {<<".*">>,[]}]}. From 95d613e204331e5b88c69b74895bcc31e6dd0ac8 Mon Sep 17 00:00:00 2001 From: JianBo He Date: Mon, 23 May 2022 21:48:26 +0800 Subject: [PATCH 7/9] chore: pretty change logs --- CHANGES-4.3.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGES-4.3.md b/CHANGES-4.3.md index 2a4715a7a..447593250 100644 --- a/CHANGES-4.3.md +++ b/CHANGES-4.3.md @@ -25,14 +25,13 @@ File format: * Inflight QoS1 Messages for shared topics are now redispatched to another alive subscribers upon chosen subscriber session termination. * Make auth metrics name more understandable. * Allow emqx_management http listener binding to specific interface [#8005] +* Add rule-engine function float2str/2, user can specify the float output precision [#7991] ### Bug fixes * List subscription topic (/api/v4/subscriptions), the result do not match with multiple conditions. * SSL closed error bug fixed for redis client. * Fix mqtt-sn client disconnected due to re-send a duplicated qos2 message * Rule-engine function hexstr2bin/1 support half byte [#7977] -* Add rule-engine function float2str/2, user can specify the float output precision [#7991] - * Improved resilience against autocluster partitioning during cluster startup. [#7876] [ekka-158](https://github.com/emqx/ekka/pull/158) From 41331c5c1ae24574d0639789286f198453a9ca35 Mon Sep 17 00:00:00 2001 From: Shawn <506895667@qq.com> Date: Mon, 23 May 2022 22:26:20 +0800 Subject: [PATCH 8/9] chore: release 4.3.15-rc.1 --- include/emqx_release.hrl | 2 +- scripts/get-dashboard.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/emqx_release.hrl b/include/emqx_release.hrl index 5145f7b5e..3945b3869 100644 --- a/include/emqx_release.hrl +++ b/include/emqx_release.hrl @@ -29,7 +29,7 @@ -ifndef(EMQX_ENTERPRISE). --define(EMQX_RELEASE, {opensource, "4.3.14"}). +-define(EMQX_RELEASE, {opensource, "4.3.15-rc.1"}). -else. diff --git a/scripts/get-dashboard.sh b/scripts/get-dashboard.sh index abe8e2415..62467420c 100755 --- a/scripts/get-dashboard.sh +++ b/scripts/get-dashboard.sh @@ -9,7 +9,7 @@ PKG_VSN="${PKG_VSN:-$(./pkg-vsn.sh)}" case "${PKG_VSN}" in 4.3*) EMQX_CE_DASHBOARD_VERSION='v4.3.7' - EMQX_EE_DASHBOARD_VERSION='v4.3.18' + EMQX_EE_DASHBOARD_VERSION='v4.3.19' ;; *) echo "Unsupported version $PKG_VSN" >&2 From 433d74254e4d42f1dfacc5029d04a45aa3815520 Mon Sep 17 00:00:00 2001 From: Shawn <506895667@qq.com> Date: Mon, 23 May 2022 23:24:32 +0800 Subject: [PATCH 9/9] chore: dashboard v4.4.10 --- scripts/get-dashboard.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/get-dashboard.sh b/scripts/get-dashboard.sh index f2e8e0a28..6d94bae58 100755 --- a/scripts/get-dashboard.sh +++ b/scripts/get-dashboard.sh @@ -14,7 +14,7 @@ case "${PKG_VSN}" in 4.4*) # keep the above 4.3 untouched, otherwise conflicts! EMQX_CE_DASHBOARD_VERSION='v4.4.2' - EMQX_EE_DASHBOARD_VERSION='v4.4.9' + EMQX_EE_DASHBOARD_VERSION='v4.4.10' ;; *) echo "Unsupported version $PKG_VSN" >&2