You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/04/02 09:57:18 UTC

[GitHub] jiangpengcheng opened a new issue #3511: the return data of `_bulk_doc` may not contain filed "rev", which will lead an spray json deserialization error

jiangpengcheng opened a new issue #3511: the return data of `_bulk_doc` may not contain filed "rev", which will lead an spray json deserialization error
URL: https://github.com/apache/incubator-openwhisk/issues/3511
 
 
   The return data of `_bulk_docs` api of CouchDB is just like below if everything is ok:
   
   ```json
   [{"id":"DEBUG001","rev":"1-xxxxxxxxxxx"}]
   ```
   
   But if some documents are failed to update(e.g. conflict), the result will be:
   
   ```json
   [{"id":"DEBUG001","error":"conflict","reason":"Document update conflict."}]
   ```
   
   there is no `rev` filed in an item, this will cause `convertTo[BulkEntityResult]` raising an error:
   
   ```scala
   [2018-04-02T09:44:15.209Z] [ERROR] [#tid_449373] [CouchDbRestStore] [PUT] 'lambda-real_activations' internal error, failure: 'Object is missing required member 'rev'' [marker:database_saveDocument_error:142020306:3]
   [2018-04-02T09:44:15.209Z] [ERROR] [#tid_449373] [InvokerReactive] failed to record activation
   ```
   
   ## Environment details:
   
   * local deployment
   
   ## Steps to reproduce the issue:
   
   it's hard to reproduce a conflict error for bulk inserting activations(but we met this error in one of our env, don't know the reason, we are still digging into it), 
   
   1. write a test scala script:
   
   ```scala
       val source = """[{"id": "tttt", "error": "conflict", "reason": "Document update conflict"}]"""
       val jsonAst = source.parseJson
   
       val myObject = jsonAst.convertTo[Seq[BulkEntityResult]]
       println(myObject)
   ```   
   2.   run above code will raise an error
   
   ```scala
   [2018-04-02T17:51:23.329Z] [INFO] Slf4jLogger started
   Exception in thread "main" spray.json.DeserializationException: Object is missing required member 'rev'
   ......
   ```
   

----------------------------------------------------------------
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