why hourly disconnect??? (autobahn-python)

#1

I have an asyncio-based autobahn-python app that connects to a Crossbar router.

For some reason, it keeps unexpetdly disconnecting once per hour. I have not found anything in my app that could cause it. Is there something built into autobahn-python or crossbar that could cause this? Could this be a socket or websocket keepalive issue?

Here’s the log from crossbar:

2016-12-16T08:14:45+0200 [Router 3041 crossbar.router.protocol.WampWebSocketServerProtocol] Connection to/from tcp4:xxx.xx.xx.xx:57396 was lost in a no
n-clean fashion: Connection to the other side was lost in a non-clean fashion: Connection lost.
2016-12-16T08:14:45+0200 [Router 3041 crossbar.router.protocol.WampWebSocketServerProtocol] _connectionLost: [Failure instance: Traceback (failure with
no frames): <class ‘twisted.internet.error.ConnectionLost’>: Connection to the other side was lost in a non-clean fashion: Connection lost.
]
2016-12-16T08:14:45+0200 [Router 3041 crossbar.router.protocol.WampWebSocketServerProtocol] WAMP-over-WebSocket transport lost: wasClean=False, code=100
6, reason=“connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)”

I have yet to add more debugging into the app. I am not sure where I should even add the debugging hooks to get to the bottom of this most effectively, any suggestions?

Baffled-ly yours,

Petri

0 Likes

#2

Hi, is the connection between crossbar and client local, local network, or between two locations?
(is either of the machines involved using DHCP?)

0 Likes

#3

Hi Petri,

there is nothing in either Crossbar.io or Autobahn that would disconnect automatically. Like Gareth suggests, the most likely culprit here is a network issue.

Regards,

Alex

···

Am Freitag, 16. Dezember 2016 07:53:07 UTC+1 schrieb Petri Savolainen:

I have an asyncio-based autobahn-python app that connects to a Crossbar router.

For some reason, it keeps unexpetdly disconnecting once per hour. I have not found anything in my app that could cause it. Is there something built into autobahn-python or crossbar that could cause this? Could this be a socket or websocket keepalive issue?

Here’s the log from crossbar:

2016-12-16T08:14:45+0200 [Router 3041 crossbar.router.protocol.WampWebSocketServerProtocol] Connection to/from tcp4:xxx.xx.xx.xx:57396 was lost in a no
n-clean fashion: Connection to the other side was lost in a non-clean fashion: Connection lost.
2016-12-16T08:14:45+0200 [Router 3041 crossbar.router.protocol.WampWebSocketServerProtocol] _connectionLost: [Failure instance: Traceback (failure with
no frames): <class ‘twisted.internet.error.ConnectionLost’>: Connection to the other side was lost in a non-clean fashion: Connection lost.
]
2016-12-16T08:14:45+0200 [Router 3041 crossbar.router.protocol.WampWebSocketServerProtocol] WAMP-over-WebSocket transport lost: wasClean=False, code=100
6, reason=“connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)”

I have yet to add more debugging into the app. I am not sure where I should even add the debugging hooks to get to the bottom of this most effectively, any suggestions?

Baffled-ly yours,

Petri

0 Likes

#4

I have a very simple autobahn python script that keeps freezing (disconnecting) every 4 to 8 hours, never makes past this time. And this script is really really simple, so there are no errors in the script and no reason for the script to disconnect. I have tried it with both twisted and asyncio so the problem is also not there. And I also tried a nodejs version of the same script to test if the problem is on the server side. It is not - the nodejs version never disconnects, but the python version always disconnects in 4-8h period.

DP

There really seems to be some kind of overflow happening in python script …

In twisted the error is simply “Disconnected”, on asyncio the script just freezes at some point.

···

On Friday, December 16, 2016 at 1:33:42 PM UTC+2, Alexander Gödde wrote:

Hi Petri,

there is nothing in either Crossbar.io or Autobahn that would disconnect automatically. Like Gareth suggests, the most likely culprit here is a network issue.

Regards,

Alex

Am Freitag, 16. Dezember 2016 07:53:07 UTC+1 schrieb Petri Savolainen:

I have an asyncio-based autobahn-python app that connects to a Crossbar router.

For some reason, it keeps unexpetdly disconnecting once per hour. I have not found anything in my app that could cause it. Is there something built into autobahn-python or crossbar that could cause this? Could this be a socket or websocket keepalive issue?

Here’s the log from crossbar:

2016-12-16T08:14:45+0200 [Router 3041 crossbar.router.protocol.WampWebSocketServerProtocol] Connection to/from tcp4:xxx.xx.xx.xx:57396 was lost in a no
n-clean fashion: Connection to the other side was lost in a non-clean fashion: Connection lost.
2016-12-16T08:14:45+0200 [Router 3041 crossbar.router.protocol.WampWebSocketServerProtocol] _connectionLost: [Failure instance: Traceback (failure with
no frames): <class ‘twisted.internet.error.ConnectionLost’>: Connection to the other side was lost in a non-clean fashion: Connection lost.
]
2016-12-16T08:14:45+0200 [Router 3041 crossbar.router.protocol.WampWebSocketServerProtocol] WAMP-over-WebSocket transport lost: wasClean=False, code=100
6, reason=“connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)”

I have yet to add more debugging into the app. I am not sure where I should even add the debugging hooks to get to the bottom of this most effectively, any suggestions?

Baffled-ly yours,

Petri

0 Likes

#5

Hi DP,

Any chance you could post your code?

0 Likes

#6

most likely reason: an intermediary (some firewall, NAT or reverse proxy) is timing out the websocket connection due to inactivity.

when using Crossbar.io, enable auto-pingpong to keep connection alive
check out

http://crossbar.io/docs/WebSocket-Options/#production-settings

I have a very simple autobahn python script that keeps freezing
(disconnecting) every 4 to 8 hours, never makes past this time. And this
script is really really simple, so there are no errors in the script and no
reason for the script to disconnect. I have tried it with both twisted and
asyncio so the problem is also not there. And I also tried a nodejs version
of the same script to test if the problem is on the server side. It is not
- the nodejs version never disconnects, but the python version always
disconnects in 4-8h period.

DP

There really seems to be some kind of overflow happening in python script

unlikely

···

Am 21.03.2017 um 07:52 schrieb Deep Bits:

...

In twisted the error is simply "Disconnected", on asyncio the script just
freezes at some point.

On Friday, December 16, 2016 at 1:33:42 PM UTC+2, Alexander Gödde wrote:

Hi Petri,

there is nothing in either Crossbar.io or Autobahn that would disconnect
automatically. Like Gareth suggests, the most likely culprit here is a
network issue.

Regards,

Alex

Am Freitag, 16. Dezember 2016 07:53:07 UTC+1 schrieb Petri Savolainen:

I have an asyncio-based autobahn-python app that connects to a Crossbar
router.

For some reason, it keeps unexpetdly disconnecting once per hour. I have
not found anything in my app that could cause it. Is there something built
into autobahn-python or crossbar that could cause this? Could this be a
socket or websocket keepalive issue?

Here's the log from crossbar:

2016-12-16T08:14:45+0200 [Router 3041

crossbar.router.protocol.WampWebSocketServerProtocol] Connection to/from
tcp4:xxx.xx.xx.xx:57396 was lost in a no
n-clean fashion: Connection to the other side was lost in a non-clean
fashion: Connection lost.
2016-12-16T08:14:45+0200 [Router 3041
crossbar.router.protocol.WampWebSocketServerProtocol] _connectionLost:
[Failure instance: Traceback (failure with
no frames): <class 'twisted.internet.error.ConnectionLost'>: Connection
to the other side was lost in a non-clean fashion: Connection lost.
]
2016-12-16T08:14:45+0200 [Router 3041
crossbar.router.protocol.WampWebSocketServerProtocol] WAMP-over-WebSocket
transport lost: wasClean=False, code=100
6, reason="connection was closed uncleanly (peer dropped the TCP
connection without previous WebSocket closing handshake)"

I have yet to add more debugging into the app. I am not sure where I
should even add the debugging hooks to get to the bottom of this most
effectively, any suggestions?

Baffled-ly yours,

Petri

0 Likes