emlaver opened a new issue #1651: Partial JSON response when executing against 
_bulk_get endpoint
URL: https://github.com/apache/couchdb/issues/1651
 
 
   <!--- Provide a general summary of the issue in the Title above -->
   
   ## Expected Behavior
   <!--- If you're describing a bug, tell us what should happen -->
   <!--- If you're suggesting a change/improvement, tell us how it should work 
-->
   When executing a POST request against the `_bulk_get` endpoint, I expect a 
valid JSON response.
   For example, if I make a request against `_bulk_get` with invalid data in 
the request body I should get back a 400 response with `invalid UTF-8 JSON` 
reason.
   
   ## Current Behavior
   <!--- If describing a bug, tell us what happens instead of the expected 
behavior -->
   <!--- If suggesting a change/improvement, explain the difference from 
current behavior -->
   When executing the request below, I get back a partial JSON response with no 
error message.
   ```
   http:/localhost:5984/_users/_bulk_get' -H content-type:application/json -d 
'{"docs":["doc-1"]}'
   ```
   
   The `docs` value in the request body is invalid.  It needs to be updated to 
`[{"id":"doc-1"}]`.
   
   ## Possible Solution
   <!--- Not obligatory, but suggest a fix/reason for the bug, -->
   <!--- or ideas how to implement the addition or change -->
   
   ## Steps to Reproduce (for bugs)
   <!--- Provide a link to a live example, or an unambiguous set of steps to -->
   <!--- reproduce this bug. Include code to reproduce, if relevant -->
   1. Create a database
   2. Create a document in the db
   3. POST request using ` _bulk_get` against the db with invalid request data
   e.g. `curl http:/localhost:5984/_users/_bulk_get'  -H 
content-type:application/json -d '{"docs":["doc-1"]}'`
   4. Get back partial JSON response
   e.g. `{"results": [%`
   
   Verbose request details:
   ```
   *   Trying ::1...
   * TCP_NODELAY set
   * Connected to localhost (::1) port 5984 (#0)
   * Server auth using Basic with user 'admin'
   > POST /db/_bulk_get HTTP/1.1
   > Host: localhost:5984
   > User-Agent: curl/7.54.0
   > Accept: */*
   > Content-Type:application/json
   > Content-Length: 18
   > 
   * upload completely sent off: 18 out of 18 bytes
   < HTTP/1.1 200 OK
   < Cache-Control: must-revalidate
   < Content-Type: application/json
   < Date: Thu, 11 Oct 2018 16:42:07 GMT
   < Server: CouchDB/2.2.0 (Erlang OTP/19)
   < Transfer-Encoding: chunked
   < X-Couch-Request-ID: 6afa032a5e
   < X-CouchDB-Body-Time: 0
   < 
   * Illegal or missing hexadecimal sequence in chunked-encoding
   * stopped the pause stream!
   * Closing connection 0
   curl: (56) Illegal or missing hexadecimal sequence in chunked-encoding
   {"results": 
   ```
   
   
   ## Context
   <!--- How has this issue affected you? What are you trying to accomplish? -->
   <!--- Providing context helps us come up with a solution that is most useful 
in the real world -->
   It's not clear that my request body data was invalid.  It would be ideal to 
get back some error message letting me know that the data is invalid.
   ## Your Environment
   <!--- Include as many relevant details about the environment you experienced 
the bug in -->
   * Version used: 2.2.0
   * Browser Name and version: NA
   * Operating System and version (desktop or mobile): Mac OS 10.14
   * Link to your project: NA
   * Curl version: `curl 7.54.0 (x86_64-apple-darwin18.0)`
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to