Deployment with edeliver/distillery results in no code change

I have a plan old Phoenix app with edeliver and distillery for deploy:

After running:

mix edeliver build release
mix edeliver deploy production
mix edeliver restart release

I hit certain urls that I know for a fact changed and I’m getting responses that correspond to a previous version.

Starting/stopping the release in the production server results in the same old code being run.

If I grep ps auxf I see the bash command that was used to run my release I noticed that some old versions of the app are being added to the path that runs the whole thing. Somehow, the version that is actually running is 0.0.10+154....:

/home/deployer/myphoenixapp/releases/0.0.11+158-d902718/myphoenixapp.sh
  -- -root /usr/lib/erlang
  -progname home/deployer/myphoenixapp/releases/0.0.11+158-d902718/myphoenixapp.sh -- -home /home/deployer --
  -boot_var ERTS_LIB_DIR /usr/lib/erlang/lib
  -config /home/deployer/myphoenixapp/var/sys.config
  -pa /home/deployer/myphoenixapp/lib/artificery-0.4.2/ebin 
  /home/deployer/myphoenixapp/lib/certifi-2.5.1/ebin
  ...
  /home/deployer/myphoenixapp/lib/plug_crypto-1.0.0/ebin
  /home/deployer/myphoenixapp/lib/ranch-1.3.2/ebin
  /home/deployer/myphoenixapp/lib/myphoenixapp-0.0.10+154-b0debe3/ebin # <- *****************
  /home/deployer/myphoenixapp/lib/myphoenixapp-0.0.10+155-5863311/ebin # <- old versions being added to the 'path'
  /home/deployer/myphoenixapp/lib/myphoenixapp-0.0.11+157-7cf022c/ebin # <- ******************
  /home/deployer/myphoenixapp/lib/myphoenixapp-0.0.11+158-d902718/ebin
  /home/deployer/myphoenixapp/lib/ssl_verify_fun-1.1.4/ebin
  /home/deployer/myphoenixapp/lib/telemetry-0.4.0/ebin
  /home/deployer/myphoenixapp/lib/unicode_util_compat-0.4.1/ebin
  -pa /home/deployer/myphoenixapp/lib/myphoenixapp-0.0.11+158-d902718/consolidated -boot /home/deployer/myphoenixapp/releases/0.0.11+158-d902718/myphoenixapp -name myphoenixapp@127.0.0.1 -setcookie _X!VsJlx4B -smp auto -mode embedded -user Elixir.IEx.CLI -extra --no-halt +iex -- --

If I delete all the myphoenixapp-* from the lib directory (except the latest) one, then the release works as expected.

Am I doing something wrong? Is it normal for those old version to remain there?

I’m running distillery 2.0 and edeliver 1.6.0.

I’ve got the exact same issue, using the same versions. Did you ever fix that issue?

I added the following to my .deliver/config:

post_extract_release_archive() {
  status "Removing start_erl.data"
  __remote "
    [ -f ~/.profile ] && source ~/.profile
    set -e
    cd $DELIVER_TO/$APP/var $SILENCE
    rm start_erl.data
  "
}
1 Like

Yep, I finally found that distillery is the actual issue.

This is the distillery PR fixing the issue, though there hasn’t been a new release since.