Couchbase Sync Gateway & password protected bucket


I’d encounter access issue when I set a password protected bucket and try to access the Sync Gateway Admin REST API.

I connect in SSH to the server hosting the sync gateway and the execute a curl command to get the list of users but an HTTP 401 Unauthorized response is return. Here is what I did:

curl -X GET ‘localhost:4985/{DB}/_user/’

the response is:

{“error”:“Internal Server Error”,“reason”:“Internal error: error executing view req at http://OBFUSCATED_INTERNAL_URI:8092/{DB}/_design/sync_gateway/_view/principals?stale=false: 401 Unauthorized - {“error”:“unauthorized”,“reason”:“password required”}\n”}

As you can see, the underlying request receive the 401 Unauthorized response.

Everything work fine if I remove the password from the bucket, but it’s not what we want…

I don’t think Sync Gateway supports connections to a password protected Couchbase Server bucket.
@adamf or @andy can correct me if that isn’t correct.

Both servers should be running on the same shared network preferably.


They both run on the same shared network. In fact I have a cluster of 3 couchbase servers + 3 sync gateway servers running on a shared network.

Is password protected bucket access with Sync Gateway planned in your roadmap?

If that is the case, in what way can we provide security to the buckets? If the buckets are left without a password, anyone who finds out the server IP can access the data on it.