Ubuntu 14.04 python onJoin failing silently, javascript clients work fine

#1

I have Mint 17 on my development machine, it runs the following code just fine, but when I move it to my 14.04 Ubuntu server the “onJoin” function never gets called and doesn’t produce any errors.

I am running autobahn 0.10.1 on Mint and 0.10.5-2 on Ubuntu 14.04

from twisted.internet.defer import inlineCallbacks

from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner

class MyComponent(ApplicationSession):

@inlineCallbacks

def onJoin(self, details):

print(“session ready”)

def oncounter(count):

print(“event received: {0}”, count)

try:

yield self.subscribe(oncounter, u’com.myapp.oncounter’)

print(“subscribed to topic”)

except Exception as e:

print(“could not subscribe to topic: {0}”.format(e))

if name == ‘main’:

runner = ApplicationRunner(url = u"ws://192.168.0.2:7777/ws", realm = u"name.of.realm")

runner.run(MyComponent)

``

The crossbar router is running on my development machine and the Javascript client’s work very well. I have a local web application deployed and in use working as expected but I can’t get any remote python clients to connect to same router.

What am I missing here?

Thanks for any input

0 Likes

#2

Running “sudo pip install autobahn[twisted]” on a fresh copy Mint Linux 17.1 returns this:

sudo pip install autobahn[twisted]

Downloading/unpacking autobahn[twisted]

Downloading autobahn-0.10.5.post2.tar.gz (151kB): 151kB downloaded

Running setup.py (path:/tmp/pip_build_root/autobahn/setup.py) egg_info for package autobahn

package init file ‘twisted/plugins/init.py’ not found (or not a regular file)

Unhandled Error

Traceback (most recent call last):

File “”, line 17, in

File “/tmp/pip_build_root/autobahn/setup.py”, line 229, in

list(getPlugins(IPlugin))

File “/usr/lib/python2.7/dist-packages/twisted/plugin.py”, line 209, in getPlugins

allDropins = getCache(package)

— —

File “/usr/lib/python2.7/dist-packages/twisted/plugin.py”, line 167, in getCache

provider = pluginModule.load()

File “/usr/lib/python2.7/dist-packages/twisted/python/modules.py”, line 383, in load

return self.pathEntry.pythonPath.moduleLoader(self.name)

File “/usr/lib/python2.7/dist-packages/twisted/python/_reflectpy3.py”, line 266, in namedAny

topLevelPackage = _importAndCheckStack(trialname)

File “/usr/lib/python2.7/dist-packages/twisted/python/_reflectpy3.py”, line 213, in _importAndCheckStack

reraise(excValue, excTraceback)

File “/tmp/pip_build_root/autobahn/twisted/plugins/autobahn_endpoints.py”, line 39, in

from autobahn.twisted.websocket import WrappingWebSocketServerFactory, \

File “autobahn/twisted/websocket.py”, line 37, in

from autobahn.wamp import websocket

File “autobahn/wamp/websocket.py”, line 31, in

from autobahn.websocket import protocol

File “autobahn/websocket/protocol.py”, line 56, in

import txaio

exceptions.ImportError: No module named txaio

Twisted found (default reactor is <class ‘twisted.internet.epollreactor.EPollReactor’>)

Twisted dropin.cache regenerated.

Installing extra requirements: ‘twisted’

Downloading/unpacking six>=1.6.1 (from autobahn[twisted])

Downloading six-1.9.0-py2.py3-none-any.whl

Downloading/unpacking txaio>=1.0.2 (from autobahn[twisted])

Downloading txaio-1.0.2.tar.gz

Running setup.py (path:/tmp/pip_build_root/txaio/setup.py) egg_info for package txaio

Requirement already satisfied (use --upgrade to upgrade): zope.interface>=3.6 in /usr/lib/python2.7/dist-packages (from autobahn[twisted])

Requirement already satisfied (use --upgrade to upgrade): Twisted>=11.1 in /usr/lib/python2.7/dist-packages (from autobahn[twisted])

Installing collected packages: autobahn, six, txaio

Running setup.py install for autobahn

package init file ‘twisted/plugins/init.py’ not found (or not a regular file)

Unhandled Error

Traceback (most recent call last):

File “”, line 1, in

File “/tmp/pip_build_root/autobahn/setup.py”, line 229, in

list(getPlugins(IPlugin))

File “/usr/lib/python2.7/dist-packages/twisted/plugin.py”, line 209, in getPlugins

allDropins = getCache(package)

— —

File “/usr/lib/python2.7/dist-packages/twisted/plugin.py”, line 167, in getCache

provider = pluginModule.load()

File “/usr/lib/python2.7/dist-packages/twisted/python/modules.py”, line 383, in load

return self.pathEntry.pythonPath.moduleLoader(self.name)

File “/usr/lib/python2.7/dist-packages/twisted/python/_reflectpy3.py”, line 266, in namedAny

topLevelPackage = _importAndCheckStack(trialname)

File “/usr/lib/python2.7/dist-packages/twisted/python/_reflectpy3.py”, line 213, in _importAndCheckStack

reraise(excValue, excTraceback)

File “/tmp/pip_build_root/autobahn/twisted/plugins/autobahn_endpoints.py”, line 39, in

from autobahn.twisted.websocket import WrappingWebSocketServerFactory, \

File “autobahn/twisted/websocket.py”, line 37, in

from autobahn.wamp import websocket

File “autobahn/wamp/websocket.py”, line 31, in

from autobahn.websocket import protocol

File “autobahn/websocket/protocol.py”, line 56, in

import txaio

exceptions.ImportError: No module named txaio

Twisted found (default reactor is <class ‘twisted.internet.epollreactor.EPollReactor’>)

Twisted dropin.cache regenerated.

Found existing installation: six 1.5.2

Not uninstalling six at /usr/lib/python2.7/dist-packages, owned by OS

Running setup.py install for txaio

Successfully installed autobahn six txaio

Cleaning up…

``

···

On Tuesday, August 11, 2015 at 7:43:53 AM UTC-7, Trendal Toews wrote:

I have Mint 17 on my development machine, it runs the following code just fine, but when I move it to my 14.04 Ubuntu server the “onJoin” function never gets called and doesn’t produce any errors.

I am running autobahn 0.10.1 on Mint and 0.10.5-2 on Ubuntu 14.04

from twisted.internet.defer import inlineCallbacks

from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner

class MyComponent(ApplicationSession):

@inlineCallbacks

def onJoin(self, details):

print(“session ready”)

def oncounter(count):

print(“event received: {0}”, count)

try:

yield self.subscribe(oncounter, u’com.myapp.oncounter’)

print(“subscribed to topic”)

except Exception as e:

print(“could not subscribe to topic: {0}”.format(e))

if name == ‘main’:

runner = ApplicationRunner(url = u"ws://192.168.0.2:7777/ws", realm = u"name.of.realm")

runner.run(MyComponent)

``

The crossbar router is running on my development machine and the Javascript client’s work very well. I have a local web application deployed and in use working as expected but I can’t get any remote python clients to connect to same router.

What am I missing here?

Thanks for any input

0 Likes

#3

Rolling back to 0.10.1 installs without errors and seems runs the posted example without the previous errors. Checking for other issues at this point. Is there something busted with 0.10.5?

···

On Tuesday, August 11, 2015 at 7:43:53 AM UTC-7, Trendal Toews wrote:

I have Mint 17 on my development machine, it runs the following code just fine, but when I move it to my 14.04 Ubuntu server the “onJoin” function never gets called and doesn’t produce any errors.

I am running autobahn 0.10.1 on Mint and 0.10.5-2 on Ubuntu 14.04

from twisted.internet.defer import inlineCallbacks

from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner

class MyComponent(ApplicationSession):

@inlineCallbacks

def onJoin(self, details):

print(“session ready”)

def oncounter(count):

print(“event received: {0}”, count)

try:

yield self.subscribe(oncounter, u’com.myapp.oncounter’)

print(“subscribed to topic”)

except Exception as e:

print(“could not subscribe to topic: {0}”.format(e))

if name == ‘main’:

runner = ApplicationRunner(url = u"ws://192.168.0.2:7777/ws", realm = u"name.of.realm")

runner.run(MyComponent)

``

The crossbar router is running on my development machine and the Javascript client’s work very well. I have a local web application deployed and in use working as expected but I can’t get any remote python clients to connect to same router.

What am I missing here?

Thanks for any input

0 Likes

#4

Hi Trendal,

There should not have been any breaking changes in between 10.1 and 10.5.

Could you install the 10.5 in a virtualenv on the Ubuntu machine to exclude other software installed on the system as an interference?

Regards,

Alex

···

Am Mittwoch, 12. August 2015 01:46:52 UTC+2 schrieb Trendal Toews:

Rolling back to 0.10.1 installs without errors and seems runs the posted example without the previous errors. Checking for other issues at this point. Is there something busted with 0.10.5?

On Tuesday, August 11, 2015 at 7:43:53 AM UTC-7, Trendal Toews wrote:

I have Mint 17 on my development machine, it runs the following code just fine, but when I move it to my 14.04 Ubuntu server the “onJoin” function never gets called and doesn’t produce any errors.

I am running autobahn 0.10.1 on Mint and 0.10.5-2 on Ubuntu 14.04

from twisted.internet.defer import inlineCallbacks

from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner

class MyComponent(ApplicationSession):

@inlineCallbacks

def onJoin(self, details):

print(“session ready”)

def oncounter(count):

print(“event received: {0}”, count)

try:

yield self.subscribe(oncounter, u’com.myapp.oncounter’)

print(“subscribed to topic”)

except Exception as e:

print(“could not subscribe to topic: {0}”.format(e))

if name == ‘main’:

runner = ApplicationRunner(url = u"ws://[192.168.0.2:7777/ws](http://192.168.0.2:7777/ws)", realm = u"name.of.realm")
runner.run(MyComponent)

``

The crossbar router is running on my development machine and the Javascript client’s work very well. I have a local web application deployed and in use working as expected but I can’t get any remote python clients to connect to same router.

What am I missing here?

Thanks for any input

0 Likes

#5

I can't right now. It's close to "prime time" on an intense seasonal web app running on that server. I don't want to push anything to much. After the season I could, but, I feel like my second and third posts negate the problem I described in the original post.

Fresh install of Mint 17 bombs with 10.5
The reason it worked on my dev machine I found out was dev machine was running 10.1 still. Once I discovered that I rolled the production server back to 10.1 and all works as expected. Is there a possible difference between Ubuntu 10.04 and Mint 17? If there is a software interference it exists on Mint 17 out of the box.

0 Likes