Sample to upgrade slim release
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Sample to upgrade slim release, a little workaround needed

In upgrading, we need unpack relup archive manually and use release_handler:set_unpacked/2 directly.

cf: [erlang-bugs] release_handler error in upgrading slim release (Thanks to Siri Hansen!)


Step 1

Generate version 1 and 2 of releases and upgrade package between them. The script does this work with help of rebar. After the script finishes, the node with version 1 release is located at sample/rel/sample_1. Also the node with the version has started, whose name is sample@

Step 2

If we use release_handler:unpack_release/1 directly, an error happens (at least with R16B02):

(sample@> release_handler:unpack_release("sample_2").

Steps for workaround is as follows:

  1. Unpack the relup archive, which is generated at Step 1, manually and place releases and new versions of applications to appropriate directories.
  2. Call release_handler:set_unpacked("releases/sample_2.rel", [{sample, "2", "lib"}]). manually.
  3. Call release_handler:install_release("2")..

All these steps are executed by the script After upgrading, we can confirm that new version is working by calling sample_app:new_export() which is a new function in version 2.

For full details, see

Some observations on release_handler:unpack_release/1

Look into lib/sasl/src/release_handler.erl