Error using python client

Showing 1-5 of 5 messages
Error using python client Guy 9/29/12 2:01 PM
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 "./", line 7, in <module>
    cb = Couchbase("", 'app', 'm1n1wh34t5')
  File "/usr/local/lib/python2.6/dist-packages/couchbase/", 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?


Re: Error using python client Matt Ingenthron 9/29/12 2:04 PM
That's not expected.  What OS and specific version of Python do you have?
Re: Error using python client Guy 10/1/12 9:23 AM
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)
Re: Error using python client Pavel Paulau 10/2/12 8:55 AM
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:

from couchbase import Couchbase

# connect to a couchbase server
cb = Couchbase('localhost:8091',

# fetch a Bucket with subscript
default_bucket = cb['default']
Re: Error using python client Roy E. 11/20/12 8:26 AM
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/ 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..