3

I have a CouchDB installing issue on Ubuntu 12.04, actually is not an installing issue, but configuring. After installed with

sudo apt-get couchdb

I edit /etc/couchdb/local.ini and add

adminuser = mypass

to the [admin] section and then I try

 curl http://adminuser:mypass@127.0.0.1:5984

but I get

{"error":"unauthorized","reason":"Name or password is incorrect."}

Of course, I restarted the server after edited local.ini

I tried what says here too: http://wiki.apache.org/couchdb/Installing_on_Ubuntu : "fix problems where adding admin hangs or setting admins in local.ini..." but still no luck :(

After that I tested with lastest version from git but the error is still present. I have to say that after rebooting Ubuntu it works, but I need that this work out of the box without rebooting for an install script.

Eliseo Ocampos
  • 2,473
  • 4
  • 20
  • 32
  • The correct section name is [`[admins]`](http://docs.couchdb.org/en/latest/config/auth.html#server-administrators) (with an s). – Simon Jul 04 '14 at 05:36

1 Answers1

2

It's safer to modify the .ini files using _config as that will follow all the escaping and spacing rules (in your case the spaces around = are probably the problem)

curl -X PUT localhost:5984/_config/admins/adminuser -d '"mypass"'"
Robert Newson
  • 4,631
  • 20
  • 18