简体   繁体   中英

Distillery failed with message "Multiply defined module: 'Elixir.Telemetry'"

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM