hharnisc / python-meteor

A meteor client for python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MeteorClient.MeteorClientException: Could not subscribe because a connection has not been established

arefehtam opened this issue · comments

Hello
I'm working on a meteor app that uses python-ddp and mongodb-clients. Meteor version in release file is METEOR@1.1.0.2. Also I installed both python-ddp0.1.5 and python-meteor0.1.6 and then mongodb-clients. When runing this code

connection = MeteorConnection().connect()
where MeteorConnection definition comes below:

class MeteorConnection(dict):

def connect(self, websocket='ws://127.0.0.1:3000/websocket'):

self.meteor_client = meteor_client = MeteorClient(websocket)
meteor_client.on('subscribed', self.subscribed)
meteor_client.on('unsubscribed', self.unsubscribed)
meteor_client.on('added', self.added)
meteor_client.on('connected', self.connected)
meteor_client.on('changed', self.changed)
meteor_client.connect()
meteor_client.subscribe('publicLists')
return self

This error appeared:
File "python/example.py", line 40, in enter
meteor_client.connect()
File "/usr/local/lib/python3.4/dist-packages/MeteorClient.py", line 55, in connect
self.ddp_client.connect()
File "/usr/local/lib/python3.4/dist-packages/DDPClient.py", line 119, in connect
self.ddpsocket.connect()
File "/usr/local/lib/python3.4/dist-packages/ws4py/client/init.py", line 216, in connect
bytes = self.sock.recv(128)
socket.timeout: timed out
=> Started MongoDB.
Exception ignored in: <bound method MongoHandler.del of {}>
Traceback (most recent call last):
File "python/example.py", line 48, in del
File "/usr/local/lib/python3.4/dist-packages/MeteorClient.py", line 227, in unsubscribe
File "/usr/local/lib/python3.4/dist-packages/MeteorClient.py", line 356, in _wait_for_connect
MeteorClient.MeteorClientException: Could not subscribe because a connection has not been established

I wonder if this error is because of python-ddp or python-meteor version or something else.
Thanks

You've got the latest versions of python-ddp and python-meteor. It's hard to tell without the full source code and the full stack trace, but it appears that you're not connecting to your local meteor server (socket.timeout: timed out). I'd first check to see if Meteor is running and not hanging and then work back from there.

Closing this for now but feel free to re-open it and I'll get back to it as soon as I can.