CBL 1.3.1 on macOS fails to return 600 documents


(I would have added this as a issue in Github, but didn’t know which project this would belong to)

Running CBL 1.3.1 (build 6) REST API on macOS 10.12.1. Running LiteServ with default settings. Testing with curl 7.49.1.

If I add about 600 documents (bit over 800kb) I am unable to retrieve them all at once. CBL returns part of the result and the result contains about 770-800kb, so it is not failing at some specific point.

Steps to reproduce:

curl -vX PUT http://cbl/testdb1
curl -vX POST http://cbl/testdb1/_bulk_docs -d @data600.json --header "Content-Type: application/json"
curl -vX GET "http://cbl/testdb1/_all_docs?include_docs=true" --header "Content-Type: application/json"

data600.json contains about 600 documents and is about 800kb.

curl outputs truncated result and:

* transfer closed with outstanding read data remaining
* Closing connection 0
curl: (18) transfer closed with outstanding read data remaining

All documents seem to be stored, since the keys can be retreived with:

curl -vX GET "http://cbl/testdb1/_all_docs" --header "Content-Type: application/json"


{"offset":0,"rows":[ ... ],"total_rows":603}

The issue can be reproduced also with the same GET request from Chrome and Firefox.

Testing with about 500 of the same documents has no issues.

I am using CBL on macOS for development/testing for Android/iOS version, Android/iOS do not have this issue.

So it’s the GET that fails? Does Couchbase Lite log anything?

Well, that was completely the fault of my own setup.

Due to reasons, I have a nginx proxy in front of the CBL REST API, which seems to be causing that issue. Didn’t think to try send the requests directly to CBL yesterday…