You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Vilya Harvey (JIRA)" <ji...@apache.org> on 2009/05/28 22:55:45 UTC

[jira] Created: (COUCHDB-364) Badly formed bulk insert returns an invalid HTTP response

Badly formed bulk insert returns an invalid HTTP response
---------------------------------------------------------

                 Key: COUCHDB-364
                 URL: https://issues.apache.org/jira/browse/COUCHDB-364
             Project: CouchDB
          Issue Type: Bug
          Components: HTTP Interface
    Affects Versions: 0.9
         Environment: Linux 2.6.29.4-162.fc11.x86_64 (Fedora 11)
Erlang (BEAM) emulator version 5.6.5 [source] [64-bit] [smp:4] [async-threads:0] [hipe] [kernel-poll:false] with OTP R12B
CouchDB 0.9.0
            Reporter: Vilya Harvey
            Priority: Minor


Trying to do a bulk update via /database/_bulk_docs and passing any unexpected JSON value as the body (i.e. anything other than a map with the key "docs" containing the list of documents) causes CouchDB to return an empty response. I guess it should be returning an error message describing the problem in this case?

For example, this works correctly and returns the list of inserted documents:
curl -X POST -d '{ "docs": [{"name": "Fred"}, {"name": "Bruce"}] }' http://localhost:5984/scans/_bulk_docs

But this fails with the error message as below:
curl -X POST -d '[{"name": "Fred"}, {"name": "Bruce"}]' http://localhost:5984/scans/_bulk_docs
curl: (52) Empty reply from server

(the difference being that the second is just passing through a list of documents, leaving out the { "docs": ... } wrapper).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (COUCHDB-364) Badly formed bulk insert returns an invalid HTTP response

Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-364?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Joseph Davis resolved COUCHDB-364.
---------------------------------------

       Resolution: Duplicate
    Fix Version/s: 0.10
         Assignee: Paul Joseph Davis

Pretty sure this is a duplicate of COUCHDB-306 which is fixed in trunk. If you can reproduce this on trunk please reopen.

> Badly formed bulk insert returns an invalid HTTP response
> ---------------------------------------------------------
>
>                 Key: COUCHDB-364
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-364
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 0.9
>         Environment: Linux 2.6.29.4-162.fc11.x86_64 (Fedora 11)
> Erlang (BEAM) emulator version 5.6.5 [source] [64-bit] [smp:4] [async-threads:0] [hipe] [kernel-poll:false] with OTP R12B
> CouchDB 0.9.0
>            Reporter: Vilya Harvey
>            Assignee: Paul Joseph Davis
>            Priority: Minor
>             Fix For: 0.10
>
>
> Trying to do a bulk update via /database/_bulk_docs and passing any unexpected JSON value as the body (i.e. anything other than a map with the key "docs" containing the list of documents) causes CouchDB to return an empty response. I guess it should be returning an error message describing the problem in this case?
> For example, this works correctly and returns the list of inserted documents:
> curl -X POST -d '{ "docs": [{"name": "Fred"}, {"name": "Bruce"}] }' http://localhost:5984/scans/_bulk_docs
> But this fails with the error message as below:
> curl -X POST -d '[{"name": "Fred"}, {"name": "Bruce"}]' http://localhost:5984/scans/_bulk_docs
> curl: (52) Empty reply from server
> (the difference being that the second is just passing through a list of documents, leaving out the { "docs": ... } wrapper).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.