-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replication stops after hitting 400 Invalid attachment error #864
Comments
Could you show the metadata ("_"-prefixed properties) of the design doc that causes the error? You can use a pull replication filter to skip design docs. The filter needs to be installed on the remote server (CouchDB), then you set its name as the |
Here's the doc - https://friendpaste.com/4gpK3xqGU811nQDfW4Sptf (err.. they have JS files in them). This one is another doc: And, I'll use filter to skip design docs; thank you. |
I used filter to skip design documents. Now, there are no warnings on versions older than 1.1.1, replication works smoothly. However, CBL 1.1.1 still stops replication with same 400 Invalid attachment error; with a different documents(not design docs) this time. The documents have following meta data- |
@ajithrnayak, |
Thanks for letting us know. Also the new 1.1.1 build is ready if you are interested in. http://latestbuilds.hq.couchbase.com/couchbase-lite-ios/release/1.1.1/ios/1.1.1-6 |
@pasin I'm still seeing this issue. Scenario goes like:
After this pull doesn't works for subsequent changes and push works fine. I'm using : couchbase-lite-ios/release/1.1.1/ios/1.1.1-11 (enterprise)
|
@ajithrnayak could you please post the complete JSON document? I'm opening the issue so that this will not get missed in the next sprint. |
The document itself looks fine to me. Was the document deleted before the app went to background? |
Also are there any warning messages shown on the log? They might give us some clues. |
This is the log on launching app. I checked documents and they look fine (same as above).
|
No, it was not deleted. |
I couldn't reproduce the issue with the same revision and attachment structure as you have posted (If I understand correctly that is the document from the Sync-Gateway). To be sure that I really have the same structure, I would need to see the JSON document that has the issue on both sides ([1] the device that tried to pull the document side and [2] the sync-gateway side). Could you help me on this? To get the document on the device side, you could just do the followings:
|
@pasin No, replication happens with CouchDB. Here's the device side document - https://friendpaste.com/BmMcxVtbgZnRmlkKI2dXs |
Look like digests are different (SHA1 and MD5). Not sue if we have the code to handle this case. Will need to look into the detail. |
Is different digest a problem? It doesn't fails always; all the other documents (those that sync without a problem) also have different digest. |
Just checked the code and there is no digest check for this case (stub = true). I'm confused with the revision id. On device, it has |
Ah! I apologies. Just reproduced issue and here's the document: rev-1 on CouchDB: https://friendpaste.com/BmMcxVtbgZnRmlkKIjU2B And, why would I get "400 Invalid attachment" error? |
@pasin & @snej We are up for a release, but held by this issue. I'm trying to provide more info on this. Enabled logging for above mentioned scenario and logs(after app is launched again) are here https://friendpaste.com/2BayCv2bZVFNu4XO2qsUUB You could notice sync hitting error and stopping replication logs from line number 784 to 793. I've quoted the same below.
|
I haven't had a chance to test it with CouchDB yet. I will try to reproduce the issue with CouchDB today. Will let you know. |
Yes, I could reproduce the issue with CouchDB. Local:
CouchDB:
Local Pull replication (GET db/doc?rev....) response:
|
Alright, glad to hear that. Thank you, @pasin. I can make a build myself from master. But, is this going to be included in v.1.1.1 anytime soon? |
I see a20e014 (i,e #802) already on v.1.1.1 list of fixes. |
The fix list is compiled from the issues that are tagged with 1.1.1. It was supposed to go in to v1.1.1 based on the tag but we missed that commits when cherry-picking the fixes. I'm checking now if it's still possible to go into 1.1.1 or it's too late. |
I couldn't reproduce this on a build from master branch. Cheers! |
We have just included those fixes in 1.1.1 release. You can download the latest build from here. You may want to try it out. In the current master branch, we have changed the database file directory layout. It will automatically upgrade from the old structure to the new structure. However 1.1.1 version will not be able to recognize that new structure. This means that switching back from master to 1.1.1 binary may require you to delete your development app first so the 1.1.1 database can be regenerated. Thanks a lot for reporting this, otherwise we may miss this fix in 1.1.1 release. |
Integrated Couchbase-lite 1.1.1 enterprise edition from Index of /couchbase-lite-ios/release/1.1.1/ios/1.1.1-5. And, pull replication with CouchDB stops after replication error hits 400 Invalid attachment.
Earlier versions of CBL were logging a warning as
‖ WARNING: Oops, server is trying to send a compressed attachment, I can't do that yet 18:31:25.548‖ WARNING: CBLMultipartDocumentReader[_id="_design/app"]: received unparseable MIME multipart response: Stopped
Looking at the document IDs, these are _design documents with attachments that are not needed for Mobile device; only Web platform uses it. So, is there a way to skip _design documents from replication? Or, may be, skip document replication by default when invalid attachment is found?
The text was updated successfully, but these errors were encountered: