thehunmonkgroup

thehunmonkgroup

Distillery build error: Multiply defined module: 'Elixir.Collectable.Ecto.Adapters.SQL.Stream'

Trying to build a Phoenix 1.4 application via Distillery, and hitting this error:

==> Release failed with multiple errors:
    Multiply defined module: 'Elixir.Collectable.Ecto.Adapters.SQL.Stream'

I’ll note that this application is upgraded from Phoenix 1.3.4, and I did clean all the Elixir and Node deps and rebuild them prior to this run.

Google doesn’t seem to be much help with that error, my understanding is that it means the module is defined multiple times through more than 1 dependency. I don’t really know how to go about debugging/solving that issue though…

The verbose logs from the Distillery run are available here under the ‘Details’ of that post: Release build fails with 'No such module: asn1ct' error · Issue #627 · bitwalker/distillery · GitHub

Here’s my entire mix.exs if that helps any…

defmodule Poof.Mixfile do
  use Mix.Project

  def project do
    [
      app: :poof,
      version: "1.2.4+001",
      elixir: "~> 1.7",
      elixirc_paths: elixirc_paths(Mix.env),
      compilers: [:phoenix, :gettext] ++ Mix.compilers,
      start_permanent: Mix.env == :prod,
      aliases: aliases(),
      deps: deps()
    ]
  end

  # Configuration for the OTP application.
  #
  # Type `mix help compile.app` for more information.
  def application do
    [
      mod: {Poof.Application, []},
      extra_applications: [:asn1, :logger, :runtime_tools],
    ]
  end

  # Specifies which paths to compile per environment.
  defp elixirc_paths(:test), do: ["lib", "test/support"]
  defp elixirc_paths(_),     do: ["lib"]

  # Specifies your project dependencies.
  #
  # Type `mix help deps` for examples and options.
  defp deps do
    [
      {:phoenix, "~> 1.4.0"},
      {:phoenix_pubsub, "~> 1.0"},
      {:ecto_sql, "~> 3.0"},
      {:phoenix_ecto, "~> 4.0"},
      {:postgrex, "~> 0.14"},
      {:phoenix_html, "~> 2.10"},
      {:phoenix_live_reload, "~> 1.0", only: :dev},
      {:gettext, "~> 0.11"},
      {:plug_cowboy, "~> 2.0"},
      {:timex, "~> 3.4.0"},
      {:uuid, "~> 1.1"},
      {:basic_auth, "~> 2.2"},
      {:dynamic_server_manager, "~> 0.0.10"},
      {:distillery, "~> 2.0"},
      {:swoosh, "~> 0.13"},
      {:tesla, "~> 1.2.0"},
      {:jason, "~> 1.1.0"},
      {:mox, "~> 0.3", only: :test},
    ]
  end

  # Aliases are shortcuts or tasks specific to the current project.
  # For example, to create, migrate and run the seeds file at once:
  #
  #     $ mix ecto.setup
  #
  # See the documentation for `Mix` for more info on aliases.
  defp aliases do
    [
      "ecto.setup": ["ecto.create", "ecto.migrate"],
      "ecto.clean": ["ecto.drop", "ecto.setup"],
      "ecto.seed": ["run priv/repo/seeds.exs"],
      "ecto.reset": ["ecto.clean", "ecto.seed"],
      test: ["ecto.create --quiet", "ecto.migrate", "test"]
    ]
  end
end

Most Liked

OvermindDL1

OvermindDL1

Wiping _build is something that shouldn’t need to be done, but there is still a bug or two in mix left where it is required. I’ve especially noticed it on rare dependency updates like you’ve experienced it here too.

You can actually backup the hot code reloading information if you so wish by backing up the _build/prod/rel/<project-name>/releases directory and restoring it. That directory holds the past release information. You can also copy it back in from where-ever you copied your release to, to restore it. :slight_smile:

thehunmonkgroup

thehunmonkgroup

Ah, I had done “mix deps.clean --all” and “rm -rf assets/node_modules”, but not “rm -rf assets/_build”.

Removing _build and re-running the build process seems to have fixed the issue – good to know for the future!

Followup question: IIRC, Distillery uses stuff in _build when building upgrade releases, so if wiping _build becomes necessary, I guess that clobbers the option to do a hot upgrade?

Where Next?

Popular in Questions Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
JulienCorb
I am trying to implement my new.html.eex file to create new posts on my website. new.html.eex: &lt;h1&gt;Create Post&lt;/h1&gt; &lt;%= ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 47930 226
New

We're in Beta

About us Mission Statement