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

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
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
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
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
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
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
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
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
sabri
Can someone explain the settings of pool_size of Ecto in config file? and what is the recommend size? Thanks
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
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
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
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

We're in Beta

About us Mission Statement