简体   繁体   中英

Running autobahn python on linux gives exceptions.AttributeError: Router instance has no attribute 'broker'

I am attempting to run a autobahn WAMP application using twisted on a linux machine(ubuntu server 64bit).

I did note that when developing/testing I needed to install pywin32 after using wamp.Application, but this is of course not available/useful in a linux environment.

Previously I have been running autobahn websocket programs on this machine fine, but this error occurs now with the switch to using autobahn.twisted.wamp.Application

Any help to combat this problem so I can get the application running will be helpfull.

my imports are:

from twisted.internet.defer import returnValue
from autobahn.twisted.wamp import Application

I get the following stack trace:

2014-08-23 09:54:15+1200 [WampWebSocketServerProtocol,0,127.0.0.1] RX WAMP HELLO
 Message (realm = realm1, roles = [<autobahn.wamp.role.RoleSubscriberFeatures in
stance at 0x9bd79ec>, <autobahn.wamp.role.RolePublisherFeatures instance at 0x9b
d7aec>, <autobahn.wamp.role.RoleCallerFeatures instance at 0x9bd7b6c>, <autobahn
.wamp.role.RoleCalleeFeatures instance at 0x9bd7fac>], authmethods = None, authi
d = None)
2014-08-23 09:54:15+1200 [WampWebSocketServerProtocol,0,127.0.0.1] Unhandled err
or in Deferred:
2014-08-23 09:54:15+1200 [WampWebSocketServerProtocol,0,127.0.0.1] Unhandled Err
or
        Traceback (most recent call last):
          File "/usr/local/lib/python2.7/dist-packages/autobahn/wamp/websocket.p
y", line 90, in onMessage
            self._session.onMessage(msg)
          File "/usr/local/lib/python2.7/dist-packages/autobahn/wamp/protocol.py
", line 1267, in onMessage
            self._add_future_callbacks(d, success, failed)
          File "/usr/local/lib/python2.7/dist-packages/autobahn/twisted/wamp.py"
, line 72, in _add_future_callbacks
            return future.addCallbacks(callback, errback)
          File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py
", line 295, in addCallbacks
            self._runCallbacks()
        --- <exception caught here> ---
          File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py
", line 577, in _runCallbacks
            current.result = callback(current.result, *args, **kw)
          File "/usr/local/lib/python2.7/dist-packages/autobahn/wamp/protocol.py
", line 1250, in success
            welcome(self._realm, res.authid, res.authrole, res.authmethod, res.a
uthprovider)
          File "/usr/local/lib/python2.7/dist-packages/autobahn/wamp/protocol.py
", line 1221, in welcome
            self._router = self._router_factory.get(realm)
          File "/usr/local/lib/python2.7/dist-packages/autobahn/wamp/router.py",
 line 173, in get
            self._routers[realm] = self.router(self, realm, self._options)
          File "/usr/local/lib/python2.7/dist-packages/autobahn/wamp/router.py",
 line 52, in __init__
            self._broker = self.broker(self, self._options)
        exceptions.AttributeError: Router instance has no attribute 'broker'

It seems that there was likely a bug in autobahn because a:

pip install autobahn --upgrade

seems to have fixed this with autobahn now at version: 0.8.14

Sorry for the lack of updating before asking :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM