riverrun / argon2_elixir

Elixir wrapper for the Argon2 password hashing algorithm
Apache License 2.0
229 stars 34 forks source link

Some weird problem on production server #12

Closed hl closed 7 years ago

hl commented 7 years ago

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:

root@do.1:~# dmesg | grep "argon2"
[  801.414837] traps: 1_scheduler[8220] trap invalid opcode ip:7f78384d400a sp:7f783a6fed30 error:0 in argon2_nif.so[7f78384ce000+9000]
[ 2599.157634]  in argon2_nif.so[7f20bdb76000+9000]
[ 2653.066256] traps: 1_scheduler[15253] trap invalid opcode ip:7ff2255de00a sp:7ff2443bed30 error:0 in argon2_nif.so[7ff2255d8000+9000]
[ 3228.837487] traps: 1_scheduler[15460] trap invalid opcode ip:7f1a97dfc00a sp:7f1ab5e3ed30 error:0 in argon2_nif.so[7f1a97df6000+9000]

all the files

/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir/.compile.elixir
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir/.compile.elixir_scm
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir/.compile.fetch
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir/.compile.xref
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir/ebin
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir/priv
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir/ebin/Elixir.Argon2.Base.beam
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir/ebin/Elixir.Argon2.Stats.beam
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir/ebin/Elixir.Argon2.beam
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir/ebin/argon2_elixir.app
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/.fetch
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/.hex
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/Makefile
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/Makefile.win
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/README.md
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/c_src
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/lib
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/mix.exs
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/priv
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/include
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/include/argon2.h
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/argon2.c
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/bench.c
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/blake2
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/core.c
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/core.h
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/encoding.c
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/encoding.h
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/genkat.c
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/genkat.h
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/opt.c
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/ref.c
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/run.c
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/test.c
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/thread.c
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/thread.h
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/blake2/blake2-impl.h
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/blake2/blake2.h
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/blake2/blake2b.c
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/blake2/blamka-round-opt.h
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/blake2/blamka-round-ref.h
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/c_src/argon2_nif.c
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/lib/argon2
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/lib/argon2.ex
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/lib/argon2/base.ex
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/lib/argon2/stats.ex
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/priv/argon2_nif.so
/var/lib/docker/aufs/diff/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/data/var/home/gonano/.hex/packages/hexpm/argon2_elixir-1.2.8.tar
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir/.compile.elixir
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir/.compile.elixir_scm
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir/.compile.fetch
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir/.compile.xref
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir/ebin
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir/priv
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir/ebin/Elixir.Argon2.Base.beam
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir/ebin/Elixir.Argon2.Stats.beam
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir/ebin/Elixir.Argon2.beam
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/_build/prod/lib/argon2_elixir/ebin/argon2_elixir.app
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/.fetch
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/.hex
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/Makefile
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/Makefile.win
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/README.md
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/c_src
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/lib
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/mix.exs
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/priv
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/include
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/include/argon2.h
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/argon2.c
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/bench.c
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/blake2
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/core.c
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/core.h
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/encoding.c
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/encoding.h
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/genkat.c
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/genkat.h
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/opt.c
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/ref.c
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/run.c
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/test.c
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/thread.c
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/thread.h
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/blake2/blake2-impl.h
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/blake2/blake2.h
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/blake2/blake2b.c
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/blake2/blamka-round-opt.h
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/argon2/src/blake2/blamka-round-ref.h
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/c_src/argon2_nif.c
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/lib/argon2
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/lib/argon2.ex
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/lib/argon2/base.ex
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/lib/argon2/stats.ex
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/app/deps/argon2_elixir/priv/argon2_nif.so
/var/lib/docker/aufs/mnt/b49fee00603644031910f46abe673e9210f5c6e7060d149387bb1a97dc44c8f1/data/var/home/gonano/.hex/packages/hexpm/argon2_elixir-1.2.8.tar
riverrun commented 7 years ago

Can you produce a release with bcrypt_elixir, or does that result in the same errors?

zentetsukenz commented 7 years ago

@riverrun I'd already tried using bcrypt_elixir instead of argon2_elixir and bcrypt_elixir works without any error.

riverrun commented 7 years ago

@zentetsukenz version 0.12 or version 1.0?

zentetsukenz commented 7 years ago

@riverrun 1.0

riverrun commented 7 years ago

Ok. Thanks for the info.

zentetsukenz commented 7 years ago

@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.

riverrun commented 7 years ago

Just updated the hex version to 1.2.10. Let me know if there are any changes.

mihya commented 7 years ago

@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

riverrun commented 7 years ago

The latest update to the master branch contains a couple of changes to the Makefile. This makes it more like the Bcrypt Makefile.

mihya commented 7 years ago

same error on the production machine

riverrun commented 7 years ago

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

mihya commented 7 years ago

Unfortunately the error occured again.

What else could I do to help?

francocatena commented 7 years ago

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,

riverrun commented 7 years ago

@francocatena was it working with previous versions? What version of Erlang are you using?

francocatena commented 7 years ago

@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.

riverrun commented 7 years ago

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)?

francocatena commented 7 years ago

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}
riverrun commented 7 years ago

@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.

francocatena commented 7 years ago

@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 =(

riverrun commented 7 years ago

@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.

riverrun commented 7 years ago

I have just updated the hex package to 1.2.12. This has a simpler Makefile and a couple of other small changes.

mihya commented 7 years ago

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)

riverrun commented 7 years ago

I'm glad that's working for you now.

I'll keep this issue open until I hear from the other users.

francocatena commented 7 years ago

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
riverrun commented 7 years ago

I'm in the middle of fixing that error now.

riverrun commented 7 years ago

I think I have fixed this in 1.2.13.

francocatena commented 7 years ago

@riverrun great, it works now =)

Thank you very much for your work!

riverrun commented 7 years ago

Great!

I'll close this issue now. If you have any further problems, just let me know.

rawkode commented 7 years ago

@riverrun 1.2.13 does the job. Thanks! :+1:

riverrun commented 7 years ago

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.

smartdevbr commented 5 years ago

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.

riverrun commented 5 years ago

@smartdevbr it looks like you are on Windows. Please make sure that you have a C compiler installed - see this page for details.

If it still does not work, open a new issue with a title saying that it does not compile on Windows.