{"action":"created","issue":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/961","labels_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/961/labels{/name}","comments_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/961/comments","events_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/961/events","html_url":"https://github.com/couchbase/couchbase-lite-ios/issues/961","id":113484279,"number":961,"title":"400 Invalid Attachment Warning / Error in Pull Replication","user":{"login":"davidquon","id":1626593,"avatar_url":"https://avatars.githubusercontent.com/u/1626593?v=3","gravatar_id":"","url":"https://api.github.com/users/davidquon","html_url":"https://github.com/davidquon","followers_url":"https://api.github.com/users/davidquon/followers","following_url":"https://api.github.com/users/davidquon/following{/other_user}","gists_url":"https://api.github.com/users/davidquon/gists{/gist_id}","starred_url":"https://api.github.com/users/davidquon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidquon/subscriptions","organizations_url":"https://api.github.com/users/davidquon/orgs","repos_url":"https://api.github.com/users/davidquon/repos","events_url":"https://api.github.com/users/davidquon/events{/privacy}","received_events_url":"https://api.github.com/users/davidquon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-27T01:16:26Z","updated_at":"2015-10-29T22:28:24Z","closed_at":null,"body":"We were previously using iOS CBL `1.0.3.1` and recently upgraded to iOS CBL `1.1.1`.  Now with certain documents with attachments we started seeing errors like this which stop the replication.\r\n\r\n```\r\n2015-10-24 11:21:20.188 AppName[6574:1993505] WARNING: CBL_Puller[https://username:*****@hostname:6984/database] failed to write {namespace/doc_id #198-b707c081c57791deb57a366aee25c141}: status=491\r\n2015-10-24 11:21:20.189 AppName[6574:1993505] Sync: CBL_Puller[https://username:*****@hostname:6984/database] Progress: set error = 400 Invalid attachment\r\n2015-10-24 11:21:20.190 AppName[6574:1993505] Sync: CBL_Puller[https://username:*****@hostname:6984/database] STOPPING...\r\n```\r\n\r\nWe are running CouchDB version `1.6.1` for our couch server.  I'm reproducing this problem with a completely new CBL database each time.\r\n\r\nNow if you query the CouchDB for `namespace/doc_id` I get:\r\n```\r\n\"_id\":\"namespace/doc_id\",\"_rev\":\"366-8fc5ffd358688535b06788b5872793bc”,\r\n```\r\n\r\nIf I query CouchDB for `namespace/doc_id` with `?revs_info=true` I get back only 10 revisions as it was configured.\r\n\r\nSo why is CBL complaining about problems with `kCBLStatusBadAttachment` for revisions like 75-100 revisions prior to the latest?  Also when using CBL `1.0.3.1` with the same exact database this issue doesn't occur and everything replicates as expected.  Any suggestions of how to solve this problem would be greatly appreciated as so far none of the workarounds I've tried have yielded a solution.  Thanks.\r\n\r\nThis issue was created off the Google group discussion.\r\nhttps://groups.google.com/forum/#!topic/mobile-couchbase/MHrzXr1aWxw"},"comment":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/comments/152345710","html_url":"https://github.com/couchbase/couchbase-lite-ios/issues/961#issuecomment-152345710","issue_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/961","id":152345710,"user":{"login":"davidquon","id":1626593,"avatar_url":"https://avatars.githubusercontent.com/u/1626593?v=3","gravatar_id":"","url":"https://api.github.com/users/davidquon","html_url":"https://github.com/davidquon","followers_url":"https://api.github.com/users/davidquon/followers","following_url":"https://api.github.com/users/davidquon/following{/other_user}","gists_url":"https://api.github.com/users/davidquon/gists{/gist_id}","starred_url":"https://api.github.com/users/davidquon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidquon/subscriptions","organizations_url":"https://api.github.com/users/davidquon/orgs","repos_url":"https://api.github.com/users/davidquon/repos","events_url":"https://api.github.com/users/davidquon/events{/privacy}","received_events_url":"https://api.github.com/users/davidquon/received_events","type":"User","site_admin":false},"created_at":"2015-10-29T22:28:24Z","updated_at":"2015-10-29T22:28:24Z","body":"Hi Jens.  Since this is unfortunately a live database, I emailed you an NDA.  Let me know if you didn't get it or have any questions.  I'll zip up a copy of the pre-upgrade database for you.  We can also try to setup a database for you to replicate from using CBL `1.1.1` unless you think what you find with the pre-upgrade DB is the same root cause as in the replicator.  Thanks for your help."}}