Nathan Vander Wilt created COUCHDB-1909:
-------------------------------------------
Summary: Error in underlying _changes?filter= JavaScript function
handled poorly
Key: COUCHDB-1909
URL: https://issues.apache.org/jira/browse/COUCHDB-1909
Project: CouchDB
Issue Type: Bug
Reporter: Nathan Vander Wilt
The following ddoc causes the changes feed to bork completely, returning a
response that is not valid JSON:
{code}
{
"_id": "_design/tmp",
"language": "javascript",
"filters": {
"test": "function(doc) { throw up; }"
}
}
{code}
{{curl http://localhost:5984/database/_changes?filter=tmp/test}} results in:
{code}
{"results":[
HTTP/1.0 500 Internal Server Error
Server: CouchDB/1.3.0 (Erlang OTP/R15B02)
Date: Tue, 15 Oct 2013 18:20:08 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 43
Cache-Control: must-revalidate
{"error":"ReferenceError","reason":"{[]}"}
{code}
The logs say:
{code}
[Tue, 15 Oct 2013 18:20:08 GMT] [error] [<0.1119.0>] OS Process Error <0.179.0>
:: {<<"ReferenceError">>,{[]}}
[Tue, 15 Oct 2013 18:20:08 GMT] [info] [<0.1119.0>] 127.0.0.1 - - GET
/database/_changes?filter=tmp/test 500
[Tue, 15 Oct 2013 18:20:08 GMT] [error] [<0.1119.0>] httpd 500 error response:
{"error":"ReferenceError","reason":"{[]}"}
{code}
[testing in CouchDB 1.3.0, sorry if this is fixed but I'm not seeing anything
relevant in the changelogs]
--
This message was sent by Atlassian JIRA
(v6.1#6144)