couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Hewitt <>
Subject Debugging 302/Unauthorized error
Date Thu, 23 Jun 2011 15:26:43 GMT
Hi all,

For a while now, we've had a build process that creates a website, creates Couch databases,
creates a user for that site, and then uses that new user to create the default design docs
for the newly-created databases.

In the last week or so, the create view action has been returning 302 errors and, when I run
the process by hand using cURL, I get the same error.

My process is:

1. Create user through Futon (e.g. org.couchdb.user:testuser)
2. Generate a password with a salt and hash it using PHP.
3. Save the new user record.
4. Create a new database (e.g. testuser_database)
5. Using Futon, open the Security dialog and add in ["testuser"] and ["admin"] to the Administrator
6. Save the security dialog.
7. Attempt a PUT of a design doc:

> curl -i -X PUT -d "{\"one\":\"two\"}" http://testuser:testpassword@

8. I get an error response:
HTTP/1.1 302 Moved Temporarily
Server: CouchDB/1.2.0a1075588 (Erlang OTP/R14B)
Date: Thu, 23 Jun 2011 15:18:36 GMT
Content-Type: text/plain;charset=utf-8
Content-Length: 67
Cache-Control: must-revalidate

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

Now, I *know* that neither the password nor the username is incorrect, and, up until a week
or so ago, this build process completed without issue. Raising the CouchDB log level to debug
gives no more useful information.

Couch version: {"couchdb":"Welcome","version":"1.2.0a1075588"}

I know a recent version of Couch was released (this was built from source a month or two ago),
but, this system is in production, so I'd rather not rebuild Couch if I can avoid it.

Any help debugging this problem would be greatly appreciated.

Many thanks,

View raw message