couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <>
Subject Re: Debugging 302/Unauthorized error
Date Thu, 23 Jun 2011 15:42:06 GMT
It's possible that this got broken on trunk recently though this is
the first such report and I don't think it's changed since the 1.1

The precedence of response content-type changed between 1.0 and 1.1
but that doesn't seem to be your problem.

With the information providing, I'd say you're genuinely passing the
wrong username/password combination.


On 23 June 2011 11:26, Martin Hewitt <> wrote:
> 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 fields.
> 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)
> Location:
> 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
> Any help debugging this problem would be greatly appreciated.
> Many thanks,
> Martin

View raw message