Re: CouchDB 1.6.1 returning empty reply

2018-02-08 Thread Raja
Got it working by modifying mochiweb_http.erl. For some reason, the recbuf was not setup in the socket options when receiving the request. I had it setup in local.ini and thought it would be propagated, but in mochiweb_http.erl's request(Socket,Body) method, it is setting up the socketoptions like

Re: CouchDB 1.6.1 returning empty reply

2018-02-07 Thread Raja
Hi Nick We have those headers setup for nginx and haproxy uses tune.maxrewrite and tune.bufsize. Both of them have been setup to be 32k. Also, to ensure that the problem is not with nginx or haproxy, I setup netcat on the box listening on port 5984 and proxied to it, which worked just fine. So it

Re: CouchDB 1.6.1 returning empty reply

2018-02-07 Thread Nick Vatamaniuc
Hi Raja, It seems that nginx or haproxy has limits on request line lengths. Take a look at: http://nginx.org/en/docs/http/ngx_http_core_module.html#client_header_buffer_size and http://nginx.org/en/docs/http/ngx_http_core_module.html#client_header_buffer_size for nginx. Not sure which settings ap

Re: CouchDB 1.6.1 returning empty reply

2018-02-07 Thread Raja
Thanks Nick. I did try setting recbuf earlier, but dint get much luck. This is what I had: socket_options = [{recbuf,64000},{nodelay,true}] I set the same in the [replicator] section as well to see if _changes would pickup the values in [replicator] section. This is how the [replicator] socket_op

Re: CouchDB 1.6.1 returning empty reply

2018-02-07 Thread Nick Vatamaniuc
Hi Raja, This sounds like this issue: https://issues.apache.org/jira/browse/COUCHDB-3293 It stems from a bug in http parser http://erlang.org/pipermail/erlang-questions/2011-June/059567.html and perhaps mochiweb not knowing how to handle a "message too large error". One way to work around it is