You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Paul Joseph Davis (JIRA)" <ji...@apache.org> on 2010/10/09 21:46:36 UTC

[jira] Updated: (COUCHDB-335) More 500 errors for malformed client requests

     [ https://issues.apache.org/jira/browse/COUCHDB-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Joseph Davis updated COUCHDB-335:
--------------------------------------

    Skill Level: Regular Contributors Level (Easy to Medium)

> More 500 errors for malformed client requests
> ---------------------------------------------
>
>                 Key: COUCHDB-335
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-335
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: HTTP Interface
>         Environment: SVN trunk "0.10.0a768591"
>            Reporter: Brian Candler
>            Priority: Minor
>         Attachments: error-tests.js
>
>
> Here are four more cases where malformed client requests can return "500 Internal Server Error" (as shown by curl -v) with an unhelpful diagnostic message.
> $ curl -X PUT http://127.0.0.1:5984/test
> {"ok":true}
> $ curl -X POST -d '{"docs":[1,2,3]}' http://127.0.0.1:5984/test/_bulk_docs
> {"error":"unknown_error","reason":"function_clause"}
> ### 500 Internal Server Error
> $ curl -X POST -d '{"docs":{"foo":"bar"}}' http://127.0.0.1:5984/test/_bulk_docs
> {"error":"unknown_error","reason":"function_clause"}
> ### 500 Internal Server Error
> $ curl -X POST -d '[]' -H 'Content-Type: application/json' http://127.0.0.1:5984/test/_temp_view
> {"error":"badmatch","reason":""}
> ### 500 Internal Server Error
> $ curl -X POST -d '{}' -H 'Content-Type: application/json' http://127.0.0.1:5984/test/_temp_view
> {"error":"badmatch","reason":"{{nocatch,{compilation_error,<<\"expression does not eval to a function. (undefined)\">>}},\n [{couch_os_process,prompt,2},\n  {couch_query_servers,'-start_doc_map/2-fun-0-',2},\n  {lists,foreach,2},\n  {couch_query_servers,start_doc_map,2},\n  {couch_view_updater,view_compute,2},\n  {couch_view_updater,update,1}]}"}
> ### 500 Internal Server Error
> See also COUCHDB-320 which gives another way to elicit a 500:
> curl -X POST -d '{"map":"function(){}"}' http://127.0.0.1:5984/test/_temp_view
> {"error":"incorrect_mime_type","reason":"application/x-www-form-urlencoded"}
> ### 500 Internal Server Error

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