apache / couchdb

Seamless multi-master syncing database with an intuitive HTTP/JSON API, designed for reliability
https://couchdb.apache.org/
Apache License 2.0
6.24k stars 1.03k forks source link

Forbidden Error when trying to List all databases names. #3561

Closed othmanechentouf closed 3 years ago

othmanechentouf commented 3 years ago

Hello everyone, I'm new to couchdb and I'm trying to connect to a remote server to start retrieving and adding to a database within the server. My code is pretty simple so far as I can't get far anymore as it raises an error through this code, the server uses a certificate and it is installed on my mac (I think the problem might be coming from that but I don't know how to fix it) :

`import couchdb

couchserver = couchdb.Server("https://%s:%s@xxx.xx.xxx.x/" % (login, pwd)) couchserver.resource.session.disable_ssl_verification()

for dbname in couchserver: --->print(dbname)`

The error I get :

~/miniconda3/lib/python3.8/site-packages/couchdb/http.py in request(self, method, url, body, headers, credentials, num_redirects) 419 raise Unauthorized(error) 420 elif status == 403: --> 421 raise Forbidden(error) 422 elif status == 404: 423 raise ResourceNotFound(error)

Forbidden: b''

Michael-List commented 3 years ago

Hi @othmanechentouf,

I think you are using the library couchdb-python (https://github.com/djc/couchdb-python) which is no longer maintained. I would suggest you use the library cloudant: