Search code examples
androidxmppejabberd

ejabberd server logs show accepted connection but xmpp client shows no response from server


I recently setup ejabberd server on macos X 10.7. The server seems to be running fine and admin page is accessible via internet using http://abc.example.com:5280/admin.

I installed "simple XMPP client", "ChatSecure" and other xmpp chat client in my android phone to connect to my ejabberd server. All of them failed. When I try to connect, I can see following line in ejabberd logs

2015-07-29 23:28:58.380 [info] <0.573.0>@ejabberd_listener:accept:299 (#Port<0.7250>) Accepted connection 182.70.123.139:55402 -> 192.168.1.4:5280
2015-07-29 23:37:51.844 [info] <0.571.0>@ejabberd_listener:accept:299 (#Port<0.7277>) Accepted connection 182.70.123.139:10751 -> 192.168.1.4:5222

however, login times out on xmpp chat client. Not sure what's causing this issue. When I install similar xmpp clients on the same box where ejabberd server is running and try to connect using [email protected] , it works fine.

The issue is only coming when I use some remote machine or phone. Login doesn't work even though request is reaching to ejabberd server.

Please help


Updated post after below suggestion from raymond

Hi, Raymond

Here is the updated logs post debug mode. It is stuck at last line. Please suggest.

2015-07-30 21:16:46.450 [info] <0.566.0>@ejabberd_listener:accept:299    (#Port<0.7012>) Accepted connection 1.39.10.237:46913 -> 192.168.1.4:5222
2015-07-30 21:16:46.889 [debug] <0.586.0>@ejabberd_receiver:process_data:349 Received XML on stream = <<"<stream:stream to=\"abc.example.com\" xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\" version=\"1.0\">">>
2015-07-30 21:16:46.889 [debug] <0.587.0>@ejabberd_c2s:send_text:1901 Send XML on stream = <<"<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='129956901' from='abc.example.com' version='1.0' xml:lang='en'>">>
2015-07-30 21:16:46.890 [debug] <0.587.0>@ejabberd_c2s:send_text:1901 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='5m6LdO+13BLJZeS37oD5PF54bGY='/><register xmlns='http://jabber.org/features/iq-register'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>">>

when I try to connect using xmpp client on the same machine as ejabberd is running, its working and below is log snippet of it.I am not getting "Auth" line when I try to connect using remote machine or android device over internet.

2015-07-30 21:47:46.149 [info] <0.566.0>@ejabberd_listener:accept:299 (#Port<0.7017>) Accepted connection 182.70.123.139:55949 -> 192.168.1.4:5222
2015-07-30 21:47:46.150 [debug] <0.617.0>@ejabberd_receiver:process_data:349 Received XML on stream = <<"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<stream:stream to=\"abc.example.com\" xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\" version=\"1.0\">">>
2015-07-30 21:47:46.150 [debug] <0.618.0>@ejabberd_c2s:send_text:1901 Send XML on stream = <<"<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='1273758616' from='abc.example.com' version='1.0' xml:lang='en'>">>
2015-07-30 21:47:46.152 [debug] <0.618.0>@ejabberd_c2s:send_text:1901 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='5m6LdO+13BLJZeS37oD5PF54bGY='/><register xmlns='http://jabber.org/features/iq-register'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>">>
2015-07-30 21:47:46.156 [debug] <0.617.0>@ejabberd_receiver:process_data:349 Received XML on stream = <<"<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"DIGEST-MD5\">dXNlcm5hbWU9ImFkbWluIixyZWFsbT0iY2hhdC52b3Rlc3VwLmNvbSIsbm9uY2U9IjM3OTYwNjcwNDYiLGNub25jZT0iQitjNDNpZkZ1d3NvN2JzYXRrMGRGT3N6dDJNTGhrZ2o3YkF2bWJGVyt3Yz0iLG5jPTAwMDAwMDAyLHFvcD1hdXRoLG1heGJ1Zj02NTUzNixkaWdlc3QtdXJpPSJ4bXBwL2NoYXQudm90ZXN1cC5jb20iLHJlc3BvbnNlPWE0Nzg1MTc2ZGE0MzdkOWYyNzBmMjhmODc5ZmZhYjQx</auth>">>

Solution

  • If the connection is just slow (timeout), it could be because of carrier slowing down the traffic on port 5222.

    To validate this hypothesis, you should:

    • Use ejabberd debug log level to see if the negociation is progressing (even slowly).
    • Try to connect on port 5223 in pure SSL to see if it faster.
    • Try to run ejabberd on another port like 443 that is unlikely to be slowed down by your mobile provider.