couchapp push testdb You are not a server admin error

Posted by Darwin Biler on March 2, 2013

Note: This post is intended for Web Developers who is trying out the tutorial for CouchApp in http://couchapp.org/page/getting-started tutorial.

If you are interested in this post, most likely you are a guy who is interested trying a No-SQL database from Apache called CouchDB . No wonder many developers are leaning toward No-SQL databases because of its ease of use and scalability feature.

With regards to the tutorial, when you are about to deploy the app in the part 3 "Push your CouchApp", there is a problem when you enter this in the command line:

couchapp push testdb

you will probably get an error like this:

E:\couchapp\helloworld>couchapp push testdb
2013-03-02 18:27:37 [CRITICAL] {"error":"unauthorized","reason":"You are not a server admin."

The reason behind this is the tutorial failed to point out that  "testdb" is the environment name on which some configuration should be used.

When you specify an environment name, couchapp push command will try to look at either .couchapprc or .couchapp.conf for the definition of such environment name. The default contents of the .couchapprc is just an empty JSON setting {} . One reason why the push "fails" is, you might have set admin password in the http://localhost:5984/_utils/ admin. Now you have to define that environment setting and set the user/pass you had specified in the _utils admin.

Possible Solution

1. Specify a default environment setting

{
 "env":{
	"default":{"db":"http://username:password@localhost:5984/testdb"}
 }
}

when you specify a default environment setting you can now just call couchapp push

when you dont specify an environment setting, it will just load the "default"

2. Specify the settings for "testdb" environment

{
 "env":{
	"testdb":{"db":"http://username:password@localhost:5984/testdb"}
 }
}

that way you can use the couchapp push testdb command

Hope it helps!


Did you find this useful?

I'm always happy to help! You can show your support and appreciation by Buying me a coffee (I love coffee!).