Autobahn website issue while working with twistd using tac file

I have a WebSocket server implemented using autobahn WebSocket frame using twisted. The WebSocket server works fine when the program is launched using python. But if I run this using twistd server runner, creating a tac file as a twisted service, I get the following error on the server, while any client is trying to establish a connection, and the handshake fails.

2015-12-08 07:17:56,022 - CRITICAL - twisted.publishToNewObserver() 154 Unhandled Error Traceback (most recent call last): File "/opt/nrgi-ws/nrgi-ws-virtual-env/local/lib/python2.7/site-packages/twisted/python/log.py", line 84, in callWithContext return context.call({ILogContext: newCtx}, func, *args, **kw) File "/opt/nrgi-ws/nrgi-ws-virtual-env/local/lib/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext return self.currentContext().callWithContext(ctx, func, *args, **kw) File "/opt/nrgi-ws/nrgi-ws-virtual-env/local/lib/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext return func(*args,**kw) File "/opt/nrgi-ws/nrgi-ws-virtual-env/local/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 597, in _doReadOrWrite why = selectable.doRead() --- <exception caught here> --- File "/opt/nrgi-ws/nrgi-ws-virtual-env/local/lib/python2.7/site-packages/twisted/internet/tcp.py", line 1067, in doRead protocol = self.factory.buildProtocol(self._buildAddr(addr)) File "/opt/nrgi-ws/nrgi-ws-virtual-env/local/lib/python2.7/site-packages/twisted/internet/protocol.py", line 135, in buildProtocol p = self.protocol() File "/opt/nrgi-ws/nrgi-ws-virtual-env/local/lib/python2.7/site-packages/autobahn/websocket/protocol.py", line 665, in __init__ self.is_closed = txaio.create_future() File "/opt/nrgi-ws/nrgi-ws-virtual-env/local/lib/python2.7/site-packages/txaio/_unframework.py", line 43, in _throw_usage_error "To use txaio, you must first select a framework " exceptions.RuntimeError: To use txaio, you must first select a framework with .use_twisted() or .use_txaio()

+4
source share
4 answers

Today I found the same problem. You must downgrade txaio to version 1.1.0

autobahn (0.10.9) autobahntestsuite (0.7.3) Twisted (15.4.0) txaio (1.1.0) zope.interface(4.1.3)

+2

Ubuntu. ec2 Machine Image Amazon Linux AMI. , txaio . , , @holder.vasc , , . tac :

import txaio txaio.use_twisted()

, .

0

Autobahn? , , (dd1cff8f9480a125e510108482bfaf5b9eedc916).

: pip install https://github.com/crossbario/autobahn-python/archive/master.zip

0
source

AutobahnTestSuite has just been updated and fixed this problem:

autobahn (0.10.9) autobahntestsuite (0.7.4) Twisted (15,5.0) txaio (2.1.0)

0
source

Source: https://habr.com/ru/post/1619039/


All Articles