couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filipe David Manana <fdman...@apache.org>
Subject Re: _replicator database...
Date Tue, 28 Jun 2011 22:29:39 GMT
On Tue, Jun 28, 2011 at 10:57 PM, kowsik <kowsik@gmail.com> 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:

{
    "source":"http://foo:bar@C1/mydb",
    "target":"mydb",
    "create_target":true,
    "continuous":true,
    "user_ctx": {
         "roles": ["_admin"]
    }
}

You can read about this at  https://gist.github.com/832610, 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.
> ---
> http://blitz.io
> http://twitter.com/pcapr
> http://blog.mudynamics.com
>



-- 
Filipe David Manana,
fdmanana@gmail.com, fdmanana@apache.org

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

Mime
View raw message