Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

If you make BigCouch angry it stops speaking valid http (problem with error handling) #125

Open
kowalski opened this issue Feb 5, 2013 · 1 comment

Comments

@kowalski
Copy link

kowalski commented Feb 5, 2013

I run into this problem, after I have rebuild the 'make dev' and forgto to configure the view server for python. When I query the view I get 500 response, which is perfectly fine. The problem is that BigCouch doesn't stop at responding to this request one it sends more responses, which confuses the http client.

Here is the dump of the http channel I did the ilegal stuff:

< GET /testqueryingviews/_design/feat/_view/some_view?reduce=false HTTP/1.1
< Host: localhost
< Accept: application/json
< 
> HTTP/1.1 500 Internal Server Error
> X-Couch-Request-ID: 0635d75f
> Server: CouchDB/1.1.1 (Erlang OTP/R14B04)
> Date: Tue, 05 Feb 2013 11:48:25 GMT
> Content-Type: application/json
> Content-Length: 53
> Cache-Control: must-revalidate
> 
> {"error":"unknown_query_language","reason":"python"}
HTTP/1.1 500 Internal Server Error
X-Couch-Request-ID: 0635d75f
Server: CouchDB/1.1.1 (Erlang OTP/R14B04)
Date: Tue, 05 Feb 2013 11:48:25 GMT
Content-Type: application/json
Content-Length: 170
Cache-Control: must-revalidate

{"error":"function_clause","reason":null,"stack":["chttpd:end_delayed_json_response/1","chttpd:handle_request/1","mochiweb_http:headers/5","proc_lib:init_p_do_apply/3"]}
> HTTP/1.1 500 Internal Server Error

The part from where the first response body begins until the end of second reply seems to be delivered in one tcp packet. After that, bigcouch starts to send the third 500 response, at which point my http client is dazed and confused and disconnects.

I attach the full dump of my test to this report, just in case the previous requests are important to reproduce it.
This issue has been discovered at revision 73f530a which is the tip of master atm.

EDIT: you can't actually attach text files of github. Thats odd... Here is the full dump of my test: http://pastebin.com/u2ggBT6Y

EDIT2: This is the output of on big couch console: http://pastebin.com/7M3yLJVm

@kocolosk
Copy link
Contributor

kocolosk commented Feb 5, 2013

Thanks for the report! The error reporting for chunked responses has proven finicky -- this is not the first time I've seen a report of a multi-valued HTTP response to a view request. We'll track it down.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants