[ejabberd] Ejabberd 'module could not be loaded', httpc, request,

Aron Sogor bigman at gmail.com
Thu Dec 23 18:55:06 MSK 2010


Konstantin,

Thanks for the response!
You running: Erlang R14A (erts-5.8)
I had the problem with:  erts-5.7.2

Once I downloaded the Erlang tarball and compiled an R14A, I was fine too.

R13: has inets-5.1 ... R14 is much like 5.5 or something(so least not
the same version)
/usr/lib/erlang/lib/inets-5.1/ebin/httpc_request.beam

Per my module you right, it is something I made for our app, pretty
useless for anyone else, so I post the snipet:

login(Server,User,Passwd) ->
    Url = string:join(["http://",Server,"/ejabberd/validateTokenAndPogoId/",
Passwd ,"/" , User], ""),
	{Resp, Result} = httpc:request(Url),
	response_handle(Resp, Result,?GENIUS_AUTH_OK,?GENIUS_AUTH_REJECTED).

Can you help me identify that R13 inets supports: httpc:request(Url)?
where would I find the docs for the 5.1 version?
Is there a way to look at the beam file:
/usr/lib/erlang/lib/inets-5.1/ebin/httpc_request.beam
some way to inspect the symbol? decompile? confirm it has
request(String) support?

It seems to relate to the version because simply switching the erl
executable in the ejabberctl make the above work.

Along the same notes is there a way to tell what version of Ubuntu I am using?
uname-a >> does not tell me anything
And is there a way to force to fetch erlang from a later release?
Clearly you got R14 on debian from somewhere... I would like it too :)
ATM I compiled from source.

I know many questions... any answer much appreciated.

Aron
On Thu, Dec 23, 2010 at 5:24 AM, Konstantin Khomoutov
<flatworm at users.sourceforge.net> wrote:
> On Wed, 22 Dec 2010 19:26:02 -0800
> Aron Sogor <bigman at gmail.com> wrote:
>
>>I am trying to make an external connection in an auth module and I get
>>an error:
>>
>>** Reason for termination =
>>** {'module could not be loaded',
>>       [{httpc,request,
>>            ["http://www.alpha.pogospike.com/ejabberd/validateTokenAndPogoId/e4d7e947-6af5-4fe6-a2b8-bfbb5d07ec19/16501457"]},
>>        {genius_validator,login,3},
>>        {ejabberd_auth_genius,handle_login,3},
>>        {ejabberd_auth,check_password_loop,2},
>>        {cyrsasl_plain,mech_step,2},
>>        {cyrsasl,server_step,2},
>>        {ejabberd_c2s,wait_for_feature_request,2},
>>        {p1_fsm,handle_msg,10}]}
>>
>>
>>
>>This is on Ubuntu running R13.
>>
>>I run the same on MacPort R14 no problem.
>>
>>I check on Ubuntu:
>>/usr/lib/erlang/erts-5.7.2
>>/usr/lib/erlang/lib/inets-5.1/ebin/httpc_request.beam
>>
>>soo the module seems to be there.. it is a different version of
>>runtime. is there some lib searchpath I am missing?
>
> I cannot google up anything about ejabberd_auth_genius except your
> message, so it appears to be the module you're developing.
> So until we see the code of genius_validator:login/3, it's impossible
> to do further guessing.
>
> Just one idea: Erlang is packaged for Debian (and pulled by Ubuntu from
> there) as a set of many small packages (with the "erlang" being the
> meta-package which installs everything else), and ejabberd depends only
> on a minimal set of packages needed to run that server; hence if your
> Erlang packages were pulled as a result of doing `aptitude install
> ejabberd` or the equivalent, it's no surprise something's amiss
> compared to your Mac install which presumably has every bit or Erlang
> runtime installed.
>
> On the other hand, a no-brainer code involving httpc:request/1 appears
> to work for me in my Debian Sid chroot which has just the minimal Erlang
> install required by ejabberd:
>
> % erl
> Erlang R14A (erts-5.8) [source] [rq:1] [async-threads:0]
> [kernel-poll:false]
>
> Eshell V5.8  (abort with ^G)
> 1> inets:start(permanent).
> ok
> 2> httpc:request("http://localhost").
> {ok,{{"HTTP/1.1",200,"OK"},
>     [{"connection","Keep-Alive"},
>      {"date","Thu, 23 Dec 2010 13:19:29 GMT"},
>      {"server",
>       "Apache/2.2.9 (Debian) PHP/4.4.4-8+etch6 mod_perl/2.0.4
> Perl/v5.10.0"}, {"content-length","1868"},
>      {"content-type","text/html;charset=UTF-8"},
>      {"keep-alive","timeout=15, max=100"}],
>     "<!DOCTYPE HTML PUBLIC ...
>
> And the list of installed Erlang packages:
>
> % aptitude search -F %p '~i~nerlang*'
> erlang-asn1
> erlang-base
> erlang-crypto
> erlang-dev
> erlang-inets
> erlang-mnesia
> erlang-odbc
> erlang-parsetools
> erlang-public-key
> erlang-runtime-tools
> erlang-ssl
> erlang-syntax-tools
>


More information about the ejabberd mailing list