bmuller / txyam

Yet Another Memcached (YAM) client for Python Twisted
Other
10 stars 5 forks source link

txyam.client.NoServerError: No connected servers remaining. #7

Closed minskmaz closed 9 years ago

minskmaz commented 9 years ago

Yet here's my netstat:

(verymoody)vagrant@minskmaz:~/projects$ netstat -l | grep 11211 tcp 0 0 localhost:11211 : LISTEN
udp 0 0 localhost:11211 :

and I'm able to set and get from python-memcached.

Any suggestions warmly welcomed! Thank you

bmuller commented 9 years ago

Are you able to connect at all? Or does it disconnect? Can you paste your connection code?

minskmaz commented 9 years ago

is there a debugging mode I can put it into ?

def __setattr__(self, key, val):
    uid = str(uuid.uuid4())
    self._attrs[key] = uid
    hosts = ['localhost', ('127.0.0.1', 11211)]
    client = YamClient(hosts)
    client.set(uid, val).addCallback(self.handler)
minskmaz commented 9 years ago

it doesn't seem to connect at all - I will look at tcpflow to confirm if there's any activity

minskmaz commented 9 years ago

"sudo tcpflow -i lo -c port 11211" shows no activity

bmuller commented 9 years ago

Is your handler called? You just need to set up a logger, it logs messages via twisted.python.log.

minskmaz commented 9 years ago

no handler isn't called

bmuller commented 9 years ago

Have you added an errback?

minskmaz commented 9 years ago

no but I can I figured it was giving me the error anyhow - brb

minskmaz commented 9 years ago

I will try to insert into an existing project with a functional reactor. might be because I'm running code without rector present

bmuller commented 9 years ago

Yep, as a twisted lib a running reactor is a necessary prerequisite. I'll mark this one closed, then - though please do file another ticket if you run into any issues. Thanks!

minskmaz commented 9 years ago

It gives me the same error in a reactor:

2015-09-16 15:30:38+0000 [-] File "/home/vagrant/projects/foodies/bin/twistd", line 14, in 2015-09-16 15:30:38+0000 [-] run() 2015-09-16 15:30:38+0000 [-] File "/home/vagrant/projects/foodies/local/lib/python2.7/site-packages/twisted/scripts/twistd.py", line 29, in run 2015-09-16 15:30:38+0000 [-] app.run(runApp, ServerOptions) 2015-09-16 15:30:38+0000 [-] File "/home/vagrant/projects/foodies/local/lib/python2.7/site-packages/twisted/application/app.py", line 617, in run 2015-09-16 15:30:38+0000 [-] runApp(config) 2015-09-16 15:30:38+0000 [-] File "/home/vagrant/projects/foodies/local/lib/python2.7/site-packages/twisted/scripts/twistd.py", line 25, in runApp 2015-09-16 15:30:38+0000 [-] _SomeApplicationRunner(config).run() 2015-09-16 15:30:38+0000 [-] File "/home/vagrant/projects/foodies/local/lib/python2.7/site-packages/twisted/application/app.py", line 352, in run 2015-09-16 15:30:38+0000 [-] self.postApplication() 2015-09-16 15:30:38+0000 [-] File "/home/vagrant/projects/foodies/local/lib/python2.7/site-packages/twisted/scripts/_twistd_unix.py", line 210, in postApplication 2015-09-16 15:30:38+0000 [-] self.startApplication(self.application) 2015-09-16 15:30:38+0000 [-] File "/home/vagrant/projects/foodies/local/lib/python2.7/site-packages/twisted/scripts/_twistd_unix.py", line 406, in startApplication 2015-09-16 15:30:38+0000 [-] app.startApplication(application, not self.config['no_save']) 2015-09-16 15:30:38+0000 [-] File "/home/vagrant/projects/foodies/local/lib/python2.7/site-packages/twisted/application/app.py", line 633, in startApplication 2015-09-16 15:30:38+0000 [-] service.IService(application).startService() 2015-09-16 15:30:38+0000 [-] File "/home/vagrant/projects/foodies/local/lib/python2.7/site-packages/twisted/application/service.py", line 283, in startService 2015-09-16 15:30:38+0000 [-] service.startService() 2015-09-16 15:30:38+0000 [-] File "/home/vagrant/projects/foodies/src/foodies/foodies.py", line 156, in startService 2015-09-16 15:30:38+0000 [-] client.set(uid, val).addCallback(handler).addErrback(handleErrback) 2015-09-16 15:30:38+0000 [-] File "/home/vagrant/projects/foodies/local/lib/python2.7/site-packages/txyam/client.py", line 31, in wrapper 2015-09-16 15:30:38+0000 [-] func = getattr(self.getClient(key), cmd) 2015-09-16 15:30:38+0000 [-] File "/home/vagrant/projects/foodies/local/lib/python2.7/site-packages/txyam/client.py", line 58, in getClient 2015-09-16 15:30:38+0000 [-] raise NoServerError("No connected servers remaining.") 2015-09-16 15:30:38+0000 [-] txyam.client.NoServerError: No connected servers remaining.