Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can't create server-admin in couchdb

Tags:

couchdb

I'm following the couchdb security documentation (http://docs.couchdb.org/en/1.6.1/intro/security.html) to try to create a server-admin using cURL: curl -X PUT $HOST/_config/admins/anna -d '"secret"'

When I do this, I get an error: {"error":"not_found","reason":"Database does not exist."}

I'm on v2.0 so I don't known if something has changed since the 1.6 version of the documentation. I can create server-admins just fine using fauxton. Any ideas?

like image 640
lewiada Avatar asked May 23 '16 22:05

lewiada


2 Answers

To anybody else running into this issue, it's an easy answer: in couchdb 2.0 some of the APIs moved to using port 5986 ... I had been using port 5984 (which is still used a lot in v2.0, but apparently not for the _config endpoint).

The following works:

curl -X PUT http://localhost:5986/_config/admins/admin1 -d '"password"'
like image 200
lewiada Avatar answered Sep 21 '22 12:09

lewiada


The Couchdb2 way of adding a user is

curl -X PUT http://localhost:5984/_node/nodename/_config/admins/admin1 -d '"password"'
like image 21
Gavin Avatar answered Sep 20 '22 12:09

Gavin