Commit Graph

100 Commits

Author SHA1 Message Date
Thales Macedo Garitezi 10ef87c0bc fix(install_upgrade): check target version when unpacking (v4.3)
We already have a check to avoid upgrading from 4.3 to 4.4:

```
  Cannot upgrade/downgrade to 4.4.11-rc.3 from 4.3.17
  We only support relup between patch versions
  escript: exception error: {relup_not_allowed,unsupported_target_version}
    in function  install_upgrade_escript__escript__1670__7364__537878__24:validate_target_version/2 (/usr/lib/emqx/bin/install_upgrade.escript, line 444)
    in call from install_upgrade_escript__escript__1670__7364__537878__24:install/2 (/usr/lib/emqx/bin/install_upgrade.escript, line 58)
    in call from escript:run/2 (escript.erl, line 758)
    in call from escript:start/1 (escript.erl, line 277)
    in call from init:start_em/1
    in call from init:do_boot/3
```

But such check is missing for `unpack`, which may result in an
unusable node after just unpacking:

```
emqx@d70cfe0e8e62:~$ emqx ctl status
ERROR: node_is_not_running!
```

The issue apparently arises from `nodetool` trying to use the
`compiler` lib from the newer version rather than the old one:

```
  + ERL_FLAGS=' -start_epmd false -epmd_module ekka_epmd -proto_dist ekka'
  + /usr/lib/emqx/erts-11.2.2.8/bin/escript /usr/lib/emqx/bin/nodetool -name emqx@127.0.0.1 -setcookie emqxsecretcookie ping
  + die 'node_is_not_running!' 1
  + set +x
  ERROR: node_is_not_running!

  emqx@d70cfe0e8e62:~$ /usr/lib/emqx/erts-11.2.2.8/bin/escript /usr/lib/emqx/bin/nodetool -name emqx@127.0.0.1 -setcookie emqxsecretcookie ping
  escript: Internal error: undef
  =ERROR REPORT==== 2-Dec-2022::19:02:39.150274 ===
  Loading of /usr/lib/emqx/lib/compiler-8.1.1/ebin/compile.beam failed: badfile

  =ERROR REPORT==== 2-Dec-2022::19:02:39.150271 ===
  beam/beam_load.c(1879): Error loading module compile:
    This BEAM file was compiled for a later version of the run-time system than 23.
    To fix this, please recompile this module with an 23 compiler.
    (Use of opcode 176; this emulator supports only up to 170.)
```
2022-12-02 16:16:49 -03:00
firest 61517f8280 chore: make remsh node name away from the atom table overflow 2022-11-18 14:23:49 +08:00
firest f4a14ecf66 refactor(cookie): Warning message when boot with default Erlang cookie 2022-11-15 10:31:09 +08:00
Zaiming (Stone) Shi cfd1d7eea1 chore(bin/emqx): no need to disable SC2086 2022-10-11 17:41:47 +02:00
Zaiming (Stone) Shi a770983882 fix(bin/emqx): allow space in root path
Prior to this fix, space was already allowed in root path
for 'start' 'console' etc. (the boot commands).
However the non-boot commands such as 'ping' still had trouble.
2022-09-27 08:36:25 +02:00
zhongwencool 9258f5a2aa chore: add emqx restart command tip 2022-08-30 15:04:00 +08:00
Zaiming (Stone) Shi f6c565fc9e fix(emqx): Check Erlang start after su command
When installed from RPM or DEB, In case EMQX in started by root,
the boot script changes user to emqx and then re-enter with the
same args.
Prior to this change, the Erlang start check is done before
su, causing it to be checked twice.
This commit moves the Erlang start check to after th su
2022-08-29 11:10:05 +02:00
Zaiming (Stone) Shi 4531703d14 refactor(bin/emqx): move file permission fix out from check_erlang_start 2022-08-11 16:30:18 +02:00
Zaiming (Stone) Shi 3a917605f5 fix(bin/emqx): avoid creating crash dump file when checking erlang 2022-08-11 16:30:18 +02:00
Zaiming (Stone) Shi 6a0d2c9d46 fix: add the 'die' function in bin/emqx 2022-08-11 08:25:37 +02:00
William Yang a88c42cf82 fix(upgrade): ensure use correct no_dot_erlang.boot 2022-08-04 15:42:19 +02:00
Zaiming (Stone) Shi a162196719
Merge pull request #8511 from qzhuyan/ci/william/4.3-new-otp-23.3
[WIP] ci: [4.3 only] release with OTP 23.3
2022-08-02 13:28:41 +01:00
William Yang c9c1dfb823 fix(upgrade): ensure files in BINDIR executable
During upgrade procedure, emqx zip file is repacked to .tar.gz but does not
preserve permission of files.

This commit ensure files under BINDIR is executable
2022-08-02 09:59:33 +02:00
zhongwencool 3df4c8c57e chore: conf check cli notes include conf result 2022-07-25 16:57:53 +08:00
William Yang 1fff0ced2c
Merge pull request #8496 from qzhuyan/dev/william/4.3-script-emqx-cluster-rescue
feat: add emqx_cluster_rescue (4.3)
2022-07-19 16:22:41 +02:00
Shawn 2d267364c4 fix: OS Env EMQX_DESCRIPTION not exported 2022-07-19 22:10:49 +08:00
Zaiming (Stone) Shi c6ba22a0b4
chore: indentation fix in bin/emqx 2022-07-18 09:47:02 +02:00
zhongwencool 5f6259f6f4
chore: update bin/emqx
Co-authored-by: Zaiming (Stone) Shi <zmstone@gmail.com>
2022-07-18 15:10:15 +08:00
zhongwencool 53c3f48755
chore: update bin/emqx
Co-authored-by: Zaiming (Stone) Shi <zmstone@gmail.com>
2022-07-18 15:10:08 +08:00
zhongwencool 0834bc52d4
chore: update bin/emqx
Co-authored-by: Zaiming (Stone) Shi <zmstone@gmail.com>
2022-07-18 15:09:59 +08:00
William Yang fc67d71f17 feat: add emqx_cluster_rescue 2022-07-15 16:55:07 +02:00
zhongwencool 87aeead653 feat: add check_conf cli to check config format 2022-07-14 17:17:03 +08:00
Shawn 4b6f275a43 fix: emqx start failed after uninstalling old version 2022-07-13 20:14:20 +08:00
Zaiming (Stone) Shi c741b9dfbe fix(bin/emqx): fix license option to allow space in path 2022-05-24 09:45:58 +02:00
Thales Macedo Garitezi 24f0592e94
fix(node_dump): define `RUNNER_ROOT_DIR` before sourcing vars
Port of https://github.com/emqx/emqx/pull/7733

`emqx_vars` requires `RUNNER_ROOT_DIR` to be defined before being
sourced.
2022-05-23 16:23:46 -03:00
JianBo He 5a66f1e854
Merge pull request #7987 from zhongwencool/more-msg-check-erlang-failed
chore: show more error msg when check_erlang_start failed
2022-05-23 10:17:57 +08:00
Shawn 92c09fdd7b fix: deny relup between minor versions 2022-05-20 15:40:59 +08:00
zhongwencool 2a348c812c chore: show more error msg when check_erlang_start failed 2022-05-19 11:21:57 +08:00
DDDHuang 1adb33a6a0 fix: check node name, regular expression (good idea from stone) 2022-05-18 15:59:33 +08:00
Zaiming (Stone) Shi 5d8539c01a fix(bin/emqx): make sed replace \n work in macos 10 2022-04-23 13:27:02 +02:00
Zaiming (Stone) Shi 4a5602dc9c fix(windows): boot console and remote_console from erl not werl
Otherwise it's impossible to troubleshoot when werl fail to start
2022-04-22 09:04:11 +02:00
Zaiming (Stone) Shi 1de3ed8783 Merge remote-tracking branch 'origin/main-v4.3' into dev/v4.3.15 2022-04-22 07:45:00 +02:00
Ilya Averyanov d60252d678 fix(install_upgrade): fix unpack_zipballs return value 2022-04-21 11:56:51 +03:00
Zaiming (Stone) Shi d8cad2cc6c refactor(bin/emqx_ctl): simplify emqx_ctl
There is no need to duplicate the node name/cookie resolution
in another script, everything is ready in bin/emqx
2022-04-12 23:05:52 +02:00
Zaiming (Stone) Shi 2da27392f7 chore: refine boot script with more readable help info 2022-04-12 23:05:17 +02:00
Zaiming (Stone) Shi 5e652217c8 fix: make possible to have white spaces in root path 2022-04-12 00:05:26 +02:00
Zaiming (Stone) Shi 8798a5160c fix: ensure install_upgrace.escript always restore cwd 2022-04-04 19:10:52 +02:00
Zaiming (Stone) Shi cd06edf8c8 fix(relup): upgrader node hidden connect target node 2022-03-31 18:30:20 +02:00
Zaiming (Stone) Shi 1a02e60640
docs: fix message typo in bin/emqx 2022-03-04 13:52:11 +01:00
Zaiming (Stone) Shi a0de86f327 chore: refine boot message on missing dynlibs 2022-03-04 09:31:33 +01:00
Shawn 71100427dd fix(relup): release upgrade failed if release dir is removed
If the target vsn is in `unpacked` state, but the release dir
`releases/<vsn>` is removed, then installing the target vsn
again will fail with error `{error,enoent}`.

In this case we should extract the tar ball again and then continue
to install the release.
2022-03-01 10:13:17 +08:00
Shawn 442a1290a8 fix(relup): release upgrade failed on symlink already exists 2022-02-23 19:14:59 +08:00
Zaiming (Stone) Shi 2325e8cfb3 chore: ensure remsh node name prefix for upgrader
for remsh prefixed nodes, ekka pick a random port to listen on
instead of following the conventional port mapping rule:
ekka listens on 4370 for emqx or emqx0 and 4371 for
emqx1 and so on
2022-02-20 19:57:56 +01:00
Zaiming (Stone) Shi d2840a8aa1 docs: change EMQ X to EMQX in more descriptive info 2022-02-15 22:18:25 +01:00
Zaiming (Stone) Shi 72c909051b fix: stop command should detect defunct pid 2022-01-26 23:48:31 +01:00
Zaiming (Stone) Shi 967dc7d55e fix: portable shebang 2021-12-27 15:40:25 +01:00
Zaiming Shi 122842a656 build: copy only libcrypto and libtinfo 2021-11-22 15:46:19 +01:00
William Yang a0fb78a38d
Merge pull request #6209 from qzhuyan/backport/william/4.3/node_dump-log-dir 2021-11-17 21:36:11 +01:00
William Yang 59656b3c3a fix: source emqx_vars in node_dump tool 2021-11-17 13:19:05 +01:00
William Yang 4f0d86dd57 fix(node_dump): locate log dir for package installation 2021-11-17 13:18:59 +01:00