couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filipe David Manana <>
Subject Re: _replicator database...
Date Tue, 28 Jun 2011 22:29:39 GMT
On Tue, Jun 28, 2011 at 10:57 PM, kowsik <> wrote:
> Playing around with 1.1.0 and the _replicator database. I have, say,
> C1 that has require_valid_user set with admin credentials of foo:bar.
> I'm trying to do this on C2:
> curl -X PUT -H 'application/json' -d '{
>    "source":"http://foo:bar@C1/mydb",
>    "target":"mydb",
>    "create_target":true,
>    "continuous":true
> }' http://C2/_replicator/from_c1
> But no worky for me. The document itself gets added fine, but I see
> "unauthorized to access database" message in the log. Is the
> replicator not honoring the credentials specified in the document?
> Bug, work around?

Hi Kowsik!

Is the error "unauthorized to access database" related to the local
target database? If so, consider the following:

Your server has admins configured? If so, the replication request can
not create the target database (you didn't provide admin credentials
for the curl put request).
So either create it first, as an admin, or let the admin PUT the
replication document with an explicit user_ctx property in the doc
such as:

    "user_ctx": {
         "roles": ["_admin"]

You can read about this at, section 8.
Anyway, there should be a more explicit error log message telling the
problem was creating the target.
Let us know if it works.

> Thanks,
> K.
> ---

Filipe David Manana,,

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

View raw message