Travel-Sample Web Backend install problems with Python

I’m having trouble installing the Mobile Travel-Sample Web Backend app. I’ve followed all the steps listed here:
http://docs.couchbase.com/tutorials/travel-sample/develop/swift/#/0/4/0

and I’m getting an error after running: python travel.py
here is the output:

python travel.py
Connecting to: couchbase://cb-server/travel-sample?username=Administrator
Traceback (most recent call last):
File “travel.py”, line 299, in
db = connect_db()
File “travel.py”, line 296, in connect_db
return Bucket(CONNSTR, password=PASSWORD)
File “/Users/anilgupta/Documents/Developer/Couchbase_Travel_Sample_App/try-cb-python/lib/python2.7/site-packages/couchbase/bucket.py”, line 245, in init
self._do_ctor_connect()
File “/Users/anilgupta/Documents/Developer/Couchbase_Travel_Sample_App/try-cb-python/lib/python2.7/site-packages/couchbase/bucket.py”, line 254, in _do_ctor_connect
self._connect()
couchbase.exceptions._UnknownHostError_0x15 (generated, catch UnknownHostError): <RC=0x15[DNS/Hostname lookup failed], There was a problem while trying to send/receive your request over the network. This may be a result of a bad network or a misconfigured client or server, C Source=(src/bucket.c,785)>
(try-cb-python) Anils-MacBook-Pro:try-cb-python anilgupta$

Hi,

Did you alter the travel.py code? It appears it is trying to connect to ‘cb-server’ instead of localhost, and the system DNS resolution is failing to find it… Unless cb-server is an alias for localhost. By default the CONNSTR will be ‘couchbase://localhost/travel-sample’, because the example is designed for running on the same machine as Couchbase Server.

If cb-server is indeed another machine, are you able to ping cb-server or cb-server.local, or the respective IP address?

Thanks,

Ellis

Hi, I didn’t originally change the travel.py file but now I just tried putting localhost instead of cb-server and that fixed it! Thank you

1 Like

Thanks - glad that fixed it. Will pass this on to the maintainer.

I have fixed the issue on branch 5.0. It should be “localhost” and an unintentional push had changed it to “cb-server”. Please pull 5.0 and ensure it works as expected

1 Like