twonds / punjab

BOSH connection manager
MIT License
183 stars 49 forks source link

Not able to connect, error 200 #64

Closed Jaykah closed 8 years ago

Jaykah commented 8 years ago

Just rolled out an update to our Openfire, twistd, the server OS and SSL. Something started causing Punjab's connection to fail with the following:

============
2016-07-21T00:32:48+0000 [-] HTTPB Error 200
2016-07-21T00:32:48+0000 [-] HTTPB Return Error: 200 -> <body xmlns='http://jabber.org/protocol/httpbind' type='terminate' condition='remote-connection-failed'/>
2016-07-21T00:32:48+0000 [twisted.python.log#info] "172.16.13.33" - - [21/Jul/2016:00:32:48 +0000] "POST /http-bind// HTTP/1.0" 200 105 "https://mywebsite.mywebsite.info/" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"
2016-07-21T00:34:19+0000 [-] SESSION -> Terminate
2016-07-21T00:34:19+0000 [-] expire (54de99ac3a3b8db84605e2503841a908916f56b1)
2016-07-21T00:34:19+0000 [-] 0
2016-07-21T00:41:13+0000 [_GenericHTTPChannelProtocol,1462,172.16.13.33] HEADERS 1469061673.66:
2016-07-21T00:41:13+0000 [_GenericHTTPChannelProtocol,1462,172.16.13.33] Headers({'origin': ['https://mywebsite.mywebsite.info'], 'content-length': ['215'], 'accept-language': ['en-US,en;q=0.8,ru;q=0.6'], 'accept-encoding': ['gzip, deflate, br'], 'connection': ['close'], 'accept': ['*/*'], 'user-agent': ['Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36'], 'host': ['mywebsite.mywebsite.info'], 'referer': ['https://mywebsite.mywebsite.info/'], 'pragma': ['no-cache'], 'cache-control': ['no-cache'], 'cookie': ['SESSID=dufegu51j5o7gv9lad4t74vi41; lang=en_US; candy-nostatusmessages=1'], 'content-type': ['text/plain;charset=UTF-8']})
2016-07-21T00:41:13+0000 [_GenericHTTPChannelProtocol,1462,172.16.13.33] HTTPB POST :
2016-07-21T00:41:13+0000 [_GenericHTTPChannelProtocol,1462,172.16.13.33] <body rid='752667662' xmlns='http://jabber.org/protocol/httpbind' to='chat.mywebsite.com' xml:lang='en' wait='60' hold='1' content='text/xml; charset=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh'/>
2016-07-21T00:41:13+0000 [_GenericHTTPChannelProtocol,1462,172.16.13.33] Session Created : cc208b2119ca9560b96a1a85165ca45d9a8e3797 1469061673.66
2016-07-21T00:41:13+0000 [_GenericHTTPChannelProtocol,1462,172.16.13.33] ================================== 1469061673.66 connect to chat.mywebsite.com:0 ==================================
2016-07-21T00:41:13+0000 [punjab.session.Session#info] Starting factory <punjab.session.Session object at 0x7f754e399390>
2016-07-21T00:41:13+0000 [Uninitialized] <twisted.internet.tcp.Connector instance at 0x7f754e3a3a28> will retry in 2 seconds
2016-07-21T00:41:13+0000 [punjab.session.Session#info] Stopping factory <punjab.session.Session object at 0x7f754e399390>
2016-07-21T00:41:16+0000 [punjab.session.Session#info] Starting factory <punjab.session.Session object at 0x7f754e399390>
2016-07-21T00:41:16+0000 [Uninitialized] <twisted.internet.tcp.Connector instance at 0x7f754e3a3a28> will retry in 6 seconds
2016-07-21T00:41:16+0000 [punjab.session.Session#info] Stopping factory <punjab.session.Session object at 0x7f754e399390>
2016-07-21T00:41:22+0000 [punjab.session.Session#info] Starting factory <punjab.session.Session object at 0x7f754e399390>
2016-07-21T00:41:22+0000 [Uninitialized] Abandoning <twisted.internet.tcp.Connector instance at 0x7f754e3a3a28> after 3 retries.
2016-07-21T00:41:22+0000 [punjab.session.Session#info] Stopping factory <punjab.session.Session object at 0x7f754e399390>
2016-07-21T00:41:42+0000 [-] ================================== cc208b2119ca9560b96a1a85165ca45d9a8e3797 1469061702.88 startup timeout ==================================

It looks like a closed port, but not sure where. Openfire is located on localhost, the host name is present in /etc/hosts, and client connections are allowed on the Openfire server.

Could you please point me in the right direction?

Jaykah commented 8 years ago

It seems like it is trying to connect to localhost via the external IP, is there a way to confirm and fix that?

Jaykah commented 8 years ago

Ah, another thing - it seems like it is connecting to port 0

Jaykah commented 8 years ago

Adding ssl certs to the command fixed the issue.