Search code examples
error-handlingpassport.jsrolescouchbasecouchbase-sync-gateway

How to manage Roles in Couchbase?


I have a Couchbase backend hosted in a remote server and I want to update my sync function in order to grant data access to users. The users are generated by Passport.js, and my trouble is to perform basic CRUD operations on roles. The official documentation says that the RESTful API calls are like this: /$db/_roles/$rolename, but when I perform this query with my parameters and other related queries I get errors like:

{"error":"bad_request","reason":"attachments not supported in Couchbase"}
{"error":"not_found","reason":"missing"}

What does these errors mean? How can I perform CRUD on roles in Couchbase Server environment?


Solution

  • The problem is that in the standard configuration of Couchbase Sync Gateway you can't query in port 4985 (Admin port) if you are querying to an remote host. You can do this only if you query localhost