[erlang-questions] Problems with unpacking package

Yevhenii Kurtov yevhenii.kurtov@REDACTED
Mon Aug 13 21:36:21 CEST 2018


Hi everyone,

I'm having problem with unpacking release_handler:unpack_release .
Looking at
https://github.com/erlang/otp/blob/maint-21/lib/sasl/src/release_handler.erl#L850-L854
I understand that it's supposed to copy and  `releases/app_name.rel` into
`releases/<vsn>/app_name.rel` and then delete the origin file.

Somehow it doesn't work in my case:

- releases/<vsn>/app_name.rel is already present in an archive
- releases/<vsn>/app_name.rel is not there after upgrade
- releases/app_name.rel still there

Illustration:

$ mkdir /srv/apps/flowmail_web/releases/1.4.6+5aead53/
$ mv flowmail_web_1.4.6+5aead53.upgrade.tar.gz
/srv/apps/flowmail_web/releases/1.4.6+5aead53/flowmail_web.tar.gz
$ ./bin/flowmail_web upgrade 1.4.6+5aead53
Release flowmail_web:1.4.6+5aead53 not found, attempting to unpack
releases/1.4.6+5aead53/flowmail_web.tar.gz
Unpacked '1.4.6+5aead53' successfully!
Release flowmail_web:1.4.6+5aead53 is already unpacked, installing..
Installed release flowmail_web:1.4.6+5aead53
Updating config..
Made release flowmail_web:1.4.6+5aead53 permanent
$ ./bin/flowmail_web ping
grep: /srv/apps/flowmail_web/releases/1.4.6+5aead53/flowmail_web.rel: No
such file or directory
grep: /srv/apps/flowmail_web/releases/1.4.6+5aead53/flowmail_web.rel: No
such file or directory
pong

## but it's present in an archive

$ tar -C /tmp/5aead53/ -zxvf
releases/1.4.6+5aead53/flowmail_web_1.4.6+5aead53.tar.gz
$ [ -f /tmp/5aead53/releases/1.4.6+5aead53/flowmail_web.rel ] && echo "File
exist" || echo "File does not exist"
File exist
$ [ -f releases/flowmail_web.rel ] && echo "File exist" || echo "File does
not exist"
File exist


There are no any special file permissions or anything like that
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180814/fd3db9c4/attachment.htm>


More information about the erlang-questions mailing list