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

Where Next?

Popular in Questions Top

Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
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
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
vegabook
I'm brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
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
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New

Other popular topics Top

marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
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
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
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
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39247 209
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
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

We're in Beta

About us Mission Statement