Commit Graph

117 Commits

Author SHA1 Message Date
Thales Macedo Garitezi 1d59e18cca fix(upgrade): fix start script existence check (v4.4) 2022-12-23 17:49:02 -03:00
Thales Macedo Garitezi bf40ee577b fix(install_upgrade): check target version when unpacking (v4.4)
We already have a check to avoid upgrading between minor versions,
such as 4.3 <-> 4.4 (and 4.4 <-> 4.5):

```
  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:36:06 -03:00
Zaiming (Stone) Shi 71299a2bcf Merge remote-tracking branch 'origin/main-v4.3' into main-v4.4 2022-11-28 10:02:29 +01: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 7d24c34db5 Merge remote-tracking branch 'origin/release-v43' into release-v44 2022-10-11 22:54:25 +02:00
Zaiming (Stone) Shi cfd1d7eea1 chore(bin/emqx): no need to disable SC2086 2022-10-11 17:41:47 +02:00
Thales Macedo Garitezi 954e276124 Merge remote-tracking branch 'origin/release-v43' into merge-rv43-into-rv44-a 2022-09-28 09:46:03 -03: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
zhouzb 440f7ce007
Merge branch 'main-v4.4' into sync-v4.3.19 2022-08-30 23:36:41 +08:00
zhongwencool 3867229b2d chore: add emqx restart command tip 2022-08-30 23:19:47 +08:00
Zaiming (Stone) Shi 882ee754e5 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-30 23:18:47 +08: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
zhongwencool 940ceb570d Merge branch 'main-v4.4' into copy-of-main-v4.3 2022-08-19 10:53:48 +08:00
Thales Macedo Garitezi efef052ec7 feat: enable upgrading release from 4.4.X to 4.5.Y
When upgrading from 4.4.X, the `install_upgrade` script from 4.4.X
is used, which forbids such transition.
2022-08-12 11:15:58 -03: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
Zaiming (Stone) Shi eca211373f Merge remote-tracking branch 'origin/dev/v4.3.18' into dev/v4.4.7 2022-08-08 16:39:09 +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 f47d952d82 Merge main-4.3 to 0803-sync-v4.3-to-v4.4 2022-08-03 13:41:11 +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 0e8888716d Merge branch 'main-v4.3' into copy-of-main-v4.4 2022-07-26 15:48:06 +08:00
zhongwencool 3df4c8c57e chore: conf check cli notes include conf result 2022-07-25 16:57:53 +08:00
Xinyu Liu 84c2aceba9
Merge branch 'main-v4.4' into copy-of_main-v4.3 2022-07-20 21:29:49 +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
zhongwencool 3248cb92e8 Merge branch 'main-v4.3' into sync-4.3-to-4.4 2022-07-19 11:02:11 +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
JianBo He 7862d75ee4 Merge remote-tracking branch 'ce/main-v4.3' into merge-main-v4.3-into-v4.4 2022-05-25 16:59:04 +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
Xinyu Liu 211fee3035
Merge branch 'main-v4.4' into copy-of_main-v4.3 2022-05-23 23:19:19 +08:00
Shawn ca842aa869 fix: merge main-v4.3 to main-v4.4 2022-05-23 11:23:27 +08: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