couchbase-lite-ios: Push replication stops with error `400 bad_request`

I have an issue where the the push replicator stops after receiving this error

Error Domain=CBLHTTP Code=400 "400 bad_request" UserInfo={NSURL=http://xxx:4984/xxx/contact%3AE0294D55-EB14-4C71-8100-98B71E772C01?new_edits=false, NSLocalizedFailureReason=bad_request, NSLocalizedDescription=400 bad_request}

When i tried to get that document, i didn’t find it. I noticed also that after terminating and reopening again, the replicator pushes some changes and stops again. I tried disabling ForestDB but that didn’t solve the problem.

I have enabled logging SyncVerbose, RemoteRequest and attached the logs sync_logs.txt


  • Version: CBL 1.2
  • Client OS: iOS 9.3.1
  • Server: 3.0.1 Community Edition
  • Syncgateway: 1.2

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 79 (61 by maintainers)

Commits related to this issue

Most upvoted comments

I think this is a Cloudant MIME parsing bug. The request looks fine to me, and neither Sync Gateway nor CouchDB 1.6 have trouble with it. I’ve attached the body as mime.txt, and you can send the request with: curl -X PUT -H 'Content-Type: multipart/related; boundary="2D0DAB20-BE70-4161-8A3E-CBF31CB525E6"' --data-binary @mime.txt 'http://snej.cloudant.com/attachment-test/mydoc-485135379?new_edits=false'

I’ve verified that each of the 3 parts is exactly the length stated in its Content-Type header (551, 3072 and 9216 bytes) and that the length properties of the attachments in the JSON match.