couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Shorin (Created) (JIRA)" <>
Subject [jira] [Created] (COUCHDB-1395) Not well-formed JSON in changes feed filtered by view.
Date Thu, 26 Jan 2012 19:59:41 GMT
Not well-formed JSON in changes feed filtered by view.

                 Key: COUCHDB-1395
             Project: CouchDB
          Issue Type: Bug
    Affects Versions: 1.2, 1.3
         Environment: Apache CouchDB 1.3.0a-d59cdd7-git
Apache CouchDB 1.2.0a-0d8ddc8-git
            Reporter: Alexander Shorin
            Priority: Critical

CouchDB returns invalid JSON response for _changes feed if filter view have failed somehow:
by code mistake, bug, os timeout etc.

Steps to reproduce:
1. Create db and fill it with some documents.
2. Create buggy view that would make view server crush for some document. For javascript one
segfault and os timeout errors are actual due to any exceptions raised from map function is
silenced.  You view could be fine however for normal usage.
3.  Request changes feed and apply this buggy view as filter.

View function had never proceed design documents and mostly they are created with that knowledge.
But in changes feed they have to process every document in database and DDocs too, so they
breaks their original logic and creates unexpectable situation. Another side of problem is
about custom query servers that could prevent view processing on first occurred exception
or due dynamic code execution nature.
Certainly,  it's all about invalid view function that generates exception for some document
in some case, but should _changes feed return malformed data in this case or just notify about
problem somehow and emit valid parseable JSON?

Expected result:
Valid JSON response and some message about document processing error.

Actual result:
* About to connect() to localhost port 5984 (#0)
*   Trying connected
* Connected to localhost ( port 5984 (#0)
> GET /filtered_view_bug/_changes?filter=_view&view=bug/crush_on_ddoc HTTP/1.1
> User-Agent: curl/7.21.4 (x86_64-pc-linux-gnu) libcurl/7.21.4 GnuTLS/2.10.5 zlib/1.2.5
> Host: localhost:5984
> Accept: application/json
< HTTP/1.1 200 OK
< Transfer-Encoding: chunked
< Server: CouchDB/1.3.0a-d59cdd7-git (Erlang OTP/R14B04)
< Date: Thu, 26 Jan 2012 19:30:23 GMT
< Content-Type: application/json
< Cache-Control: must-revalidate
* Received problem 2 in the chunky parser
* Closing connection #0
curl: (56) Received problem 2 in the chunky parser

Last chunk arrives with "HTTP/1.1 500 Internal Server Error" instead of size value.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message