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 3B6AF98C8 for ; Fri, 2 Mar 2012 13:22:28 +0000 (UTC) Received: (qmail 57671 invoked by uid 500); 2 Mar 2012 13:22:27 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 57617 invoked by uid 500); 2 Mar 2012 13:22:27 -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 57539 invoked by uid 99); 2 Mar 2012 13:22:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Mar 2012 13:22:27 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=NORMAL_HTTP_TO_IP,SPF_NEUTRAL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [80.244.253.218] (HELO mail.traeumt.net) (80.244.253.218) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Mar 2012 13:22:19 +0000 Received: from [10.0.0.10] (91-64-198-154-dynip.superkabel.de [91.64.198.154]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.traeumt.net (Postfix) with ESMTPSA id 7B2453CE16 for ; Fri, 2 Mar 2012 14:21:57 +0100 (CET) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Apple Message framework v1257) Subject: Re: Update Conflict for PUT/DELETE in _replicator From: Jan Lehnardt In-Reply-To: Date: Fri, 2 Mar 2012 14:21:57 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <6994F93E-F74F-4AFB-9F3E-8D690AE58685@apache.org> References: <86FAED34-1BA3-4641-ACFB-FEEAC063C412@apache.org> To: dev@couchdb.apache.org X-Mailer: Apple Mail (2.1257) X-Virus-Checked: Checked by ClamAV on apache.org On Mar 2, 2012, at 14:11 , Stefan K=F6gl wrote: > On Fri, Mar 2, 2012 at 1:39 PM, Jan Lehnardt wrote: >> On Mar 2, 2012, at 13:25 , Stefan K=F6gl wrote: >>> Again something I noticed during my 1.2.x experiments: It seems I >>> can't update or remove a document from the _replicator database, = which >>> I use for pull-replication into my 1.2.x instance. >>>=20 >>> # get current _rev >>> $ curl http://127.0.0.1:5984/_replicator/mygpo >>> = {"_id":"mygpo","_rev":"131-57b4da8d3163468cb0bbf4fd30c87832","source":"***= *********************","target":"http://127.0.0.1:5984/mygpo","create_targ= et":false,"continuous":true,"user_ctx":{"name":"stefan","roles":["admin"]}= ,"owner":"stefan","_replication_state":"triggered","_replication_state_tim= e":"2012-03-02T02:56:12+00:00","_replication_id":"f9fc5457b278d3cdb1ba2f18= 81253b04"} >>>=20 >>> # try to delete >>> $ curl -X DELETE >>> = "http://127.0.0.1:5984/_replicator/mygpo?_rev=3D131-57b4da8d3163468cb0bbf4= fd30c87832" >>> {"error":"conflict","reason":"Document update conflict."} >>=20 >> this should be ?rev=3D... (no underscore) >=20 > Of course, I also tried that but it didn't work either... see below. Cool, next step, see below :) >>> $ curl -X PUT "http://127.0.0.1:5984/_replicator/mygpo" -d = @replication.json >>=20 >> Can you try adding the ?rev=3D in the URL as well? >=20 > # get the rev first > $ curl http://127.0.0.1:5984/_replicator/mygpo > = {"_id":"mygpo","_rev":"131-57b4da8d3163468cb0bbf4fd30c87832","source":"***= *****************","target":"http://127.0.0.1:5984/mygpo","create_target":= false,"continuous":true,"user_ctx":{"name":"stefan","roles":["admin"]},"ow= ner":"stefan","_replication_state":"triggered","_replication_state_time":"= 2012-03-02T02:56:12+00:00","_replication_id":"f9fc5457b278d3cdb1ba2f188125= 3b04"} >=20 > # delete with rev instead of _rev > $ curl -X DELETE > = "http://127.0.0.1:5984/_replicator/mygpo?rev=3D131-57b4da8d3163468cb0bbf4f= d30c87832" can you try = http://stefan:youpassword@127.0.0.1:5984/_replicator/mygpo?rev=3D131-57b4d= a8d3163468cb0bbf4fd30c87832 ^^^^^^^^^^^^^^^^^^^ - note the auth info Same with the PUT. This is something that has changed in 1.2.x: = http://wiki.apache.org/couchdb/Breaking_changes#Changes_Between_1.1.0_and_= 1.2.0 If that's it though, I'd argue the error message could be improved. Cheers Jan --=20 > {"error":"conflict","reason":"Document update conflict."} >=20 > # now PUT with rev in URL > $ curl -X PUT = "http://127.0.0.1:5984/_replicator/mygpo?rev=3D131-57b4da8d3163468cb0bbf4f= d30c87832" > -d @replication.json > {"error":"conflict","reason":"Document update conflict."} >=20 > # still the same rev (no other change in between) > $ curl http://127.0.0.1:5984/_replicator/mygpo > = {"_id":"mygpo","_rev":"131-57b4da8d3163468cb0bbf4fd30c87832","source":"***= *****************","target":"http://127.0.0.1:5984/mygpo","create_target":= false,"continuous":true,"user_ctx":{"name":"stefan","roles":["admin"]},"ow= ner":"stefan","_replication_state":"triggered","_replication_state_time":"= 2012-03-02T02:56:12+00:00","_replication_id":"f9fc5457b278d3cdb1ba2f188125= 3b04"} >=20 >=20 > -- Stefan