Closed hl closed 7 years ago
Can you produce a release with bcrypt_elixir, or does that result in the same errors?
@riverrun I'd already tried using bcrypt_elixir
instead of argon2_elixir
and bcrypt_elixir
works without any error.
@zentetsukenz version 0.12 or version 1.0?
@riverrun 1.0
Ok. Thanks for the info.
@riverrun Thanks for your hard work on fixing this. I'm also trying many things to fix this on my side too. Will report back to you if I got an update.
Just updated the hex version to 1.2.10. Let me know if there are any changes.
@riverrun just produced a release with Bcrypt version 1.0 with no errors on production server
When using the command Elixir.Argon2.hash_pwd_salt("asdfasdf")
with the new Argon2_elixir version 1.2.10, it gives me the same error on the production machine as before:
c_src/argon2_nif.c file or directory not found
The latest update to the master branch contains a couple of changes to the Makefile. This makes it more like the Bcrypt Makefile.
same error on the production machine
I made some changes to the mix.exs file (after comparing it with the Bcrypt version) and pushed these changes to version 1.2.11
Unfortunately the error occured again.
What else could I do to help?
I'm facing the same issue. For me it happened on Travis running the tests on a Ubuntu Trusty box (using version 1.2.11). Hope this helps a bit, let me know if there is anything I can do to help you.
Cheers,
@francocatena was it working with previous versions? What version of Erlang are you using?
@riverrun Yes, it was working on previous versions, last good build was running on 1.2.9
. This is the version provided by Travis CI:
$ elixir --version
Erlang/OTP 20 [erts-9.1] [source] [64-bit] [smp:32:2] [ds:32:2:10] [async-threads:10] [hipe] [kernel-poll:false]
Elixir 1.5.2
When the config is:
elixir:
- 1.5
otp_release:
- 20.1
I have tried also with otp_release: 20.0
, same result, this is the running version on Travis CI for that case:
$ elixir --version
Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:32:2] [ds:32:2:10] [async-threads:10] [hipe] [kernel-poll:false]
Elixir 1.5.2
On my local machine they run without errors. Running Archlinux and this is the output of elixir -v
there:
$ elixir -v
Erlang/OTP 20 [erts-9.0.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false]
Elixir 1.5.2
Let me know if you need anything else, thanks for working on this.
In the develop branch, I have made a couple of changes to the Makefile. Could you try testing it (the Makefile is the only change, so you just need to replace the argon2_elixir Makefile with this new one)?
Now I have some error on the compile stage:
==> argon2_elixir
make: *** No rule to make target 'argon2/src/argon2.c', needed by 'priv/argon2_nif.so'. Stop.
could not compile dependency :argon2_elixir, "mix compile" failed. You can recompile this dependency with "mix deps.compile argon2_elixir", update it with "mix deps.update argon2_elixir" or clean it with "mix deps.clean argon2_elixir"
I have added the dependency as follows (just in case it matters):
{:argon2_elixir, ">= 1.2.0", github: "riverrun/argon2_elixir", branch: "develop", override: true}
@francocatena I think that's an unrelated error because you're not bringing in the argon2 submodule. I think you need to add submodules: true
when adding the argon2_elixir dependency.
@riverrun ohh sorry about that, didn't note the repo has a submodule. When added the submodules
option it worked on my dev machine. In Travis it is still failing.
Some weird note about Travis, it fails to clone the submodule because it is using the git:
scheme instead of https:
(I have tested this change before on my dev machine and it worked). After changing that it complies and do his thing, but as I said, still no luck there =(
@francocatena thanks for the report. I need to wait for feedback from the other users before trying anything else. Hopefully, I'll get back to you soon.
I have just updated the hex package to 1.2.12. This has a simpler Makefile and a couple of other small changes.
Thank you very much for your hard work! After updating to version 1.2.12 it now works in production!
(archlinux 64bit; Kernel: 4.13.11-1-ARCH, Erlang/OTP 20 [erts-9.0.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false], Elixir 1.5.2)
I'm glad that's working for you now.
I'll keep this issue open until I hear from the other users.
In Travis is still failing (working on dev). In case it helps, the error I am getting it is from Ecto:
** (Ecto.ChangeError) value `{<<248, 135, 202, 78, 99, 127>>, "$argon2i$v=19$m=8,t=1,p=1$w3gD4zAwaG/7L1ySasIMfg$ns6AhxhymZyjwbEZaBhQ0jTuE2CnD9tscsg6095dGUI", {1, 3, 1, 0, true, 32, 1}}` for `Ptr.Accounts.User.password_hash` in `insert` does not match type :string
And the code is:
schema "users" do
field :email, :string
field :name, :string
field :password_hash, :string
field :password, :string, virtual: true
timestamps()
end
def changeset(%User{} = user, attrs) do
user
|> cast(attrs, @cast_attrs) # And other validations
|> put_password_hash()
end
defp put_password_hash(%{valid?: true, changes: %{password: password}} = changeset) do
change(changeset, Comeonin.Argon2.add_hash(password))
end
defp put_password_hash(changeset), do: changeset
I'm in the middle of fixing that error now.
I think I have fixed this in 1.2.13.
@riverrun great, it works now =)
Thank you very much for your work!
Great!
I'll close this issue now. If you have any further problems, just let me know.
@riverrun 1.2.13
does the job. Thanks! :+1:
Please note that this change affects the performance a lot. It seems to be about 1.8 times slower after disabling the optimizations, so I need to look at this again in the near future.
I am having this trouble...
could not compile dependency :argon2_elixir, "mix compile" failed. You can recompile this dependency with "mix deps.compile argon2_elixir", update it with "mix deps.update argon2_elixir" or clean it with "mix deps.clean argon2_elixir"
** (Mix) "nmake" not found in the path. If you have set the MAKE environment variable, please make sure it is correct.
I'm trying to get Argon2 to work on my production server (via Nanobox.io) but run into a problem. On my local machine, with nanobox, everything works but as soon as I deploy it to the server I end up with below error:
all the files