“Name or password is incorrect” for couch_peruser on Cloud but localhost works

Keywords: CouchDB - Google Cloud Platform - Technical issue - Permissions
Description:
This works for my local install of couchdb but not on my hosted google bitnami service. This is my actual url…
Via curl from Windows (need backslashes for windows):
curl -v -X PUT http://admin:password@104.197.185.97:5984/_users/org.couchdb.user:wubble -H “Accept: application/json” -H “Content-Type:application/json” -H “Host: 104.197.185.97:5984” --data-binary “{”_id":“org.couchdb.user:wubble”,“name”:“wubble”,“roles”:[],“type”:“user”,“password”:“tubble”}"
Creates the database and user but then this gives: “Name or password is incorrect”…
curl -X GET http://wubble:tubble@104.197.185.97:5984/userdb-777562626c65
local.ini contents are virtually identical - local vs hosted

Hi @jhchadwick63,

The default CouchDB access port is not open to the outside, for security purposes. We have documented this in Bitnami Docs: https://docs.bitnami.com/google/infrastructure/couchdb/#what-are-the-default-ports

Our recommendation is to create a SSH tunnel to CouchDB as mentioned here: https://docs.bitnami.com/google/faq/#how-to-access-a-server-using-an-ssh-tunnel

So I have to get this command correct: ssh -N -L SOURCE-PORT:127.0.0.1:DESTINATION-PORT -i KEYFILE bitnami@SERVER-IP
Is Cloudways the SOURCE and Google Bitnami the DESTINATION? From what I have read at your link the SSH port is 22. (Looks the same on Cloudways). Cloudways contains the javascript code to connect to the Google Bitnami Pouchdb server. It is great for saving my application’s JSON data. Note I found it funny I can connect to the Bitnami Pouchdb server as an admin but not as the user the admin just created. This is what I expect this will fix. So happy you responded.Thanks.

Hi @jhchadwick63,

In the server/computer where you need to run CouchDB, which seems to be in your Cloudways server, you must execute the following command:

ssh -N -L SOURCE_PORT:localhost:5984 -i /path/to/SSH_KEYFILE bitnami@COUCHDB_IP

If you decide to use 5984 for source port, then in your Cloudways machine, you would connect to CouchDB via http://localhost:5984.

IMPORTANT: We highly recommend you to close your Cloudways machine’s port 5984 to the outside. If not, at least choose a different source port.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.