sc4224

sc4224

Function Bcrypt.Base.gensalt_nif/3 is undefined (module Bcrypt.Base is not available)

I’m running Phoenix 1.3 with Elixir 1.6 and Erlang OTP 20 in a docker container.
I use comeonin ~> 4.0 and bcrypt_elixir ~> 1.0

When I try to call the function Comeonin.Bcrypt.hashpwsalt(WITH_MY_PASSWORD), the error returned is: function Bcrypt.Base.gensalt_nif/3 is undefined (module Bcrypt.Base is not available)

I’ve read other forums and they all point to the fact that Bcrypt 1.0 is only compatible with erlang 20. So I don’t really know what the issue is here.

Marked As Solved

NobbZ

NobbZ

I took a closer look again, this time into the docker compose file. You are using a volume, pulling all your local stuff into the container shadowing the stuff in the container. This won’t work. Please remove the volume.

Also Liked

NobbZ

NobbZ

I’m not sure how docker implements volumes, but I can tell you what happens when you use one.

Everything what you had in the container at the point where you mount the volume to, will dissapear and replaced by what you have on the host. Changes you make from the container in the volume, appear on the host as well and changes made on the host do appear in the container as well.

The most common use case for volumes is persisting data from the container, eg databases are writing their files on volume, such that the data persists even between container updates.

Also I’ve seen volumes beeing used as a kind of IPC, via a file that both (host and container) read and write. I tend to replace those ugly mechanics with proper signal handling or a management protocol over IP/REST on a dedicated port.

They are not meant to share sourcecode during development. If changes of your sourceode on the host are visible in the container instantly without needing it to rebuild, you are doing it wrong. Especially as build artifacts are created by host simply by starting the editor (at least in the days of ElixirLS) which might confuse the container as it sees those artifacts and thinks it doesn’t need to recompile, but in fact the artifacts might be for a different ARCH or OS or just with a different environment.

davidalencar

davidalencar

This worked for me:

mix deps.compile --force bcrypt_elixir

Last Post!

empitePasindu

empitePasindu

I was going in the wrong way by using vscode terminal to compile the packages which gave the above error . following is the easiest way

  • install latest visual studio with Desktop development with c++ option
  • open visual studio (not visual studio code)
  • open a developer command prompt terminal
  • mix deps.comile --all
  • done

Where Next?

Popular in Questions Top

Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
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
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

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
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
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
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
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement