Error using python client

164 views
Skip to first unread message

Guy

unread,
Sep 29, 2012, 5:01:04 PM9/29/12
to couc...@googlegroups.com
I'm trying out the python client library on CB 2.0 and have run into the following error, from a very simple script. At the moment all it does is just try to instantiate a couchbase connection object but fails.

Here's the code:

#!/usr/bin/env python

from couchbase.client import Couchbase

cb = Couchbase("<server ip>:8091", '<bucket_name>', '<bucket_password>')


The error I get:

Traceback (most recent call last):
  File "./testcb.py", line 7, in <module>
    cb = Couchbase("10.210.94.180:8091", 'app', 'm1n1wh34t5')
  File "/usr/local/lib/python2.6/dist-packages/couchbase/client.py", line 61, in __init__
    self.couch_api_base = config["nodes"][0].get("couchApiBase")
TypeError: 'NoneType' object is unsubscriptable

Does anyone have an idea what the problem is?

Thanks,
Guy


Matt Ingenthron

unread,
Sep 29, 2012, 5:04:21 PM9/29/12
to couc...@googlegroups.com
That's not expected.  What OS and specific version of Python do you have?

Guy

unread,
Oct 1, 2012, 12:23:30 PM10/1/12
to couc...@googlegroups.com
Oops, guess I need to check the error code for secure details before posting it! Anyway, here's the info you requested:

Python 2.6.5
Ubuntu Lucid (10.04)

Pavel Paulau

unread,
Oct 2, 2012, 11:55:00 AM10/2/12
to couc...@googlegroups.com
I'm not sure that your test code is valid. Couchbase client expects "host:port", "username" and "password" parameters.

See this usage guide for details:

Particulary:
from couchbase import Couchbase

# connect to a couchbase server
cb = Couchbase('localhost:8091',
               username='Administrator',
               password='password')

# fetch a Bucket with subscript
default_bucket = cb['default']

Roy E.

unread,
Nov 20, 2012, 11:26:12 AM11/20/12
to couc...@googlegroups.com
This happens when you try to connect your server behind a proxy and "requests" python library receives 504 Gateway Timeout error, eventually your object "config" on line #61 in couchbase/client.py becomes a None.. 

Disable your proxy settings system-wide or add 2 lines below within your ~/.profile or ~/.bashrc file (by replacing necessary values of course):


hope that helps..
Reply all
Reply to author
Forward
0 new messages