Commit Graph

11 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
William Yang a88c42cf82 fix(upgrade): ensure use correct no_dot_erlang.boot 2022-08-04 15:42:19 +02:00
Shawn 92c09fdd7b fix: deny relup between minor versions 2022-05-20 15:40:59 +08:00
Ilya Averyanov d60252d678 fix(install_upgrade): fix unpack_zipballs return value 2022-04-21 11:56:51 +03: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
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
Shawn 133609a040 fix(relup): configs for plugins are missing after relup 2021-11-10 11:10:23 +08:00
terry-xiaoyu 151d820058 feature(project): change to rebar3 umbrella project 2020-10-31 11:07:25 +08:00