Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F3549E08E for ; Fri, 1 Feb 2013 12:38:14 +0000 (UTC) Received: (qmail 24216 invoked by uid 500); 1 Feb 2013 12:38:13 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 24052 invoked by uid 500); 1 Feb 2013 12:38:13 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 24015 invoked by uid 99); 1 Feb 2013 12:38:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Feb 2013 12:38:13 +0000 Date: Fri, 1 Feb 2013 12:38:12 +0000 (UTC) From: "Robert Newson (JIRA)" To: dev@couchdb.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (COUCHDB-1665) _replicator and _users MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-1665?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Robert Newson resolved COUCHDB-1665. ------------------------------------ Resolution: Not A Problem > _replicator and _users > ---------------------- > > Key: COUCHDB-1665 > URL: https://issues.apache.org/jira/browse/COUCHDB-1665 > Project: CouchDB > Issue Type: Bug > Components: Replication > Reporter: Tibor Gemes > > I've set up 2 servers, one local and one remote. I want to replicate the _users database always. So I decided to add a document to the _replicator database. This seems to be fine. But after I add a user document to the _users database, the replicator keeps failing. It is in an endless triggered-error-triggered-error cycle, but the replication does not take place. If I call _replicate with the same json, then the replication happens perfectly. If the two _users databases are in sync then the replicator document settles in the triggered state. > Here is a simple testcase to reproduce. The local and remote databases are freshly created: > {code} > curl -H "Content-type: application/json" -X PUT -d "{\"source\": \"_users\", \"target\": \"${REMOTE_URL}/_users\", \"continuous\": true, \"user_ctx\": {\"name\": \"admin\", \"roles\": [\"admin\"]}}" ${LOCAL_URL}/_replicator/users:devices_users > {"ok":true,"id":"users:devices_users","rev":"1-010f00d464fba86a2820371c7bf04900"} > curl -X GET ${LOCAL_URL}/_replicator/users:devices_users > {"_id":"users:devices_users","_rev":"2-1df51063f46e4465ec1f6aaad7b03cd7","source":"_users","target":"http://admin:devices@devices-db:5984/_users","continuous":true,"user_ctx":{"name":"admin","roles":["admin"]},"owner":"admin","_replication_state":"triggered","_replication_state_time":"2013-02-01T12:57:05+01:00","_replication_id":"d78c7d9b7b215c6f2a3cb99c41f6be4c"} > curl -X PUT -d '{ "type": "user", "name": "u1", "roles": ["u1"], "password": "XXX"}' ${LOCAL_URL}/_users/org.couchdb.user:u1 > {"ok":true,"id":"org.couchdb.user:u1","rev":"1-f27f72a514abae8078740c792d5a0795"} > curl -X GET ${LOCAL_URL}/_replicator/users:devices_users > {"_id":"users:devices_users","_rev":"3-c0ee7e14995877591740ee3191c147df","source":"_users","target":"http://admin:devices@devices-db:5984/_users","continuous":true,"user_ctx":{"name":"admin","roles":["admin"]},"owner":"admin","_replication_state":"error","_replication_state_time":"2013-02-01T12:57:52+01:00","_replication_id":"d78c7d9b7b215c6f2a3cb99c41f6be4c"} > curl -X GET ${LOCAL_URL}/_replicator/users:devices_users > {"_id":"users:devices_users","_rev":"9-e16eff5cb75c2620a429ba0610bbf487","source":"_users","target":"http://admin:devices@devices-db:5984/_users","continuous":true,"user_ctx":{"name":"admin","roles":["admin"]},"owner":"admin","_replication_state":"error","_replication_state_time":"2013-02-01T12:58:08+01:00","_replication_id":"d78c7d9b7b215c6f2a3cb99c41f6be4c"} > curl -X GET ${REMOTE_URL}/_users/org.couchdb.user:u1 > {"error":"not_found","reason":"missing"} > curl -H "Content-type: application/json" -X POST -d "{\"source\": \"_users\", \"target\": \"${REMOTE_URL}/_users\"}" ${LOCAL_URL}/_replicate > {"ok":true,"session_id":"bc58f3a39efb24ecbcb73114040c13b9","source_last_seq":2,"replication_id_version":2,"history":[{"session_id":"bc58f3a39efb24ecbcb73114040c13b9","start_time":"Fri, 01 Feb 2013 12:02:07 GMT","end_time":"Fri, 01 Feb 2013 12:02:07 GMT","start_last_seq":0,"end_last_seq":2,"recorded_seq":2,"missing_checked":2,"missing_found":1,"docs_read":1,"docs_written":1,"doc_write_failures":0}]} > curl -X GET ${REMOTE_URL}/_users/org.couchdb.user:u1 > {"_id":"org.couchdb.user:u1","_rev":"1-f27f72a514abae8078740c792d5a0795","type":"user","name":"u1","roles":["u1"],"password_sha":"da3b3bd9b957aafe94e9abce96bea95150d3dc8c","salt":"203b9f2e2bde5de40f107e84a4fec173"} > curl -X GET ${LOCAL_URL}/_replicator/users:devices_users > {"_id":"users:devices_users","_rev":"102-1bd305355290f8209985e2284250e8ce","source":"_users","target":"http://admin:devices@devices-db:5984/_users","continuous":true,"user_ctx":{"name":"admin","roles":["admin"]},"owner":"admin","_replication_state":"triggered","_replication_state_time":"2013-02-01T13:02:12+01:00","_replication_id":"d78c7d9b7b215c6f2a3cb99c41f6be4c"} > {code} > Here is what I see in the couchdb log: > {code} > [info] [<0.1742.0>] Document `users:devices_users` triggered replication `d78c7d9b7b215c6f2a3cb99c41f6be4c+continuous` > [info] [<0.1736.0>] starting new replication `d78c7d9b7b215c6f2a3cb99c41f6be4c+continuous` at <0.1742.0> (`_users` -> `h > ttp://admin:*****@devices-db:5984/_users/`) > [error] [emulator] Error in process <0.1749.0> with exit value: {{nocatch,not_found},[{couch_users_db,after_doc_read,2,[ > {file,"couch_users_db.erl"},{line,99}]},{couch_db,'-open_doc_revs_int/3-fun-0-',3,[{file,"couch_db.erl"},{line,1166}]},{ > lists,map,2,[{file,"lists.erl"},{line,1173}]},{couch_db,'-open_doc_revs_int/3-fun-1-'... > =ERROR REPORT==== 1-Feb-2013::13:02:07 === > Error in process <0.1749.0> with exit value: {{nocatch,not_found},[{couch_users_db,after_doc_read,2,[{file,"couch_users_ > db.erl"},{line,99}]},{couch_db,'-open_doc_revs_int/3-fun-0-',3,[{file,"couch_db.erl"},{line,1166}]},{lists,map,2,[{file, > "lists.erl"},{line,1173}]},{couch_db,'-open_doc_revs_int/3-fun-1-'... > [error] [<0.1742.0>] Worker <0.1749.0> died with reason: {{nocatch,not_found}, > [{couch_users_db, > after_doc_read,2, > [{file, > "couch_users_db.erl"}, > {line,99}]}, > {couch_db, > '-open_doc_revs_int/3-fun-0-', > 3, > [{file, > "couch_db.erl"}, > {line,1166}]}, > {lists,map,2, > [{file, > "lists.erl"}, > {line,1173}]}, > {couch_db, > '-open_doc_revs_int/3-fun-1-', > 4, > [{file, > "couch_db.erl"}, > {line,1158}]}, > {lists,zipwith,3, > ... > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira