erlyaws / yaws

Yaws webserver
https://erlyaws.github.io
BSD 3-Clause "New" or "Revised" License
1.28k stars 268 forks source link

Yaws Embedded on R13B04 failing for me with ** exception exit: {noproc,{gen_server,call, [yaws_server,check_certs,infinity]}} #34

Closed grempe closed 14 years ago

grempe commented 14 years ago

Hi,

I am seeing the following error after upgrading to R13B04 that I wasn't seeing on R13B03.

http://pastie.org/853105

I have an OTP app which is starting embedded yaws in the following way (alternative better suggestions welcome!).

http://pastie.org/853110

I was not seeing this error on my OS X dev erlang install until I upgraded to R13B04. I was able to resolve it on my dev box by adding the line:

    application:start(ssl),

Which was just based on a hunch from looking at:

http://github.com/klacke/yaws/blob/4683f85d8872201d706a6b4850b6a44a565ad1ef/src/yaws_api.erl#L1761

However, on my Ubuntu 9.10 box, also with a freshly upgraded R13B04 I always get the error above even if I start the ssl app. I saw only one other mention of this issue on Google in the following similar unanswered thread:

http://groups.google.com/group/erlang-programming/browse_thread/thread/16c471a7263792b6

Here is the erl info on the Ubuntu box:

[glenn@www1 txchat-otp (master)]$ erl
Erlang R13B04 (erts-5.7.5) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]

And on OS X:

glenn@macbook-pro ~/src/git/txchat-otp [1.9.1][master]$ erl
Erlang R13B04 (erts-5.7.5) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]

Hope you can provide some insight. Thx

klacke commented 14 years ago

My hunch here is that there is something wrong with your OTP installation. The error

 Reason:     {'EXIT',{error,could_not_load_driver}}

Seems to indicate that there is something wrong with your OTP installation. You fail to load the linked in driver for sendfile(). Next step to debug this - at your end - is to try to start yaws outside your application as

% yaws -i

And see if the driver still cannot be loaded.

I've tried on R13B04 and see no problems.

/klacke

grempe commented 14 years ago

I figured it out. I had naively 'vendored' a copy of yaws under my deps dir in my OTP app, assuming I could push that around to any env without having to do a local install of Yaws (thinking it was only beam files). Obviously this is incorrect since at least the following native libs where included in that dir (compiled for OS X) which were failing to load on the linux server.

deps/yaws/priv/lib/setuid_drv.so
deps/yaws/priv/lib/yaws_sendfile_drv.so

Once I changed my erl -pa to include /usr/local/lib/yaws/ebin on both systems (which now have native installs of Yaws compiled from source) all was good under R13B04 on both systems.

yaws -i works fine.

Thanks. My error.