1
votes

When I tried to upgrade a running Phoenix application using Distillery, the build failed with these messages:

Generated teamgenik app
==> Assembling release..
==> Building release my_app:0.10.7 using environment prod
==> Generated .appup for artificery 0.2.6 -> 0.4.1
==> Generated .appup for db_connection 2.0.3 -> 2.0.6
==> Generated .appup for decimal 1.6.0 -> 1.7.0
==> Generated .appup for ecto 3.0.6 -> 3.0.8
==> Generated .appup for ecto_sql 3.0.4 -> 3.0.0
==> Generated .appup for phoenix 1.4.0 -> 1.4.3
==> Generated .appup for phoenix_html 2.13.0 -> 2.13.2
==> Generated .appup for phoenix_pubsub 1.1.1 -> 1.1.2
==> Generated .appup for plug 1.7.1 -> 1.7.2
==> Generated .appup for plug_cowboy 2.0.1 -> 2.0.2
==> Generated .appup for teamgenik 0.10.6 -> 0.10.7
==> Generated .appup for telemetry 0.3.0 -> 0.2.0
==> Release failed with multiple errors:
    Multiply defined module: 'Elixir.Telemetry'

I operate this app for several months and I have successfully upgraded it several times. This time, I want to bump the version of Phoenix from 1.4.0 to 1.4.3.

I have read this entry on Elixir Forum:

https://elixirforum.com/t/distillery-build-error-multiply-defined-module-elixir-collectable-ecto-adapters-sql-stream/19489

I have tried mix deps.clean --all and mix release.clean. Any advice or suggestion?

UPDATE

I noticed a peculiar phoenomenon. When I executed bin/my_app upgrade 0.10.7 on the RELEASE_ROOT_DIR, I got this error message (note double quotes and a comma between them):

Could not locate code path for release-my_app","0.10.6!
1
rm -rf deps _build.Aleksei Matiushkin
Release was successfully built, but I could not upgrade it. I am getting this message: "Release handler failed to install: {:no_matching_relup, '0.10.7', '0.10.6'}"Tsutomu
mix hex.outdated? Also, have you changed the version of the application itself in mix.exs to the greater one?Aleksei Matiushkin
MIX_ENV=prod mix hex.outdated repots that only ecto_sql can be updated from 3.0.0 to 3.0.5. The version on the mix.exs is 0.10.7. I want to upgrade to this version. The previous version was 0.10.6.Tsutomu
Well, this looks like a distillery issue/pitfall that is not related to the original question. So, how do you assemble a release? Specifically, do you have AUTO_VERSION=commit-count+git-revision+branch-unless-master or any other AUTO_VERSION in your .deliver/config?Aleksei Matiushkin

1 Answers

1
votes

Though I could not detect the root cause of my problem, I managed to upgrade my app in the following way.

  1. Stop the app.
  2. Remove the release directory.
  3. Recreate the release directory.
  4. Remove _build directory from source directory.
  5. Deploy the app with mix release.

In other words, I gave up host code swapping and chose to re-deploy my app freshly.

It seems that my prolem is related to these issues:

Both have been closed already. I think my problem was due to some bugs of the older installation of Distillery and I won't encounter it in the future.