pbjoiner

pbjoiner

"Ecto.Adapters.Postgres was not compiled..." After Upgrading Dependencies

I inherited an Elixir app from a now absent supervisor. My skills with Elixir and Phoenix are not great.

I need to upgrade my dependencies so I can get this thing to use TLS3. Here’s the error:

== Compilation error in file lib/[redacted]/repo.ex ==
** (ArgumentError) adapter Ecto.Adapters.Postgres was not compiled, ensure it is correct and it is included as a project dependency
(ecto 3.10.3) lib/ecto/repo/supervisor.ex:61: Ecto.Repo.Supervisor.compile_config/2
lib/[redacted]/repo.ex:3: (module)

The file in question:

defmodule CloHubspot.Repo do

	use Ecto.Repo,
	    otp_app: :clo_hubspot,
	    adapter: Ecto.Adapters.Postgres
end

The relevant bit of mix.exs:

defp deps do
	[
		{:phoenix, "~> 1.7.7"},
		{:phoenix_ecto, "~> 4.4.2"},
		{:ecto, "~> 3.10.3"},
		{:ecto_sql, "~> 3.10.1"},
		{:postgrex, "~> 0.17"},
		{:phoenix_html, "~> 3.3.1"},
		{:phoenix_live_reload, "~> 1.4.1", only: :dev},
		{:plug_cowboy, "~> 2.6"},
		{:httpoison, "~> 2.1.0"},
		{:poison, "~> 5.0.0"},
		{:hound, "~> 1.1.1"},
		{:cors_plug, "~> 3.0.3"},
		{:credo, "~> 1.7.0", only: [:dev, :test]},
		{:jason, "~> 1.4.1"}
	]
end

Erlang/Elixir versions:

Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns] [dtrace]
Elixir 1.15.4 (compiled with Erlang/OTP 26)

I suspect my wanton upgrade of every @#$%@#$% thing broke postgres. Does anybody know where I ought to be?

Marked As Solved

dimitarvp

dimitarvp

To be fair that usually ends in tears, you are better off reverting that “upgrade everything” commit and start with only upgrading Erlang and Elixir. Then upgrade only Ecto and nothing else, then postgrex, and keep running tests until something breaks.

It’s a crappy job but we have to do it sometimes.

Also Liked

hst337

hst337

How did you update your dependencies? You can always try mix deps.compile --all. If this doesn’t solve the problem, you can try mix clean --deps && mix deps.get && mix deps.compile --all

pbjoiner

pbjoiner

Next time, that will be the far more sensible plan. For this one, I’ve got about three miles of warning messages to wade through.

pbjoiner

pbjoiner

I spoke to soon. The deps rebuilt nicely but the phoenix app, not so much. Thanks for the pointer on mix clean, though. That’s very helpful.

pbjoiner

pbjoiner

And now I’m making it the plan for this time. Thanks. I’ll post here on the results for posterity.

Where Next?

Popular in Questions Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
dokuzbir
Hello, I am trying to convert my lists to string without losing brackets.For start i have 3 map. They look like these buyer = %{ id: ...
New
Phillipp
Hey, I have a NanoPi-M3 and try to install Elixir on their Ubuntu image. I followed the Raspberry Pi installation instructions from the ...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
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
Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

Other popular topics Top

chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

We're in Beta

About us Mission Statement