KnightWSN
KnightWSN

Reputation: 21

CouchDB _all_dbs 401 Unauthorized 'Solution'

This happen on my windows 10 machine, CouchDb 3.1.0 and Postman 7.29.1.

During a DB course class I couldn't do the same as my teacher and access:

http://127.0.0.1:5984/_all_dbs

was returning a 401 error:

{
    "error": "unauthorized",
    "reason": "You are not authorized to access this db."
}

I did some search but couldn't find nothing.

Upvotes: 2

Views: 1115

Answers (1)

VLAZ
VLAZ

Reputation: 28959

ATTENTION: This solution is for local and unsecure environment and has by any mean the proposity to solve any other problem.

In the CouchDB/etc, open default.ini, and change the following lines:

; When true, system databases _users and _replicator are created immediately
; on startup if not present.
single_node = true

; prevent non-admins from accessing /_all_dbs
admin_only_all_dbs = false

Then restart Apache CouchDB service (or restart computer). And voila!

Obs: Another thing that can happen is 401 on new DB. Go to DB permissions and remove _Admin from Members - Roles.

Upvotes: 0

Related Questions