Comments (8)
I probably should have looked a little more carefully.
The topic crossbar.worker.worker-002.container.on_component_stop
is assigned on line 760 of crossbar/controller/node.py as topic = 'crossbar.worker.{}.container.on_component_stop'.format(worker_id)
. That of course is not a unicode string but of type str
.
The assertion on line 1280 of autobahn/wamp/protocol.py is assert(topic is None or type(topic) == six.text_type)
.
Since topic is not None, the first assertion topic is None
evaluates to False
and the second assertion type(topic) == six.text_type
is evaluated, which is False
too. That causes the entire assertion to be False
and the assertion exception to be thrown.
The question is what is wrong here. Should the topic be a unicode string and hence line 760 of crossbar/controller/node.py needs to be changed accordingly or should the topic not be a unicode string and therefore the assertion is incorrect?
Searching through the code shows that all other instances where topic are set and published unicode is used. Apparently this instance was missed. However, then of course the example code of hello.py also needs to be changed accordingly.
I got it working, I just don't know what the intended way is, otherwise I would submit the pull requests.
from crossbar-examples.
Have same problem.
2017-04-19T11:17:54+0300 [Controller 13837] Could not startup node: Traceback (most recent call last):
File ".../local/lib/python2.7/site-packages/Twisted-17.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 653, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File ".../local/lib/python2.7/site-packages/Twisted-17.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 1357, in gotResult
_inlineCallbacks(r, g, deferred)
File ".../local/lib/python2.7/site-packages/Twisted-17.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 1299, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File ".../local/lib/python2.7/site-packages/Twisted-17.1.0-py2.7-linux-x86_64.egg/twisted/python/failure.py", line 393, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
--- ---
File ".../local/lib/python2.7/site-packages/crossbar/controller/node.py", line 531, in start
yield self._startup()
File ".../local/lib/python2.7/site-packages/Twisted-17.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 1301, in _inlineCallbacks
result = g.send(result)
File ".../local/lib/python2.7/site-packages/crossbar/controller/node.py", line 761, in _configure_node_from_config
component_stop_sub = yield self._controller.subscribe(component_exited, topic)
File ".../local/lib/python2.7/site-packages/autobahn/wamp/protocol.py", line 1250, in subscribe
assert(topic is None or type(topic) == six.text_type)
exceptions.AssertionError:
from crossbar-examples.
What skel I can use for python backend?
from crossbar-examples.
@morfair Change line 760 of the file .../local/lib/python2.7/site-packages/crossbar/controller/node.py
to
topic = u'crossbar.worker.{}.container.on_component_stop'.format(worker_id)
(simply add the u
before the string to make it a unicode string).
from crossbar-examples.
@rstreif You are running a new Crossbar.io against a app template created with a previous version?
Because I just tried to reproduce, and there is no such template in that version anymore:
oberstet@thinkpad-t430s:~$ ~/cpy2713/bin/virtualenv ~/cpy2713_1
New python executable in /home/oberstet/cpy2713_1/bin/python
Installing setuptools, pip, wheel...done.
oberstet@thinkpad-t430s:~$ source ~/cpy2713_1/bin/activate
(cpy2713_1) oberstet@thinkpad-t430s:~$ pip install crossbar
Collecting crossbar
Downloading crossbar-17.3.1-py2.py3-none-any.whl (783kB)
100% |████████████████████████████████| 788kB 731kB/s
Collecting click==6.7 (from crossbar)
Using cached click-6.7-py2.py3-none-any.whl
Collecting autobahn==0.18.1 (from crossbar)
Using cached autobahn-0.18.1-py2.py3-none-any.whl
Collecting bitstring==3.1.5 (from crossbar)
Collecting zope.interface==4.3.3 (from crossbar)
Collecting pycparser==2.17 (from crossbar)
Requirement already satisfied: packaging==16.8 in ./cpy2713_1/lib/python2.7/site-packages (from crossbar)
Collecting txaio==2.6.2 (from crossbar)
Using cached txaio-2.6.2-py2.py3-none-any.whl
Collecting service-identity==16.0.0 (from crossbar)
Using cached service_identity-16.0.0-py2.py3-none-any.whl
Collecting ipaddress==1.0.18 (from crossbar)
Using cached ipaddress-1.0.18-py2-none-any.whl
Collecting shutilwhich==1.1.0 (from crossbar)
Collecting PyYAML==3.12 (from crossbar)
Using cached PyYAML-3.12.tar.gz
Collecting idna==2.5 (from crossbar)
Using cached idna-2.5-py2.py3-none-any.whl
Requirement already satisfied: pyparsing==2.2.0 in ./cpy2713_1/lib/python2.7/site-packages (from crossbar)
Collecting pathtools==0.1.2 (from crossbar)
Collecting sdnotify==0.3.1 (from crossbar)
Collecting cffi==1.10.0 (from crossbar)
Downloading cffi-1.10.0-cp27-cp27m-manylinux1_x86_64.whl (394kB)
100% |████████████████████████████████| 399kB 1.2MB/s
Collecting incremental==16.10.1 (from crossbar)
Using cached incremental-16.10.1-py2.py3-none-any.whl
Collecting cryptography==1.8.1 (from crossbar)
Using cached cryptography-1.8.1.tar.gz
Collecting argh==0.26.2 (from crossbar)
Using cached argh-0.26.2-py2.py3-none-any.whl
Collecting PyTrie==0.3 (from crossbar)
Collecting constantly==15.1.0 (from crossbar)
Using cached constantly-15.1.0-py2.py3-none-any.whl
Collecting lmdb==0.92 (from crossbar)
Using cached lmdb-0.92.tar.gz
Collecting sortedcontainers==1.5.7 (from crossbar)
Using cached sortedcontainers-1.5.7-py2.py3-none-any.whl
Collecting u-msgpack-python==2.3.0 (from crossbar)
Using cached u_msgpack_python-2.3.0-py2.py3-none-any.whl
Collecting psutil==5.2.1 (from crossbar)
Using cached psutil-5.2.1.tar.gz
Collecting enum34==1.1.6 (from crossbar)
Using cached enum34-1.1.6-py2-none-any.whl
Requirement already satisfied: appdirs==1.4.3 in ./cpy2713_1/lib/python2.7/site-packages (from crossbar)
Collecting Automat==0.5.0 (from crossbar)
Using cached Automat-0.5.0-py2.py3-none-any.whl
Collecting netaddr==0.7.19 (from crossbar)
Using cached netaddr-0.7.19-py2.py3-none-any.whl
Collecting cbor==1.0.0 (from crossbar)
Using cached cbor-1.0.0.tar.gz
Collecting Pygments==2.2.0 (from crossbar)
Using cached Pygments-2.2.0-py2.py3-none-any.whl
Collecting MarkupSafe==1.0 (from crossbar)
Using cached MarkupSafe-1.0.tar.gz
Collecting pyOpenSSL==16.2.0 (from crossbar)
Using cached pyOpenSSL-16.2.0-py2.py3-none-any.whl
Collecting asn1crypto==0.22.0 (from crossbar)
Using cached asn1crypto-0.22.0-py2.py3-none-any.whl
Collecting watchdog==0.8.3 (from crossbar)
Collecting treq==17.3.1 (from crossbar)
Using cached treq-17.3.1-py2.py3-none-any.whl
Collecting pyasn1==0.2.3 (from crossbar)
Using cached pyasn1-0.2.3-py2.py3-none-any.whl
Collecting PyNaCl==1.1.1 (from crossbar)
Using cached PyNaCl-1.1.1.tar.gz
Collecting Twisted==17.1.0 (from crossbar)
Requirement already satisfied: six==1.10.0 in ./cpy2713_1/lib/python2.7/site-packages (from crossbar)
Collecting PyQRCode==1.2.1 (from crossbar)
Collecting requests==2.13.0 (from crossbar)
Using cached requests-2.13.0-py2.py3-none-any.whl
Collecting setuptools==34.3.3 (from crossbar)
Using cached setuptools-34.3.3-py2.py3-none-any.whl
Collecting py-ubjson==0.9.0 (from crossbar)
Using cached py-ubjson-0.9.0.tar.gz
Collecting setproctitle==1.1.10 (from crossbar)
Using cached setproctitle-1.1.10.tar.gz
Collecting pyasn1-modules==0.0.8 (from crossbar)
Using cached pyasn1_modules-0.0.8-py2.py3-none-any.whl
Collecting attrs==16.3.0 (from crossbar)
Using cached attrs-16.3.0-py2.py3-none-any.whl
Collecting Jinja2==2.9.5 (from crossbar)
Using cached Jinja2-2.9.5-py2.py3-none-any.whl
Collecting mistune==0.7.4 (from crossbar)
Using cached mistune-0.7.4-py2.py3-none-any.whl
Building wheels for collected packages: PyYAML, cryptography, lmdb, psutil, cbor, MarkupSafe, PyNaCl, py-ubjson, setproctitle
Running setup.py bdist_wheel for PyYAML ... done
Stored in directory: /home/oberstet/.cache/pip/wheels/2c/f7/79/13f3a12cd723892437c0cfbde1230ab4d82947ff7b3839a4fc
Running setup.py bdist_wheel for cryptography ... done
Stored in directory: /home/oberstet/.cache/pip/wheels/c2/12/b8/54077d2a681ad55e244675c3bad78ed27e01916b96f63a32cc
Running setup.py bdist_wheel for lmdb ... done
Stored in directory: /home/oberstet/.cache/pip/wheels/62/51/59/e16215fc2708cf2f0a1cf85ca1d4a53d84a3a25801961b8260
Running setup.py bdist_wheel for psutil ... done
Stored in directory: /home/oberstet/.cache/pip/wheels/ff/7a/15/e3e4da457a37edc1674f17103c05e6780bab4c5e3b105d1502
Running setup.py bdist_wheel for cbor ... done
Stored in directory: /home/oberstet/.cache/pip/wheels/3d/d1/90/40d06b21e6faf28f3c60abfcc913e87570e5edbab01e2a4522
Running setup.py bdist_wheel for MarkupSafe ... done
Stored in directory: /home/oberstet/.cache/pip/wheels/88/a7/30/e39a54a87bcbe25308fa3ca64e8ddc75d9b3e5afa21ee32d57
Running setup.py bdist_wheel for PyNaCl ... done
Stored in directory: /home/oberstet/.cache/pip/wheels/9f/b3/16/3bea9cd6afcfb2be4f3d831e691f3bba1ccfc520fb6e487cab
Running setup.py bdist_wheel for py-ubjson ... done
Stored in directory: /home/oberstet/.cache/pip/wheels/72/70/fa/66536f79c74be137df2888c5a5201431e4a3dcb9cc2d2d3cdb
Running setup.py bdist_wheel for setproctitle ... done
Stored in directory: /home/oberstet/.cache/pip/wheels/5b/e6/ac/0a9f3ba8962551d270aa651226c7ccb561b3c3f94063cb2f27
Successfully built PyYAML cryptography lmdb psutil cbor MarkupSafe PyNaCl py-ubjson setproctitle
Installing collected packages: click, txaio, autobahn, bitstring, setuptools, zope.interface, pycparser, pyasn1, idna, asn1crypto, enum34, ipaddress, cffi, cryptography, pyOpenSSL, pyasn1-modules, attrs, service-identity, shutilwhich, PyYAML, pathtools, sdnotify, incremental, argh, sortedcontainers, PyTrie, constantly, lmdb, u-msgpack-python, psutil, Automat, netaddr, cbor, Pygments, MarkupSafe, watchdog, Twisted, requests, treq, PyNaCl, PyQRCode, py-ubjson, setproctitle, Jinja2, mistune, crossbar
Found existing installation: setuptools 35.0.1
Uninstalling setuptools-35.0.1:
Successfully uninstalled setuptools-35.0.1
Successfully installed Automat-0.5.0 Jinja2-2.9.5 MarkupSafe-1.0 PyNaCl-1.1.1 PyQRCode-1.2.1 PyTrie-0.3 PyYAML-3.12 Pygments-2.2.0 Twisted-17.1.0 argh-0.26.2 asn1crypto-0.22.0 attrs-16.3.0 autobahn-0.18.1 bitstring-3.1.5 cbor-1.0.0 cffi-1.10.0 click-6.7 constantly-15.1.0 crossbar-17.3.1 cryptography-1.8.1 enum34-1.1.6 idna-2.5 incremental-16.10.1 ipaddress-1.0.18 lmdb-0.92 mistune-0.7.4 netaddr-0.7.19 pathtools-0.1.2 psutil-5.2.1 py-ubjson-0.9.0 pyOpenSSL-16.2.0 pyasn1-0.2.3 pyasn1-modules-0.0.8 pycparser-2.17 requests-2.13.0 sdnotify-0.3.1 service-identity-16.0.0 setproctitle-1.1.10 setuptools-34.3.3 shutilwhich-1.1.0 sortedcontainers-1.5.7 treq-17.3.1 txaio-2.6.2 u-msgpack-python-2.3.0 watchdog-0.8.3 zope.interface-4.3.3
(cpy2713_1) oberstet@thinkpad-t430s:~$ which crossbar
/home/oberstet/cpy2713_1/bin/crossbar
(cpy2713_1) oberstet@thinkpad-t430s:~$ crossbar versino
usage: crossbar [-h] [--reactor {select,poll,epoll,kqueue,iocp}]
{version,keys,init,templates,start,stop,restart,status,check,convert,upgrade}
...
crossbar: error: argument command: invalid choice: 'versino' (choose from 'version', 'keys', 'init', 'templates', 'start', 'stop', 'restart', 'status', 'check', 'convert', 'upgrade')
(cpy2713_1) oberstet@thinkpad-t430s:~$ crossbar version
__ __ __ __ __ __ __ __
/ `|__)/ \/__`/__`|__) /\ |__) |/ \
\__,| \\__/.__/.__/|__)/~~\| \. |\__/
Crossbar.io : 17.3.1 (Crossbar.io COMMUNITY)
Autobahn : 0.18.1 (with JSON, MessagePack, CBOR, UBJSON)
Twisted : 17.1.0-EPollReactor
LMDB : 0.92/lmdb-0.9.18
Python : 2.7.13/CPython
OS : Linux-4.4.0-72-generic-x86_64-with-debian-stretch-sid
Machine : x86_64
Release key : RWRGxs0uB6vQemWGPeBt7nLG53ADoOtZy/Vve3BjlaXDqkCiVhCs7Zrv
(cpy2713_1) oberstet@thinkpad-t430s:~$ mkdir test123
(cpy2713_1) oberstet@thinkpad-t430s:~$ cd test123
(cpy2713_1) oberstet@thinkpad-t430s:~/test123$ crossbar init --template hello:python --appdir hello
Huh, sorry. There is no template named 'hello:python'. Try 'crossbar templates' to list the templates available.
(cpy2713_1) oberstet@thinkpad-t430s:~/test123$
from crossbar-examples.
Actually, I just tried the "hello/python/" example in this repo, and that did indeed fail now on Python 2 for me with the release 17.3.1, but I believe is fixed via the merging of crossbario/crossbar#1047
from crossbar-examples.
@oberstet Yes, crossbario/crossbar/pull/1047 is the exact fix that I did on my local copy of crossbar.
from crossbar-examples.
Ok, so I guess this can be closed. At least it is fixed now. Thanks for reporting back!
from crossbar-examples.
Related Issues (20)
- update demos to use Roboto
- Demo instances: reactivate guest workers
- demo.crossbar.io, all demos not working (404's) HOT 13
- WAMP ticket authentication example, javascript client opening handshake timed out
- builtins.ImportError: No module named 'crossbar.adapter.postgres' HOT 3
- Expired certificate for demo.crossbar.io HOT 1
- Getting error trying to run publisher example. HOT 1
- bundle demos in ZIP archive HOT 1
- Remove file upload example
- publisher exemple not working HOT 1
- There is a miner (like bitcoin) inside the bundled JS files! HOT 2
- Error in getting started example HOT 1
- Authentication integration tests: add proxy-router variants HOT 1
- Meta API integration tests HOT 1
- Authorization integration tests
- Excluding subscribers demo does not work HOT 4
- TLS client certs with containers example is broken HOT 1
- Video control demo does not work HOT 1
- update our custom materialize CSS file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crossbar-examples.