Error Duplicate modules: socket specified in kernel and gen_smtp during mix release

i keep getting this error when i try to build a release during deployment. i cant figure where the error is coming from, all help will be appreciated

Without more information, I doubt You can have an answer…

No version, no code, it’s just too cryptic to make a guess.

1 Like

Update your dependencies as socket module was removed in gen_smtp 0.14.0 and current version is 1.1.1 (so it was removed about 2 years ago). socket module is now built in into Erlang kernel application and overriding it can cause hard to debug problems.

1 Like

thanks for the help but i still get same error after running mix deps.update --all
her is my dep`
[

  {:phoenix, "~> 1.5.3"},
  {:phoenix_ecto, "~> 4.1"},
  {:ecto_sql, "~> 3.4"},
  {:postgrex, ">= 0.0.0"},
  {:phoenix_live_dashboard, "~> 0.2.0"},
  {:telemetry_metrics, "~> 0.4"},
  {:telemetry_poller, "~> 0.4"},
  {:gettext, "~> 0.11"},
  {:jason, "~> 1.0"},
  {:plug_cowboy, "~> 2.0"},
  {:guardian, "== 1.0.0"},
  {:comeonin, "~> 4.0"},
  {:bamboo, "~> 0.7"},
  {:bamboo_smtp, "~> 1.2.1"},
  {:cors_plug, "~> 2.0"},
  {:bcrypt_elixir, "~> 1.0"}
]

Try running mix hex.outdated. That will list all deps and their current and new versions etc. and tell if the dependency can be updated or not.

If for some reason certain a dependency can’t be updated, mix deps.update --all will skip over it and only update what can be updated.

this is what get when i run mix hex.outdated

If this is a working app and you want/need to make everything current you’ll need to have a look at the CHANGELOG of each dependency that says “Update not possible” and evaluate to make sure that upgrading that dependency isn’t going to cause issues. If it isn’t, then update the mix.exs and change the version, then rerun mix deps.update APP (or --all) and if there is an issue, it will error and show you where the conflict is.

In your case, since gen_smtp is the show stopper, I’d start with bamboo & bamboo_smtp because bamboo_smtp has a dependency on gen_smtp.

If you are using eex templates in bamboo be sure to have a look at the docs because they changed the template system and removed the dependency on Phoenix. I still have to rework the templates in one of my apps to adapt to the new system so I haven’t updated bamboo. Currently that app is sitting at bamboo 1.7.1 & bamboo_smtp 3.1.3 without issues.

2 Likes

thank you very much this works, i updated the bamboo version{:bamboo, "~> 1.7.1"} and that solve it. i was able to run MIX_ENV=prod mix release and it ran successfully
thanks you all for helping out. Great community here

Thank you! Glad I could help. :+1: