You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/09/20 15:40:41 UTC

[GitHub] nickva edited a comment on issue #1607: Replicator fails to authenticate to open db after cookie timeout

nickva edited a comment on issue #1607: Replicator fails to authenticate to open db after cookie timeout
URL: https://github.com/apache/couchdb/issues/1607#issuecomment-423229700
 
 
   An interesting observation is that a 403 HTTP response, which a `forbidden` could generate for individual docs will trigger a cookie refresh.
   
   However replicator, in the normal case would write documents using a `_bulk_docs`  endpoint and the result of that is `201` even though some documents in the batch failed with a `forbidden` error.
   
   It is possible to trick the replicator to use single requests if attachments are used. Indeed, I had waited till the after the session expired and added a document with an attachment to the source:
   
   ```
    curl -s -XPUT adm:pass@localhost:15984/srcdb/1/att1?rev=1-66e95cbbe626e928747ecc225341b2d6 -H 'Content-Type: application/octet-stream' -T 1mb
   {"ok":true,"id":"1","rev":"2-3dec55150ee06ac046419c71f00f5351"}
   ```
   
   The script was running in the part with long sleep but as soon as the attachment was added, the session was refreshed and the a few writes succeeded:
   
   ```
   DocID: 4
   Doc added to source, sleeping 7 seconds
   Getting doc from target:
   {"error":"not_found","reason":"missing"}
   
   DocID: 5
   Doc added to source, sleeping 7 seconds
   Getting doc from target:
   {"_id":"5","_rev":"1-66e95cbbe626e928747ecc225341b2d6","name":"adm"}
   
   DocID: 6
   Doc added to source, sleeping 7 seconds
   Getting doc from target:
   {"error":"not_found","reason":"missing"}
   ```
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services