hellozedan / node-xmpp-bosh

Automatically exported from code.google.com/p/node-xmpp-bosh
0 stars 0 forks source link

Connect issue to jappix.com #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

Another issue now, we have it on all our machines running NXB, local and 
external from the jappix.com XMPP server.

When connecting, client-side, NXB replies to the first request, but not the 
second one: the http connection is kept, the client still sends a new http 
request each 20seconds and the BOSH server replies well to the last request 
with an empty <body />.

But the session is not established!

I get this log:

vanaryon@jappix:~/node/bosh$ NODE_PATH=~/libs ./run*
+-------------------------------------------------------------------------------
-----------------------------+
| Starting BOSH server 'v0.1.15' on 'http://0.0.0.0:5282/^\/$/' at 'Thu Jun 02 
2011 19:05:24 GMT+0000 (UTC)' |
+-------------------------------------------------------------------------------
-----------------------------+
DEBUG Thu Jun 02 2011 19:05:24 GMT+0000 (UTC) bosh_server: [object Object]
DEBUG Thu Jun 02 2011 19:05:34 GMT+0000 (UTC) BOSH::Someone connected
DEBUG Thu Jun 02 2011 19:05:34 GMT+0000 (UTC) BOSH::Processing 'GET' request at 
location: /
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) BOSH::Someone connected
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) BOSH::Someone connected
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) BOSH::Processing request: <body 
xml:lang="fr" content="text/xml; charset=utf-8" hold="1" 
xmlns="http://jabber.org/protocol/httpbind" to="jappix.com" wait="20" 
rid="191338" secure="true" newkey="f9206d6520597d4b081b54a052c57921193514cb" 
ver="1.6" xmlns:xmpp="urn:xmpp:xbosh" xmpp:version="1.0"/>
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) BOSH::Session creation
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) 
BOSH::53d27228-5bfc-473b-9f16-209f1c41f365::adding a response object. Holding 0 
response objects
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) 
BOSH::53d27228-5bfc-473b-9f16-209f1c41f365::setting a timeout of '80' sec
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) 
BOSH::53d27228-5bfc-473b-9f16-209f1c41f365::enqueue_response
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) 
BOSH::53d27228-5bfc-473b-9f16-209f1c41f365::Merging with response at index: -1
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) LOOKUP 
SERVICE::try_connect_SRV_lookup
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) 
BOSH::53d27228-5bfc-473b-9f16-209f1c41f365::Returning response object with rid: 
191338
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) 
BOSH::53d27228-5bfc-473b-9f16-209f1c41f365::Holding 0 response objects
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) 
BOSH::53d27228-5bfc-473b-9f16-209f1c41f365::pop_and_send: ro:true, 
state.pending.length: 1
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) 
BOSH::53d27228-5bfc-473b-9f16-209f1c41f365::send_no_requeue, ro valid: true
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) 
BOSH::53d27228-5bfc-473b-9f16-209f1c41f365::send_no_requeue, rid: 191338
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) 
BOSH::53d27228-5bfc-473b-9f16-209f1c41f365::send_no_requeue:writing response: 
<body xmlns="http://jabber.org/protocol/httpbind" 
stream="c7756eda-8ee3-40b0-a4bb-d7ec96d4d177" 
sid="53d27228-5bfc-473b-9f16-209f1c41f365" wait="20" polling="35" 
inactivity="70" requests="2" hold="1" from="jappix.com" content="text/xml; 
charset=utf-8" xmpp:restartlogic="true" xmlns:xmpp="urn:xmpp:xbosh" window="2"/>
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) 
BOSH::53d27228-5bfc-473b-9f16-209f1c41f365::send_pending_responses::state.pendin
g.length: 0
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) BOSH::Someone connected
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) BOSH::Processing request: <body 
xml:lang="fr" rid="191339" sid="53d27228-5bfc-473b-9f16-209f1c41f365" 
xmlns="http://jabber.org/protocol/httpbind" 
key="bb0579ff60a382db73f37000791cf28ddf94a532"/>
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) 
BOSH::53d27228-5bfc-473b-9f16-209f1c41f365::RID: 191339, state.RID: 191338
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) 
BOSH::53d27228-5bfc-473b-9f16-209f1c41f365::is_valid_packet::node.attrs.rid:1913
39, state.rid:191338
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) 
BOSH::53d27228-5bfc-473b-9f16-209f1c41f365::setting a timeout of '80' sec
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) 
BOSH::53d27228-5bfc-473b-9f16-209f1c41f365::updated RID to: 191339
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) 
BOSH::53d27228-5bfc-473b-9f16-209f1c41f365::adding a response object. Holding 0 
response objects
DEBUG Thu Jun 02 2011 19:05:41 GMT+0000 (UTC) 
BOSH::53d27228-5bfc-473b-9f16-209f1c41f365::send_pending_responses::state.pendin
g.length: 0
DEBUG Thu Jun 02 2011 19:06:01 GMT+0000 (UTC) 
BOSH::53d27228-5bfc-473b-9f16-209f1c41f365::send_no_requeue, ro valid: true
DEBUG Thu Jun 02 2011 19:06:01 GMT+0000 (UTC) 
BOSH::53d27228-5bfc-473b-9f16-209f1c41f365::send_no_requeue, rid: 191339
DEBUG Thu Jun 02 2011 19:06:01 GMT+0000 (UTC) 
BOSH::53d27228-5bfc-473b-9f16-209f1c41f365::send_no_requeue:writing response: 
<body xmlns="http://jabber.org/protocol/httpbind"/>

Original issue reported on code.google.com by vanaryon on 2 Jun 2011 at 7:15

GoogleCodeExporter commented 8 years ago
> Another issue now, we have it on all our machines running NXB, local 
> and external from the jappix.com XMPP server.

This is good news!! :-)

> When connecting, client-side, NXB replies to the first request, but not 
> the second one: the http connection is kept, the client still sends a 
> new http request each 20seconds and the BOSH server replies well to the 
> last request with an empty <body />.

This is what I think is happening. Currently, NXB optimizes the case of 
multiple streams (since that is what it was written for) and due to this 
optimization, it returns a session creation response even before a connection 
to the upstream XMPP server is made. What this means is that till the 
connection (or in this case, DNS resolution fails) is made, the client will 
keep re-sending empty bodies. What seems to be happening here is that the proxy 
can not either resolve DNS (is resolv.conf set) or connect to the jappix.com 
server.

Original comment by dhruvb...@gmail.com on 2 Jun 2011 at 7:33

GoogleCodeExporter commented 8 years ago
This is happening because the SRV lookup is taking too long (since the 
jappix.com domain is returning a CNAME record for an SRV query). Either that is 
wrong or the SRV module needs to be updated to handle this case. Will 
investigate and update accordingly.

Original comment by dhruvb...@gmail.com on 2 Jun 2011 at 10:07

GoogleCodeExporter commented 8 years ago
I changed the DNS records server side, and removed any wildcard to use manual 
DNS configuraton (subdomain per subdomain).

Here is the full Bind9 file:

@ 86400 IN A 95.142.175.37
@ 86400 IN AAAA 2001:4b98:dc0:51:216:3eff:fe5d:90a1
anonymous 86400 IN CNAME @
bind 86400 IN CNAME @
irc 86400 IN CNAME @
logs 86400 IN CNAME @
mini 86400 IN CNAME @
msn 86400 IN CNAME @
muc 86400 IN CNAME @
project 86400 IN CNAME @
pubsub 86400 IN CNAME @
static 86400 IN CNAME @
vjud 86400 IN CNAME @
www 86400 IN CNAME @
_xmpp-client._tcp 86400 IN SRV 10 0 5222 @
_xmpp-client._tcp.anonymous 86400 IN SRV 10 0 5222 @
_xmpp-server._tcp 86400 IN SRV 10 0 5269 @
_xmpp-server._tcp.anonymous 86400 IN SRV 10 0 5269 @
_xmpp-server._tcp.irc 86400 IN SRV 10 0 5269 @
_xmpp-server._tcp.msn 86400 IN SRV 10 0 5269 @
_xmpp-server._tcp.muc 86400 IN SRV 10 0 5269 @
_xmpp-server._tcp.pubsub 86400 IN SRV 10 0 5269 @
_xmpp-server._tcp.vjud 86400 IN SRV 10 0 5269 @

I have to wait next morning to let you know if NXB works with that, because of 
the TTL which is one day.

Original comment by vanaryon on 3 Jun 2011 at 8:50

GoogleCodeExporter commented 8 years ago
Okay, after the DNS cache was purged and the new entries got, using valid SRV 
records all went fine.

So you'd better try to use some kind of regex to avoid using a bad DNS reply as 
a valid reply ;)

Original comment by vanaryon on 4 Jun 2011 at 8:43

GoogleCodeExporter commented 8 years ago
Yeah, should perform the validation for SRV records

Original comment by dhruvb...@gmail.com on 4 Jun 2011 at 9:41

GoogleCodeExporter commented 8 years ago

Original comment by vanaryon on 5 Jun 2011 at 7:02