kacperM7

kacperM7

Hi all,

I have a problem with setting up simple phoenix app with mix phx.new. Weirdest thing is - it worked last week without a problem and now I don’t know what I changed (I am almost sure it was nothing) and why it’s not working.

Problem: when creating new project with mix phx.new, after I cd into new directory and run mix ecto.create I get:

10:39:36.405 [error] GenServer #PID<0.292.0> terminating
** (UndefinedFunctionError) function :crypto.hmac/3 is undefined or private
    (crypto 5.0.2) :crypto.hmac(:sha256, "postgres", <<236, 186, 74, 106, 223, 211, 23, 71, 163, 135, 42, 171, 252, 96, 232, 70, 0, 0, 0, 1>>)
    (postgrex 0.15.0) lib/postgrex/scram.ex:52: Postgrex.SCRAM.hash_password/6
    (postgrex 0.15.0) lib/postgrex/scram.ex:26: Postgrex.SCRAM.verify/2
    (postgrex 0.15.0) lib/postgrex/protocol.ex:734: Postgrex.Protocol.auth_cont/4
    (postgrex 0.15.0) lib/postgrex/protocol.ex:579: Postgrex.Protocol.handshake/2
    (db_connection 2.4.0) lib/db_connection/connection.ex:82: DBConnection.Connection.connect/2
    (connection 1.1.0) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib 3.15.2) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol

As stated - this was working already before. I tried to uninstall everything phoenix/elixir related and redeploy. I am pretty sure the versions did not change.
I googled that error and it seems it was related to the deprecation of that function in OTP24, but that was some time ago (not over the weekend). In my mix.exs I see following entries:

      {:plug, "~> 1.12"},
      {:plug_crypto, "~> 1.1.2 or ~> 1.2"},

It would mean I have the latest dependencies there.
I am rather new to phoenix so I would need some guidance on where to look next.

Showing Posts 1 to 2

kacperM7

kacperM7 OP

Update - I tried with 1.6.0-rc.1 and it worked fine. I will stick to it for now, but any hint on why it happened before would be still welcome.

Ninigi

Ninigi

Wild guess, postgrex is using a function from a newer OTP version now.

Another wild guess, you did not run into that issue last week, because you were using locked versions, but in your newest project, it installed the latest postgrex version (because afaik postgrex in phoenix is anything above 0.0.0)

You can open the mix.lock file in one of your older projects, and lock ecto and posgrex to the same versions, or you can try to update your Elixir/OTP version.

EDIT: give me a message if you don’t know what I am talking about :smiley:

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews