[erlang-questions] bcrypt issue -- missing library?

26 views
Skip to first unread message

ll...@writersglen.com

unread,
Mar 28, 2018, 2:38:44 PM3/28/18
to Erlang

Hello,

 

I've been using https://github.com/ferd/erlpass successfully in my code for several years.

 

But I recently had to recompile my system. When I then tried to run the sign-in function, which had never before given me problems, I got this error message:

 

(w...@127.0.0.1)2> show_page: "sign-in"

=INFO REPORT==== 28-Mar-2018::14:04:16 ===
{error,postback_request,
{url,"localhost:8020/wg_members/sign-in"},
{exit,
{noproc,
{gen_server,call,
[bcrypt_nif_worker,
{hashpw,<<"lloyd">>,
"$2a$12$Hnn1TK6HyTds7Xmf326k1.OIh/OEwi9uWqHNjHVwEQw0NKVw6X5LO"},

 

I then checked to see if crypto was started and it was:

 

(w...@127.0.0.1)2> application:start(crypto).
{error,{already_started,crypto}}

 

But application:start(bcrypt) turned up this error message:

 

(w...@127.0.0.1)4> application:start(bcrypt).

=WARNING REPORT==== 28-Mar-2018::14:12:39 ===
The on_load function for module bcrypt_nif returned {error,
{bad_lib,
"Library version (2.11) not compatible (with 2.8)."}}
{error,
{{shutdown,
{failed_to_start_child,bcrypt_nif_worker,
{undef,
[{bcrypt_nif,create_ctx,[],[]},
{bcrypt_nif_worker,init,1,
[{file,"src/bcrypt_nif_worker.erl"},{line,31}]}

 

So now I'm stuck.

 

I'm running Erlang/OTP R19

 

Can anyone tell me how to get bcrypt or functional equivalent working again?

 

All the best,

 

LRP

 

 

 

 

 

*********************************************
My books:

THE GOSPEL OF ASHES
http://thegospelofashes.com

Strength is not enough. Do they have the courage
and the cunning? Can they survive long enough to
save the lives of millions?

FREEIN' PANCHO
http://freeinpancho.com

A community of misfits help a troubled boy find his way

AYA TAKEO
http://ayatakeo.com

Star-crossed love, war and power in an alternative
universe

Available through Amazon or by request from your
favorite bookstore


**********************************************

Roger Lipscombe

unread,
Mar 28, 2018, 3:21:16 PM3/28/18
to Lloyd Prentice, Erlang
On 28 March 2018 at 19:38, <ll...@writersglen.com> wrote:
> (w...@127.0.0.1)4> application:start(bcrypt).
>
> =WARNING REPORT==== 28-Mar-2018::14:12:39 ===
> The on_load function for module bcrypt_nif returned {error,
> {bad_lib,
> "Library version (2.11) not compatible (with 2.8)."}}

You've compiled the NIF against a later version of Erlang/OTP than the
one you're attempting to use it with. The version list in erl_nif.h
says that 2.11 is OTP-19, and 2.8 is OTP-18.0.
_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

Roger Lipscombe

unread,
Mar 28, 2018, 3:22:50 PM3/28/18
to Lloyd Prentice, Erlang
On 28 March 2018 at 20:21, Roger Lipscombe <ro...@differentpla.net> wrote:
> You've compiled the NIF against a later version of Erlang/OTP than the
> one you're attempting to use it with. The version list in erl_nif.h
> says that 2.11 is OTP-19, and 2.8 is OTP-18.0.

See https://github.com/erlang/otp/blob/master/erts/emulator/beam/erl_nif.h#L33

ll...@writersglen.com

unread,
Mar 28, 2018, 4:34:48 PM3/28/18
to Roger Lipscombe, Erlang

Hi Roger,

 

I've never intentionally compiled the NIF. The only thing I've compiled is my application developed in Erlang Nitrogen.

 

Some months ago I did provision a new workstation with Erlang R19. Perhaps that's when the discrepancy crept in.

 

It seems that the problem is above my pay grade--- either in Nitrogen or Erlang.

 

It's very frustrating trying to build something to serve a worthy cause but to have tools change under my feet  without warning. I had a similar problem with the string library.

 

I'm a tool user, not a tool builder.

 

I have utmost respect for Erlang tool builders. They make possible what I'm trying to do. I know much less than they do; have much less experience. So I depend upon them. But problems like this cost me precious time and confidence.

 

Is this an issue of my own ignorance? Or an Erlang issue? Or an issue for software in general?

 

If my ignorance--- I'm sorry. I do try to fill in the gaps.

 

As it stands, I still don't know what to do to move forward.

 

All the best,

 

LRP

Bob Ippolito

unread,
Mar 28, 2018, 4:59:31 PM3/28/18
to Lloyd Prentice, Erlang
You should be able to fix this by deleting your build artifacts and recompiling with the same version of Erlang that you plan to run them with. The build tool you're using can probably do this for you (for rebar3 or rebar it'd be the clean command, if it's Makefile based you can probably make clean). The tools haven't changed, but they are clearly not robust to this kind of accident.

ll...@writersglen.com

unread,
Mar 28, 2018, 5:01:26 PM3/28/18
to ll...@writersglen.com, Erlang

First, apologies for my rant. I think there is a deep issue here, but much beyond my competencies to understand or solve.

 

Jesse Gumm has kindly helped me move forward.

 

1. Delete bcrypt from the Nitrogen stack

2. Recompile my application so rebar can pull in a current version of bcrypt.

 

This, in retrospect, is a simple technique borne, I suspect, out of experiential wisdom.

 

I wish I had understood this general technique early in my Erlang learning curve. I don't have a blog, but it would be great to have a list or tree of troubleshooting debugging techniques like this available to Erlang noobies.

 

Again, apologies.

ll...@writersglen.com

unread,
Mar 28, 2018, 5:03:12 PM3/28/18
to Bob Ippolito, Erlang

Thank you, Bob, for your patience and tolerance.

 

Jesse Gumm led me to the same solution.I wish I'd understood it much earlier in my adventures with Erlang.

 

All the best,

 

Lloyd

Reply all
Reply to author
Forward
0 new messages