rakeshtripathy

rakeshtripathy

Hello,

I have upgraded to OTP 24 and the application gives me below error.

2023-05-08T09:39:40.016516261Z ** (UndefinedFunctionError) function :crypto.hmac/3 is undefined or private
2023-05-08T09:39:40.016521861Z     (crypto 5.0.6.3) :crypto.hmac(:sha256, <<215, 151, 119, 26, 127, 8, 146, 85, 15, 210, 233, 150, 234, 49, 71, 114, 253, 119, 149, 8, 92, 166, 200, 71, 173, 68, 192, 10, 124, 239, 15, 252, 84, 185, 202, 48, 189, 229, 78, 102, 229, 58, 112, 117, 209, 144, 87, 238, 33, 56, ...>>, 'PUT\n\n\n40976\n\napplication/octet-stream\n\n\n\n\n\n\nx-ms-blob-type:BlockBlob\nx-ms-date:Mon, 08 May 2023 09:39:40 GMT\nx-ms-version:2014-02-14\n/test001/uploads/test/docs/test_create/6318/lfp.4d2bffda-5cd1-4d9a-b71a-8d7cd293c197.19f2a673-1f3a-4e06-9257-749b3c09a2b9.original.pdf')
2023-05-08T09:39:40.016528661Z     (erlazure 0.2) /app/deps/erlazure/src/erlazure.erl:756: :erlazure.get_shared_key/7
2023-05-08T09:39:40.016532861Z     (erlazure 0.2) /app/deps/erlazure/src/erlazure.erl:717: :erlazure.execute_request/2
2023-05-08T09:39:40.016537061Z     (erlazure 0.2) /app/deps/erlazure/src/erlazure.erl:530: :erlazure.handle_call/3
2023-05-08T09:39:40.016541161Z     (stdlib 3.17.2.2) gen_server.erl:721: :gen_server.try_handle_call/4
2023-05-08T09:39:40.016544962Z     (stdlib 3.17.2.2) gen_server.erl:750: :gen_server.handle_msg/6
2023-05-08T09:39:40.016548962Z     (stdlib 3.17.2.2) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
2023-05-08T09:39:40.016567662Z Last message (from #PID<0.5946.0>): {:put_blob, 'uploads', 'test/docs/test_create/6318/lfp.4d2bffda-5cd1-4d9a-b71a-8d7cd293c197.19f2a673-1f3a-4e06-9257-749b3c09a2b9.original.pdf', :block_blob, <<37, 80, 68, 70, 45, 49, 46, 52, 10, 49, 32, 48, 32, 111, 98, 106, 10, 60, 60, 10, 47, 84, 105, 116, 108, 101, 32, 40, 254, 255, 0, 76, 0, 101, 0, 116, 0, 116, 0, 101, 0, 114, 0, 32, 0, ...>>, []}

Please help to resolve this issue.

First 10 of 12 Posts Switch mode

LostKobrakai

LostKobrakai

rakeshtripathy

rakeshtripathy OP

currently I am using :plug_crypto, “1.2.5”, but I feel the issue is with erlazure and the errors comes while uploading files into azure storage.

al2o3cr

al2o3cr

A fix for this was merged a while back, but I’m not sure if it was packaged into a release:

https://github.com/dkataskin/erlazure/pull/33

rakeshtripathy

rakeshtripathy OP

Thank you for quick response, could you please guide me how can I check and confirm the same and the next step to proceed further.

apoorv-2204

apoorv-2204

I think you need to update plug crypto. from this it looks like you are using otp >24. OTP has updated hmac funtion.

rakeshtripathy

rakeshtripathy OP

I am using OTP 24, and plug_crypto : “1.2.5” i.e. the latest version.

al2o3cr

al2o3cr

Until a version of :erlazure is released with the fixes, you should be able to add git: "https://github.com/dkataskin/erlazure.git" to the :erlazure dependency in your mix.exs to use the code directly from there.

rakeshtripathy

rakeshtripathy OP

I tried with this change, but it doesn’t work and gives same errors.

s6o

s6o

I encountered the same error when upgrading and old project from OTP22/Elixir 1.9.4 to OTP24/Elixir 1.14.
If I read the documentation correctly the solution is to now use :crypto.mac functions, as the :crypto.hmac/3 is no longer present in OTP24.

In my case I replaced my :crypto.hmac/3 call with :crypto.mac/3

al2o3cr

al2o3cr

Either that means:

  • the updated dependency hasn’t been installed. Make sure you’ve done mix deps.get after changing it. What does your mix.lock file show now?

  • or there’s another bug that wasn’t fixed by the changes to erlazure in the “fix crypto deprecations” PR

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
rahultumpala
Hello, I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
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
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement