maz

maz

Missing crypto lib via db_connection, How to force mix use earlier version?

While running a docker-compose run --rm myapp migrate command. Ubuntu 18.04. It fails on this line in my release_tasks.ex:

Ecto.Migrator.run(repo, migrations_path, :up, all: true)

The deployment and migration succeeded many times before so I have no idea why this happened all of a sudden. I find this stack suspicious because db_connection was recently updated:

17:16:43.761 [warn] The on_load function for module crypto returned:
{:error, {:load_failed, 'Failed to load NIF library: \'Error loading shared library libcrypto.so.1.1: No such file or directory (needed by /app/lib/crypto-4.4/priv/lib/crypto.so)\''}}

17:16:43.774 [error] GenServer #PID<0.145.0> terminating
** (RuntimeError) connect raised UndefinedFunctionError exception.The exception details are hidden, as they may contain sensitive data such as database credentials. You may set :show_sensitive_data_on_connection_error to true if you wish to see all of the details
    (crypto) :crypto.hash/2
    (postgrex) lib/postgrex/protocol.ex:721: Postgrex.Protocol.auth_md5/4
    (postgrex) lib/postgrex/protocol.ex:576: Postgrex.Protocol.handshake/2
    (db_connection) lib/db_connection/connection.ex:66: DBConnection.Connection.connect/2
    (connection) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: nil

I made a pristine Ubuntu 18.10 Digital Ocean droplet, installed Docker manually and attempted a deployment, which resulted in the same error.

So I attempted to override db_connection to use version 2.0.3, which is from November 28, 2018. But using {:db_connection, "~> 2.0.3", override: true}, in mix.exs doesn’t seem to guarantee that I will get that version because my mix.lock file appears to contain version 2.0.5:

  "db_connection": {:hex, :db_connection, "2.0.5", "ddb2ba6761a08b2bb9ca0e7d260e8f4dd39067426d835c24491a321b7f92a4da", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm"},

Any ideas of a workaround to force mix to use db_connection version 2.0.3?

Most Liked

maz

maz

That was it. Man, I was stumped, thanks.
diff:

-FROM alpine:3.8 as runner
+FROM alpine:3.9 as runner
 RUN addgroup -g 1000 faithful_word && \
     adduser -D -h /app \
       -G faithful_word \
       -u 1000 \
       faithful_word
-RUN apk add -U bash libssl1.0
+RUN apk add -U bash libssl1.1
shanesveller

shanesveller

Double-check that you aren’t building your release on an image that ultimately starts on Alpine 3.9, but trying to run the release on Alpine 3.8.

I saw exactly this behavior under those conditions recently, and didn’t understand why I suddenly had 3.9 in the mix. It’s because the official Elixir base images have rebuilt and retagged nearly all historical versions in the last few weeks, and I didn’t go to the length to pin with @sha256:… syntax (until now).

shanesveller

shanesveller

The libssl is what catches my eye as Alpine 3.8->3.9 switched the SSL stack being used.

Where Next?

Popular in Questions Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
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
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
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
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
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

sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
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
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
William
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
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
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is 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
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
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New

We're in Beta

About us Mission Statement