You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Egbert Teeselink (JIRA)" <ji...@apache.org> on 2011/04/07 10:42:05 UTC
[jira] [Created] (COUCHDB-1122) javascript error in list function
causes "curl: (56) Received problem 2 in the chunky parser"
javascript error in list function causes "curl: (56) Received problem 2 in the chunky parser"
---------------------------------------------------------------------------------------------
Key: COUCHDB-1122
URL: https://issues.apache.org/jira/browse/COUCHDB-1122
Project: CouchDB
Issue Type: Bug
Components: HTTP Interface
Affects Versions: 1.0.2
Environment: MS Windows 7 64-bit, running CouchDB 1.0.2 from the unofficial binary installer mentioned on http://wiki.apache.org/couchdb/Windows_binary_installer
Reporter: Egbert Teeselink
I get the behaviour that in some cases, if after doing all getRow()s in a list function a javascript error occurs, this is not nicely reported but instead the connection appears to somehow break. Curl reports a " (56) Received problem 2 in the chunky parser".
I've tried to minimize the problem, so I made an empty database, with only the following design document:
{
"_id":"_design/bug",
"_rev":"9-9eb0a83e4e22be8c914cec3432d6c6cf",
"views":{
"empty":{
"map":"function(doc) {\r\n\r\n};"
}
},
"lists":{
"test":"function(head, req) { \r\n // comment the line below to get a normal JS error:\r\n while(getRow()) {}\r\n send(moo);\r\n}"
},
"couchapp":{
"signatures":{
},
"objects":{
},
"manifest":[
"lists/",
"lists/test.js",
"views/",
"views/empty/",
"views/empty/map.js"
]
}
}
For readability, here's the list function in non-escaped form:
function(head, req) {
// comment the line below to get a normal JS error:
while(getRow()) {}
send(moo);
}
'send(moo)' causes the error, because there's no variable called 'moo'.
The following curl call causes the above-mentioned error:
curl -v http://localhost:5984/test/_design/bug/_list/test/empty?reduce=false -u:myusername:mypassword
I doubt it's related, but myusername is stored under the [admins] section, i don't have database-level security.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (COUCHDB-1122) javascript error in list function
causes "curl: (56) Received problem 2 in the chunky parser"
Posted by "Dave Cottlehuber (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-1122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017225#comment-13017225 ]
Dave Cottlehuber commented on COUCHDB-1122:
-------------------------------------------
This is not windows specific, occurs on other platforms (MacOSX tested), and is
consistent with expected behaviour. But JavaScript errors are only visible in
the log (see below) & discussion on IRC is for improving this.
Discussion on policy (do we support broken views or not) & options moved to dev@ list.
[2011/04/07 -:- 11:11:24 PM] <+rnewson> the performance impact of errors being thrown is huge, especially in a multi-tenant situation, and it leads to broken results for the user, who has absolutely no idea *why*.
[2011/04/07 -:- 11:11:59 PM] <dch> so you think we can improve on the current implementation somehow?
[2011/04/07 -:- 11:12:35 PM] <+rnewson> we should be able to include an indication that an error occured, yes. we do know, after all.
[2011/04/07 -:- 11:12:50 PM] <+rnewson> the question is the form of the API, as usual.
[2011/04/07 -:- 11:13:23 PM] <dch> i.e. be more vocal on errors returned from couchjs, and somehow pass that back to the enduser in a way that doesn't screw up potentially valid intermediate data
[2011/04/07 -:- 11:13:59 PM] <+rnewson> hm, this is the question. Do we support map/reduce views that barf on some documents or should we consider them broken?
[2011/04/07 -:- 11:14:32 PM] <+rnewson> the minimum is to give direct feedback that there are errors in a way that doesn't need access to the log. so, basically,it needs to be in the response body.
[2011/04/07 -:- 11:14:51 PM] <dch> be lenient in what you accept and strict in what you emit... they're broken and we should say so.
[2011/04/07 -:- 11:15:12 PM] <+rnewson> right. that's the minimum.
=========== LOGS ==========
[Thu, 07 Apr 2011 11:03:57 GMT] [info] [<0.4939.11>] 192.168.1.76 - - 'GET' /testy/_design/bug/_list/test/empty 500
[Thu, 07 Apr 2011 11:03:57 GMT] [debug] [<0.4939.11>] httpd 500 error response:
{"error":"render_error","reason":"function raised error: (new ReferenceError(\"moo is not defined\", \"\", 3))
stacktrace: ([object Object],[object Object])@:3
runList(function (head, req) {while (getRow()) {}send(moo);},[object Object],[object Array])@share/couchdb/server/main.js:951
(function (head, req) {while (getRow()) {}send(moo);},[object Object],[object Array])@share/couchdb/server/main.js:996
(\"_design/bug\",[object Array],[object Array])@share/couchdb/server/main.js:1414
()@share/couchdb/server/main.js:1456\n@share/couchdb/server/main.js:1467\n"}
> javascript error in list function causes "curl: (56) Received problem 2 in the chunky parser"
> ---------------------------------------------------------------------------------------------
>
> Key: COUCHDB-1122
> URL: https://issues.apache.org/jira/browse/COUCHDB-1122
> Project: CouchDB
> Issue Type: Bug
> Components: HTTP Interface
> Affects Versions: 1.0.2
> Environment: MS Windows 7 64-bit, running CouchDB 1.0.2 from the unofficial binary installer mentioned on http://wiki.apache.org/couchdb/Windows_binary_installer
> Reporter: Egbert Teeselink
> Labels: couchapp, curl, list_function
>
> I get the behaviour that in some cases, if after doing all getRow()s in a list function a javascript error occurs, this is not nicely reported but instead the connection appears to somehow break. Curl reports a " (56) Received problem 2 in the chunky parser".
> I've tried to minimize the problem, so I made an empty database, with only the following design document:
> {
> "_id":"_design/bug",
> "_rev":"9-9eb0a83e4e22be8c914cec3432d6c6cf",
> "views":{
> "empty":{
> "map":"function(doc) {\r\n\r\n};"
> }
> },
> "lists":{
> "test":"function(head, req) { \r\n // comment the line below to get a normal JS error:\r\n while(getRow()) {}\r\n send(moo);\r\n}"
> },
> "couchapp":{
> "signatures":{
> },
> "objects":{
> },
> "manifest":[
> "lists/",
> "lists/test.js",
> "views/",
> "views/empty/",
> "views/empty/map.js"
> ]
> }
> }
> For readability, here's the list function in non-escaped form:
> function(head, req) {
> // comment the line below to get a normal JS error:
> while(getRow()) {}
> send(moo);
> }
> 'send(moo)' causes the error, because there's no variable called 'moo'.
> The following curl call causes the above-mentioned error:
> curl -v http://localhost:5984/test/_design/bug/_list/test/empty?reduce=false -u:myusername:mypassword
> I doubt it's related, but myusername is stored under the [admins] section, i don't have database-level security.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira