Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-910

Malformed _bulk_docs post data causes a 500 function clause error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.0
    • 1.2
    • HTTP Interface
    • None
    • Cloudant BigCouch EC2 node

    • New Contributors Level (Easy)

    Description

      The following two malformed _bulk_docs request result in errors when issued to Cloudant's BigNode cluster (however, it is fundamentally a CouchDB problem and should give the same results with a standalone CouchDB):

      curl -d '

      {"doc": [] }

      ' -H 'Content-Type:application/json' -X POST https://appadvice.cloudant.com/foo/_bulk_docs

      {"error":"unknown_error","reason":"function_clause"}

      curl -d '{"doc": [

      {"_id":"foo"}

      ] }' -H 'Content-Type:application/json' -X POST https://appadvice.cloudant.com/foo/_bulk_docs

      {"error":"unknown_error","reason":"function_clause"}

      In both cases the error is that

      {"docs": [ ... ] }

      was not used but instead the keyword "doc" was used.

      The result should be a notification of the error in the data supplied, rather than crashing the web server.

      This is probably a reopening of issues related to COUCHDB-306

      Attachments

        1. patch.txt
          6 kB
          Dipesh Patel

        Activity

          People

            Unassigned Unassigned
            jaynelson Jay Nelson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 48h
                48h
                Remaining:
                Remaining Estimate - 48h
                48h
                Logged:
                Time Spent - Not Specified
                Not Specified