【问题标题】:Distillery failed with message "Multiply defined module: 'Elixir.Telemetry'"酿酒厂失败并显示消息“多重定义模块:'Elixir.Telemetry'”
【发布时间】:2019-04-03 08:45:24
【问题描述】:

当我尝试使用 Distillery 升级正在运行的 Phoenix 应用程序时,构建失败并显示以下消息:

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'

我运行这个应用程序几个月了,我已经成功升级了几次。这次我想把 Phoenix 的版本从 1.4.0 升级到 1.4.3。

我在 Elixir 论坛上读过这篇文章:

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

我试过mix deps.clean --allmix release.clean。有什么建议或建议吗?

更新

我注意到一个奇怪的现象。当我在RELEASE_ROOT_DIR 上执行bin/my_app upgrade 0.10.7 时,我收到了这条错误消息(注意双引号和它们之间的逗号):

Could not locate code path for release-my_app","0.10.6!

【问题讨论】:

  • rm -rf deps _build.
  • Release 构建成功,但无法升级。我收到这条消息:“发布处理程序安装失败:{:no_matching_relup, '0.10.7', '0.10.6'}”
  • mix hex.outdated?另外,您是否将mix.exs 中的应用程序本身 的版本更改为更高版本?
  • MIX_ENV=prod mix hex.outdated 表示只有 ecto_sql 可以从 3.0.0 更新到 3.0.5。 mix.exs 上的版本是 0.10.7。我想升级到 this 版本。之前的版本是0.10.6
  • 嗯,这看起来像一个与原始问题无关的distillery 问题/陷阱。那么,你如何组装一个版本?具体来说,您的.deliver/config 中是否有AUTO_VERSION=commit-count+git-revision+branch-unless-master 或任何其他AUTO_VERSION

标签: elixir phoenix-framework distillery


【解决方案1】:

虽然我无法检测到问题的根本原因,但我设法通过以下方式升级了我的应用程序。

  1. 停止应用。
  2. 删除发布目录。
  3. 重新创建发布目录。
  4. 从源目录中删除_build 目录。
  5. 使用mix release 部署应用程序。

换句话说,我放弃了主机代码交换并选择重新部署我的应用程序。

看来我的问题与这些问题有关:

两者都已经关闭。我认为我的问题是由于旧版 Distillery 安装的一些错误造成的,我以后不会遇到它。

【讨论】:

  • @JoséValim fwiw,您想知道人们是否进行热插拔。 ⇑
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-02-27
  • 1970-01-01
  • 2017-08-19
  • 2017-08-12
  • 2016-12-05
  • 1970-01-01
  • 2023-03-10
相关资源
最近更新 更多