You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Zachary Zolton <za...@gmail.com> on 2010/08/19 18:08:16 UTC

How to cancel a continuous replication task

Howdy,

I know you're supposed to be able to cancel a continuous replication
task by adding "cancel":true to the JSON body, but I've never been
able to get it working.

For example, I just started this replication job:

curl -X POST 'http://localhost:5984/_replicate' -d
'{"source":"my-db","target":"http://username:pass@couch.host/target-db","continuous":true,"create_target":true}'

Then, I tried to cancel it:

curl -X POST 'http://localhost:5984/_replicate' -d
'{"source":"my-db","target":"http://username:pass@couch.host/target-db","continuous":true,"cancel":true}'

I get the following result:

{"error":"not_found"}

Any ideas of what I'm doing wrong here?


Cheers,

Zach


P.S. I'm aware of the instructions on the wiki:
http://wiki.apache.org/couchdb/Replication#Cancelling_a_continuous_replication_task

Re: How to cancel a continuous replication task

Posted by Zachary Zolton <za...@gmail.com>.
Yes, I did receive a {"ok":true,"_local_id":"foo"} response, when
POSTing the replication. I can see the replication task in the
_active_tasks results JSON.

Here's what I just tried:

curl -X POST -d
'{"source":"my-db","target":"http://user:pass@couch.host/target-db/","continuous":true,"cancel":true}'
http://localhost:5984/_replicate

And the result:

{"error":"not_found"}

Note that I've tried it with, and without, the slash on the end of the
target DB URL. I'm kinda stumped...

FYI, I'm running 1.0.0 *GASP* (but I've got delayed_commits turned off).

On Thu, Aug 19, 2010 at 11:25 AM, Bharat Bharat
<Bh...@citrix.com> wrote:
> This works for me:
>
> curl -X POST -d '{"source":"http://couchdb:5984/db","target":"db","continuous":true,"cancel":true}' http://couchdb:5984/_replicate
>
> Only difference is that I never use a url in "target" so I run cancel locally from where your process is running.
>
> On Aug 19, 2010, at 9:08 AM, Zachary Zolton wrote:
>
>> Howdy,
>>
>> I know you're supposed to be able to cancel a continuous replication
>> task by adding "cancel":true to the JSON body, but I've never been
>> able to get it working.
>>
>> For example, I just started this replication job:
>>
>> curl -X POST 'http://localhost:5984/_replicate' -d
>> '{"source":"my-db","target":"http://username:pass@couch.host/target-db","continuous":true,"create_target":true}'
>>
>> Then, I tried to cancel it:
>>
>> curl -X POST 'http://localhost:5984/_replicate' -d
>> '{"source":"my-db","target":"http://username:pass@couch.host/target-db","continuous":true,"cancel":true}'
>>
>> I get the following result:
>>
>> {"error":"not_found"}
>>
>> Any ideas of what I'm doing wrong here?
>>
>>
>> Cheers,
>>
>> Zach
>>
>>
>> P.S. I'm aware of the instructions on the wiki:
>> http://wiki.apache.org/couchdb/Replication#Cancelling_a_continuous_replication_task
>
>

Re: How to cancel a continuous replication task

Posted by Bharat Bharat <Bh...@citrix.com>.
This works for me:

curl -X POST -d '{"source":"http://couchdb:5984/db","target":"db","continuous":true,"cancel":true}' http://couchdb:5984/_replicate

Only difference is that I never use a url in "target" so I run cancel locally from where your process is running. 

On Aug 19, 2010, at 9:08 AM, Zachary Zolton wrote:

> Howdy,
> 
> I know you're supposed to be able to cancel a continuous replication
> task by adding "cancel":true to the JSON body, but I've never been
> able to get it working.
> 
> For example, I just started this replication job:
> 
> curl -X POST 'http://localhost:5984/_replicate' -d
> '{"source":"my-db","target":"http://username:pass@couch.host/target-db","continuous":true,"create_target":true}'
> 
> Then, I tried to cancel it:
> 
> curl -X POST 'http://localhost:5984/_replicate' -d
> '{"source":"my-db","target":"http://username:pass@couch.host/target-db","continuous":true,"cancel":true}'
> 
> I get the following result:
> 
> {"error":"not_found"}
> 
> Any ideas of what I'm doing wrong here?
> 
> 
> Cheers,
> 
> Zach
> 
> 
> P.S. I'm aware of the instructions on the wiki:
> http://wiki.apache.org/couchdb/Replication#Cancelling_a_continuous_replication_task


Re: How to cancel a continuous replication task

Posted by Robert Newson <ro...@gmail.com>.
Did you get an {"ok":true,"_local_id":"foo"} response from the first
_replicate call?

I've just verified that adding "cancel":true to the original
_replicate setting cancels the task. Perhaps you're on an earlier
version than this feature?

B.

On Thu, Aug 19, 2010 at 5:08 PM, Zachary Zolton
<za...@gmail.com> wrote:
> Howdy,
>
> I know you're supposed to be able to cancel a continuous replication
> task by adding "cancel":true to the JSON body, but I've never been
> able to get it working.
>
> For example, I just started this replication job:
>
> curl -X POST 'http://localhost:5984/_replicate' -d
> '{"source":"my-db","target":"http://username:pass@couch.host/target-db","continuous":true,"create_target":true}'
>
> Then, I tried to cancel it:
>
> curl -X POST 'http://localhost:5984/_replicate' -d
> '{"source":"my-db","target":"http://username:pass@couch.host/target-db","continuous":true,"cancel":true}'
>
> I get the following result:
>
> {"error":"not_found"}
>
> Any ideas of what I'm doing wrong here?
>
>
> Cheers,
>
> Zach
>
>
> P.S. I'm aware of the instructions on the wiki:
> http://wiki.apache.org/couchdb/Replication#Cancelling_a_continuous_replication_task
>