rwbr / exmlrpc

An HTTP 1.1 compliant XML-RPC library for Erlang
Other
19 stars 7 forks source link

Problem in tcp_serv:init when using with ejabberd #2

Closed crbkrishnan closed 13 years ago

crbkrishnan commented 13 years ago

Hi

I get the following error when using exmlrpc with ejabberd.

=CRASH REPORT==== 11-Oct-2011::16:00:13 === crasher: initial call: tcp_serv:init/2 pid: <0.384.0> registered_name: [] exception error: no function clause matching gen_tcp:mod({ip,{0,0,0,0}},undefined) in function gen_tcp:listen/2 in call from tcp_serv:init/2 ancestors: [ejabberd_listeners,ejabberd_sup,<0.36.0>] messages: [] links: [<0.263.0>] dictionary: [] trap_exit: true status: running heap_size: 377 stack_size: 24 reductions: 94 neighbours:

I use ejabberd2.1.6 and erlang R14B03. ejabberd.cfg contains

{4560, ejabberd_xmlrpc, [{maxsessions, 10}, {timeout, 5000}]}

Could you please tell me if this is a known problem or if there is something wrong? TIA.

Regards Balakrishnan.

rwbr commented 13 years ago

Well, take a look at the source code and read please your crash log carefully. Your crash log says, that your application crashes in gen_tcp:listen, because there is no function clause that matches "gen_tcp:mod({ip,{0,0,0,0}},undefined)". The function gen_tcp:listen is called from tcp_serv:init, which is called from xmlrpc:start_link. You need to check the arguments, that you give the xmlrpc:start_link function. Do they have the proper format? It seems to me, that you put a tuple of {ip,{0,0,0,0}} where only an Integer representing a port number is expected. I don't think, the crash is in any way related to the xmlrpc library.

crbkrishnan commented 13 years ago

Hi Ralf

I agree that this is not inside xmlrpc. The calling module (ejabberd_xmlrpc) seems to have a problem, which I've fixed by parsing the options again. Not sure why it fails initially, though. I'm quite new to Erlang, so couldn't diagnose the bug correctly. Thanks for your time.

Regards Balakrishnan. On 13-Oct-2011, at 1:42 AM, Ralf Weinbrecher wrote:

Well, take a look at the source code and read please your crash log carefully. Your crash log says, that your application crashes in gen_tcp:listen, because there is no function clause that matches "gen_tcp:mod({ip,{0,0,0,0}},undefined)". The function gen_tcp:listen is called from tcp_serv:init, which is called from xmlrpc:start_link. You need to check the arguments, that you give the xmlrpc:start_link function. Do they have the proper format? It seems to me, that you put a tuple of {ip,{0,0,0,0}} where only an Integer representing a port number is expected. I don't think, the crash is in any way related to the xmlrpc library.

Reply to this email directly or view it on GitHub: https://github.com/rwbr/exmlrpc/issues/2#issuecomment-2385114