Discussion:
replicator database is missing design docs
James Marca
2011-11-02 05:43:39 UTC
Permalink
Hi All,

I am using the new-ish CouchDB replicator database documented here
<http://wiki.apache.org/couchdb/Replication#Replicator_database>.

Today I noticed that my design docs are not replicating with this
mechanism. The data copies fine, but the design docs do not.

I flailed about with a number of options (sticking passwords and
usernames in the source URL, trying out the user contexts that are
poorly documented, and so on), but nothing worked. I had to revert to
the manual replication tool in Futon.

Is this a bug, a feature, or am I doing something wrong? (Probably the latter.)


I am running Couch 1.1.1 on the source database, and am testing out
1.2 on the target end ("version":"1.2.0a-b0baa80-git").
Dan Everton
2011-11-02 10:50:12 UTC
Permalink
Post by James Marca
Hi All,
I am using the new-ish CouchDB replicator database documented here
<http://wiki.apache.org/couchdb/Replication#Replicator_database>.
Today I noticed that my design docs are not replicating with this
mechanism.  The data copies fine, but the design docs do not.
Huh, I was just looking in to this exact problem today with a 1.1.1
install as well. We have a master/slave setup with the slave pulling
continuously from the master. The _design documents never seem to
replicate to the slave and there's no errors in the logs. I've checked
for conflicts and other things and also recreated the slave from
scratch and still nothing.

At least it seems like I'm not alone.

Cheers,
Dan
Benoit Chesneau
2011-11-02 11:10:14 UTC
Permalink
Post by Dan Everton
Post by James Marca
Hi All,
I am using the new-ish CouchDB replicator database documented here
<http://wiki.apache.org/couchdb/Replication#Replicator_database>.
Today I noticed that my design docs are not replicating with this
mechanism. The data copies fine, but the design docs do not.
Huh, I was just looking in to this exact problem today with a 1.1.1
install as well. We have a master/slave setup with the slave pulling
continuously from the master. The _design documents never seem to
replicate to the slave and there's no errors in the logs. I've checked
for conflicts and other things and also recreated the slave from
scratch and still nothing.
At least it seems like I'm not alone.
Cheers,
Dan
did you try to replicate them with an admin user? If the problem persist
anyway, please open a ticket.

benoît

- from my mobile
Filipe David Manana
2011-11-02 11:15:45 UTC
Permalink
Add a user_ctx top level property to the replication document:

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

You can read about it at https://gist.github.com/832610 (the couch wiki
points to it somewhere).
Post by Benoit Chesneau
Post by Dan Everton
Post by James Marca
Hi All,
I am using the new-ish CouchDB replicator database documented here
<http://wiki.apache.org/couchdb/Replication#Replicator_database>.
Today I noticed that my design docs are not replicating with this
mechanism. The data copies fine, but the design docs do not.
Huh, I was just looking in to this exact problem today with a 1.1.1
install as well. We have a master/slave setup with the slave pulling
continuously from the master. The _design documents never seem to
replicate to the slave and there's no errors in the logs. I've checked
for conflicts and other things and also recreated the slave from
scratch and still nothing.
At least it seems like I'm not alone.
Cheers,
Dan
did you try to replicate them with an admin user? If the problem persist
anyway, please open a ticket.
benoît
- from my mobile
--
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."
James Marca
2011-11-02 19:25:12 UTC
Permalink
Post by Filipe David Manana
"user_ctx": { "roles": [ "_admin" ] }
Thanks, that works.

I used to add "user_ctx": {"name":"james","roles":["_admin"]}, but at
some point I stopped because started getting errors along the lines of
assigning roles beginning with underscore in delegated user contexts
was not allowed (I can't remember the exact wording, and in fact I
can't get this to happen right now in 1.1.1 and 1.3.git...).
Post by Filipe David Manana
You can read about it at https://gist.github.com/832610 (the couch wiki
points to it somewhere).
Yes that page is quite clear on this point. But ... the couch wiki
also points to
http://docs.couchbase.org/couchdb-release-1.1/index.html#couchdb-release-1.1-replicatordb-delegations
which says:

When there's no user_ctx property in a replication document, the
default user context is used:

{
"name": null,
"roles": ["_admin"]
}

By default only administrators can trigger delegated
replications. This rule is enforced by the default document update
validation function of the replicator database's design document.

In fact, from the gist page, "if it's missing it defaults to a user
context with name null and an empty list of roles"

The couchbase version should be corrected.

Regards,

James
Post by Filipe David Manana
Post by Benoit Chesneau
Post by Dan Everton
Post by James Marca
Hi All,
I am using the new-ish CouchDB replicator database documented here
<http://wiki.apache.org/couchdb/Replication#Replicator_database>.
Today I noticed that my design docs are not replicating with this
mechanism. The data copies fine, but the design docs do not.
Huh, I was just looking in to this exact problem today with a 1.1.1
install as well. We have a master/slave setup with the slave pulling
continuously from the master. The _design documents never seem to
replicate to the slave and there's no errors in the logs. I've checked
for conflicts and other things and also recreated the slave from
scratch and still nothing.
At least it seems like I'm not alone.
Cheers,
Dan
did you try to replicate them with an admin user? If the problem persist
anyway, please open a ticket.
benoît
- from my mobile
--
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."
Loading...