metajack / strophejs

The Strophe.js repository has moved to https://github.com/strophe/strophejs

Home Page:http://strophe.im/strophejs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

404 Error when attaching

WasserX opened this issue · comments

Hi, I use a module to communicate to XMPP in different websites and sometimes when I'm trying to attach a session I receive a 404 Not Found from the server after some successful exchange of packages to that same address. I don't know exactly what to post. But for starters I can send a log from wireshark.

POST http://ip-address/xmpp-bosh/ HTTP/1.1
Host: ip-address
Proxy-Connection: keep-alive
Content-Length: 114
Origin: http://localhost
User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.11 (KHTML, like Gecko) Ubuntu/11.10 Chromium/17.0.963.79 Chrome/17.0.963.79 Safari/535.11
Content-Type: application/xml
Accept: */*
Referer: http://localhost/barometre/index.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

<body rid='755570483' xmlns='http://jabber.org/protocol/httpbind' sid='74512fe31b8830e03971f540ca241eb28c93099d'/>

HTTP/1.1 200 OK
Via: 1.1 NGRPSIN-PROXY
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Content-Length: 51
Date: Wed, 28 Mar 2012 07:51:35 GMT
Content-Type: text/xml; charset=utf-8
Server: nginx/1.0.10
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type

<body xmlns='http://jabber.org/protocol/httpbind'/>

POST http://ip-address/xmpp-bosh/ HTTP/1.1
Host: ip-address
Proxy-Connection: keep-alive
Content-Length: 153
Origin: http://localhost
User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.11 (KHTML, like Gecko) Ubuntu/11.10 Chromium/17.0.963.79 Chrome/17.0.963.79 Safari/535.11
Content-Type: application/xml
Accept: */*
Referer: http://localhost/barometre/index.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

<body rid='755570485' xmlns='http://jabber.org/protocol/httpbind' sid='74512fe31b8830e03971f540ca241eb28c93099d'><presence xmlns='jabber:client'/></body>

HTTP/1.1 200 OK
Via: 1.1 NGRPSIN-PROXY
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Content-Length: 51
Date: Wed, 28 Mar 2012 07:51:36 GMT
Content-Type: text/xml; charset=utf-8
Server: nginx/1.0.10
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type

<body xmlns='http://jabber.org/protocol/httpbind'/>

POST http://ip-address/xmpp-bosh/ HTTP/1.1
Host: ip-address
Proxy-Connection: keep-alive
Content-Length: 114
Origin: http://localhost
User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.11 (KHTML, like Gecko) Ubuntu/11.10 Chromium/17.0.963.79 Chrome/17.0.963.79 Safari/535.11
Content-Type: application/xml
Accept: */*
Referer: http://localhost/barometre/index.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

<body rid='755570486' xmlns='http://jabber.org/protocol/httpbind' sid='74512fe31b8830e03971f540ca241eb28c93099d'/>

HTTP/1.1 200 OK
Via: 1.1 NGRPSIN-PROXY
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Content-Length: 95
Date: Wed, 28 Mar 2012 07:51:36 GMT
Content-Type: text/xml; charset=utf-8
Server: nginx/1.0.10
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type

<body xmlns='http://jabber.org/protocol/httpbind' type='terminate' condition='item-not-found'/>

POST http://ip-address/xmpp-bosh/ HTTP/1.1
Host: ip-address
Proxy-Connection: keep-alive
Content-Length: 189
Origin: http://localhost
User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.11 (KHTML, like Gecko) Ubuntu/11.10 Chromium/17.0.963.79 Chrome/17.0.963.79 Safari/535.11
Content-Type: application/xml
Accept: */*
Referer: http://localhost/barometre/index.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

<body rid='755570487' xmlns='http://jabber.org/protocol/httpbind' sid='74512fe31b8830e03971f540ca241eb28c93099d' type='terminate'><presence xmlns='jabber:client' type='unavailable'/></body>

HTTP/1.1 404 Not Found
Via: 1.1 NGRPSIN-PROXY
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Content-Length: 0
Date: Wed, 28 Mar 2012 07:51:36 GMT
Content-Type: text/xml; charset=utf-8
Server: nginx/1.0.10
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type

You can see pretty clearly from your log that it skipped a RID. It goes
from ..70483 to ..70485.

jack.

On Wednesday, March 28, 2012, WasserX <
reply@reply.github.com>
wrote:

Hi, I use a module to communicate to XMPP in different websites and
sometimes when I'm trying to attach a session I receive a 404 Not Found
from the server after some successful exchange of packages to that same
address. I don't know exactly what to post. But for starters I can send a
log from wireshark.

POST http://ip-address/xmpp-bosh/ HTTP/1.1
Host: ip-address
Proxy-Connection: keep-alive
Content-Length: 114
Origin: http://localhost
User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.11 (KHTML, like
Gecko) Ubuntu/11.10 Chromium/17.0.963.79 Chrome/17.0.963.79 Safari/535.11
Content-Type: application/xml
Accept: */*
Referer: http://localhost/barometre/index.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

<body rid='755570483' xmlns='http://jabber.org/protocol/httpbind'
sid='74512fe31b8830e03971f540ca241eb28c93099d'/>

HTTP/1.1 200 OK
Via: 1.1 NGRPSIN-PROXY
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Content-Length: 51
Date: Wed, 28 Mar 2012 07:51:35 GMT
Content-Type: text/xml; charset=utf-8
Server: nginx/1.0.10
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type

<body xmlns='http://jabber.org/protocol/httpbind'/>

POST http://ip-address/xmpp-bosh/ HTTP/1.1
Host: ip-address
Proxy-Connection: keep-alive
Content-Length: 153
Origin: http://localhost
User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.11 (KHTML, like
Gecko) Ubuntu/11.10 Chromium/17.0.963.79 Chrome/17.0.963.79 Safari/535.11
Content-Type: application/xml
Accept: */*
Referer: http://localhost/barometre/index.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

<body rid='755570485' xmlns='http://jabber.org/protocol/httpbind'
sid='74512fe31b8830e03971f540ca241eb28c93099d'><presence
xmlns='jabber:client'/></body>

HTTP/1.1 200 OK
Via: 1.1 NGRPSIN-PROXY
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Content-Length: 51
Date: Wed, 28 Mar 2012 07:51:36 GMT
Content-Type: text/xml; charset=utf-8
Server: nginx/1.0.10
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type

<body xmlns='http://jabber.org/protocol/httpbind'/>

POST http://ip-address/xmpp-bosh/ HTTP/1.1
Host: ip-address
Proxy-Connection: keep-alive
Content-Length: 114
Origin: http://localhost
User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.11 (KHTML, like
Gecko) Ubuntu/11.10 Chromium/17.0.963.79 Chrome/17.0.963.79 Safari/535.11
Content-Type: application/xml
Accept: */*
Referer: http://localhost/barometre/index.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

<body rid='755570486' xmlns='http://jabber.org/protocol/httpbind'
sid='74512fe31b8830e03971f540ca241eb28c93099d'/>

HTTP/1.1 200 OK
Via: 1.1 NGRPSIN-PROXY
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Content-Length: 95
Date: Wed, 28 Mar 2012 07:51:36 GMT
Content-Type: text/xml; charset=utf-8
Server: nginx/1.0.10
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type

<body xmlns='http://jabber.org/protocol/httpbind' type='terminate'
condition='item-not-found'/>

POST http://ip-address/xmpp-bosh/ HTTP/1.1
Host: ip-address
Proxy-Connection: keep-alive
Content-Length: 189
Origin: http://localhost
User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.11 (KHTML, like
Gecko) Ubuntu/11.10 Chromium/17.0.963.79 Chrome/17.0.963.79 Safari/535.11
Content-Type: application/xml
Accept: */*
Referer: http://localhost/barometre/index.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

<body rid='755570487' xmlns='http://jabber.org/protocol/httpbind'
sid='74512fe31b8830e03971f540ca241eb28c93099d' type='terminate'><presence
xmlns='jabber:client' type='unavailable'/></body>

HTTP/1.1 404 Not Found
Via: 1.1 NGRPSIN-PROXY
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Content-Length: 0
Date: Wed, 28 Mar 2012 07:51:36 GMT
Content-Type: text/xml; charset=utf-8
Server: nginx/1.0.10
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type

Reply to this email directly or view it on GitHub:
#84

Hi Jack, Clearly I missed that, I was trying to figure out why I got the 404 thinking the address wasn't correct or something. So the reason I got it was because the RID skips one value?

then again, aren't the rid values managed by strophe? why would it skip one?

Hi Jack, Clearly I missed that, I was trying to figure out why I got the
404 thinking the address wasn't correct or something. So the reason I got
it was because the RID skips one value?

There is a window of RIDs which are allowed, usually current + 2 or so.
Openfire seems extremely picky in this regard. Off by one errors generally
trigger pretty immediate 404s.

then again, aren't the rid values managed by strophe? why would it skip
one?

The RID is user-specified only on attach, so my guess was that you supplied
a RID that was off by one when you attached. If this happened during normal
operation, then it would seem like a Strophe bug.

jack.

I occasionally have this problem too. Whether I increment my RID by 1 or 2 then attach, it just gives me a 404, then I get disconnected.

Hi, Is there a anyone who could solve the problem ?