couchbase-lite-ios: Continous replication sockets are being closed by Cloudant, in Couchbase 1.3.1 this stops replication

We recently changed our Cloudant server to their CouchDB 2.0 compliant version. Soon after we did that, we noticed that our Couchbase Lite (version 1.2.1) connections were being closed, producing errors like the following:

11:53:04.148‖ Sync: CBLRestPuller[https://couchClient:*****@browzine.cloudant.com:443/user-78961360-a3dd-11e6-98fc-f1733aeecc7a] Progress: 1540 / 1540
11:53:04.148‖ Sync: CBLRestPuller[https://couchClient:*****@browzine.cloudant.com:443/user-78961360-a3dd-11e6-98fc-f1733aeecc7a] Progress: set active = 0
11:53:04.148‖ Sync: CBLReplication[from https://couchClient:*****@browzine.cloudant.com:443/user-78961360-a3dd-11e6-98fc-f1733aeecc7a]: idle, progress = 1540 / 1540, err: (null)
11:53:04.148‖ WARNING: Truncated changes feed
11:53:04.148‖ WARNING: CBLSocketChangeTracker[0x79770500 user-78961360-a3dd-11e6-98fc-f1733aeecc7a]: Longpoll connection closed (by proxy?) after 0.2 sec
11:53:04.149‖ CBLSocketChangeTracker[0x79770500 user-78961360-a3dd-11e6-98fc-f1733aeecc7a]: Connection error #1, retrying in 2.0 sec: The operation couldn’t be completed. (NSURLErrorDomain error -1005.)

While this is disturbing and causing lots of extraneous sockets to be created, the replications were still eventually completing. However, when I tried upgrading to Couchbase Lite 1.3.1, I got the following errors:

09:27:30.292‖ CBLSocketChangeTracker[0x7f983c851320 user-ba87dac0-93d9-11e5-8034-13ab30f4e1cb]: Connection error #1, retrying in 2.0 sec: CBLHTTP[500, "internal server error", <https://couchClient:*****@browzine.cloudant.com:443/user-ba87dac0-93d9-11e5-8034-13ab30f4e1cb/_changes?feed=normal&heartbeat=300000&style=all_docs&active_only=true&filter=replicationFilters/get_everything_but_deleted>]
09:27:30.333‖ CBLSocketChangeTracker[0x7f983cb96a90 user-ba87dac0-93d9-11e5-8034-13ab30f4e1cb]: Connection error #1, retrying in 2.0 sec: CBLHTTP[500, "internal server error", <https://couchClient:*****@browzine.cloudant.com:443/user-ba87dac0-93d9-11e5-8034-13ab30f4e1cb/_changes?feed=normal&heartbeat=300000&style=all_docs&active_only=true&filter=replicationFilters/get_bookshelf>]

With this version, replication stopped and the data did not get transferred. I have a trouble ticket open with Cloudant, I’ll post any relevant comments they have about this here. The fact that the newer version of Couchbase is completely unable to get data from Cloudant is worrisome, especially since I had hoped to upgrade to it soon. Let me know if there is any information I can pass on to Cloudant to get this resolved.

Also let me know if you need a database that you have permission to replicate with, I can get one set up.


  • Version: 1.2.1 and 1.3.1
  • Client OS: iOS 9 and 10
  • Server: Cloudant (DBCore build 5638)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 24 (11 by maintainers)

Most upvoted comments

From your 1st post, with 1.3.1, Cloudant returns 500 error, while 1.2.1 returns something different.

I would guess, it could be because of the following change to fix CouchDB compatibility as it seems to be the only diff between 1.2.1 and 1.3.1 change tracker: https://github.com/couchbase/couchbase-lite-ios/blob/master/Source/ChangeTracker/CBLChangeTracker.m#L100-L103

As Cloudant is releasing a fix for POST _changes requests, I will close the ticket. Please let us know if you have any other updates.