Creating users - getting back "Database does not exist."

2,521 views
Skip to first unread message

Nicholas Outram

unread,
Dec 5, 2016, 10:42:20 AM12/5/16
to us...@couchdb.apache.org
I’m working though the tutorial on CouchDB

http://docs.couchdb.org/en/latest/intro/security.html

I’m at the section “Creating a New User”, where is says:

Creating a new user is a very trivial operation. You just need to do a PUT<http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6> request with the user’s data to CouchDB. Let’s create a user with login jan and password apple:

curl -X PUT http://localhost:5984/_users/org.couchdb.user:jan \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"name": "jan", "password": "apple", "roles": [], "type": "user"}'

When I try this, I get

{"error":"not_found","reason":"Database does not exist.”}



I’m missing something here. Can anyone advise?

Nick
________________________________
[http://www.plymouth.ac.uk/images/email_footer.gif]<http://www.plymouth.ac.uk/worldclass>

This email and any files with it are confidential and intended solely for the use of the recipient to whom it is addressed. If you are not the intended recipient then copying, distribution or other use of the information contained is strictly prohibited and you should not rely on it. If you have received this email in error please let the sender know immediately and delete it from your system(s). Internet emails are not necessarily secure. While we take every care, Plymouth University accepts no responsibility for viruses and it is your responsibility to scan emails and their attachments. Plymouth University does not accept responsibility for any changes made after it was sent. Nothing in this email or its attachments constitutes an order for goods or services unless accompanied by an official order form.

Joan Touzet

unread,
Dec 5, 2016, 1:33:29 PM12/5/16
to us...@couchdb.apache.org
You missed the setup step where you create the _users database:

http://docs.couchdb.org/en/2.0.0/install/index.html#single-node-setup

-Joan

Nicholas Outram

unread,
Dec 5, 2016, 2:32:27 PM12/5/16
to us...@couchdb.apache.org, Joan Touzet
Thank you Joan - indeed I was missing something!

Much appreciated -

Nick

(email / Skype for Business): nichola...@plymouth.ac.uk<mailto:nichola...@plymouth.ac.uk>
(mobile / iMessage): +44 7540 695741<tel:+44%207540%20695741>
(office): +44 1752 586257<tel:+44%201752%20586257>
(twitter): noutram_at_uop

iTunes U course: iOS Development in Swift: http://iTunes.com/plymouthswift<http://itunes.com/plymouthswift>

Karl Helmer

unread,
Dec 6, 2016, 9:19:39 AM12/6/16
to us...@couchdb.apache.org, us...@couchdb.apache.org, Joan Touzet
Hi,

I think one possible reason for why this question comes up fairly
frequently is that if you follow the installation instructions starting
at 2.1 and then keep hitting "next topic", section 2.6, Single-node
Setup, is skipped - it goes from 2.5 -> 3.0.

regards,
Karl
--
Karl Helmer, PhD
Athinoula A Martinos Center
for Biomedical Imaging
Massachusetts General Hospital
149 - 13th St Room 2301
Charlestown, MA 02129
(p) 617.726.8636
(f) 617.726.7422
hel...@nmr.mgh.harvard.edu





The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

Nicholas Outram

unread,
Dec 6, 2016, 10:02:42 AM12/6/16
to us...@couchdb.apache.org
Agreed - that would explain a lot.

Having the wrong port for _config also gave me quite a lot of trouble.

Getting there now :)


On 6 Dec 2016, at 14:13, Karl Helmer <hel...@nmr.mgh.harvard.edu<mailto:hel...@nmr.mgh.harvard.edu>> wrote:

Hi,

I think one possible reason for why this question comes up fairly
frequently is that if you follow the installation instructions starting
at 2.1 and then keep hitting "next topic", section 2.6, Single-node
Setup, is skipped - it goes from 2.5 -> 3.0.

regards,
Karl


Thank you Joan - indeed I was missing something!

Much appreciated -

Nick

(email / Skype for Business):
nichola...@plymouth.ac.uk<mailto:nichola...@plymouth.ac.uk><mailto:nichola...@plymouth.ac.uk>
hel...@nmr.mgh.harvard.edu<mailto:hel...@nmr.mgh.harvard.edu>





The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


Joan Touzet

unread,
Dec 6, 2016, 3:13:03 PM12/6/16
to us...@couchdb.apache.org
Hi Karl,

Agreed. The docs were rushed for the v2.0.0 release and need work.
Pull requests are welcome ;-)

Karl Helmer

unread,
Dec 7, 2016, 10:45:22 AM12/7/16
to Joan Touzet, us...@couchdb.apache.org
Hi Joan,

I've actually been working on a separate "how-to" doc for 2.0
installation on Ubuntu linux just for my own records. It has info on a
few issues I've found as I go through the process. If you're
interested in it, I'd be happy to share (after I clean it up...). Or I
can submit individual pull requests if that works better.

regards,
Karl

Joan Touzet

unread,
Dec 7, 2016, 3:02:00 PM12/7/16
to us...@couchdb.apache.org
If you can do the work to incorporate the information you've built up
into our actual documentation repository, that's the best option. We
want there to be a single place people go to learn how to install and
setup CouchDB 2.0.

If not, you can provide the HOWTO document to us, preferably with a
JIRA ticket suggesting the info be incorporated into the installation
documentation, and we'll make a best effort to get the info into the
real docs.

Thanks again for your help!

Best,

Jan Lehnardt

unread,
Dec 8, 2016, 5:14:29 AM12/8/16
to us...@couchdb.apache.org
In addition, PRs against https://github.com/apache/couchdb-documentation would ideal for us, and would guarantee the fastest turnaround time to publication ;)

Best
Jan
--
--
Professional Support for Apache CouchDB:
https://neighbourhood.ie/couchdb-support/

Daniel Munch

unread,
Dec 8, 2016, 5:30:45 AM12/8/16
to us...@couchdb.apache.org, Joan Touzet
Hi,

another question regarding single-node-setup: Is it mandatory to run
the setup wizard? If yes, is there a way to run the single-node-setup
without the wizard, like there is for the cluster-setup?

What I'm currently doing is to configure my admin user and password
beforehand in the config file and create those special databases
_users, _replicator and _global_changes manually like written in the
docs. CouchDB runs fine after this, however I'm always feeling guilty
since I'm not 100% sure if I missed something because I didn't run the
wizard.

Thanks!
Daniel

Jan Lehnardt

unread,
Dec 8, 2016, 5:34:27 AM12/8/16
to us...@couchdb.apache.org

> On 8 Dec 2016, at 11:30, Daniel Munch <dani....@gmail.com> wrote:
>
> Hi,
>
> another question regarding single-node-setup: Is it mandatory to run
> the setup wizard? If yes, is there a way to run the single-node-setup
> without the wizard, like there is for the cluster-setup?
>
> What I'm currently doing is to configure my admin user and password
> beforehand in the config file and create those special databases
> _users, _replicator and _global_changes manually like written in the
> docs. CouchDB runs fine after this, however I'm always feeling guilty
> since I'm not 100% sure if I missed something because I didn't run the
> wizard.

The wizard does precisely this: set an admin password and create the
three system databases, so you’re good to go.

Best
Jan
--

Daniel Munch

unread,
Dec 8, 2016, 5:58:46 AM12/8/16
to us...@couchdb.apache.org
Great, thanks!

I think the question was asked before, but from the docs it doesn't
seem obvious that the wizard creates the three system databases as
well, it kind of reads as if you'd have to do this manually after it
ran. So if that's the case I'd go and add those informations to the
docs, guess this could be handy for others as well!

Best,
Daniel

Jan Lehnardt

unread,
Dec 8, 2016, 6:19:16 AM12/8/16
to us...@couchdb.apache.org

> On 8 Dec 2016, at 11:58, Daniel Munch <dani....@gmail.com> wrote:
>
> Great, thanks!
>
> I think the question was asked before, but from the docs it doesn't
> seem obvious that the wizard creates the three system databases as
> well, it kind of reads as if you'd have to do this manually after it
> ran. So if that's the case I'd go and add those informations to the
> docs, guess this could be handy for others as well!

it definitely does: https://github.com/apache/couchdb-setup/blob/master/src/setup.erl#L172 ;)

Daniel Munch

unread,
Dec 8, 2016, 6:57:51 AM12/8/16
to us...@couchdb.apache.org
On Thu, Dec 8, 2016 at 12:19 PM, Jan Lehnardt <j...@apache.org> wrote:
>
> it definitely does: https://github.com/apache/couchdb-setup/blob/master/src/setup.erl#L172 ;)
>


I agree that code is the ultimate documentation, but for those who
prefer reading in English over Erlang I made a little translation ;)

https://github.com/apache/couchdb-documentation/pull/94
Reply all
Reply to author
Forward
0 new messages