Metadata error when updating attachments with a file already used previously

Couchbase Server 6.5
Couchbase Lite Android 2.7.0
Sync Gateway 2.7.2

Good morning all,
I use Couchbase mobile with sync gateway and I notice something strange …

If I add / update a blob attachment everything is fine but if I update this attachment with a file that has already been added previously the metadata are not updated !

Do you have any info on this bug?

If the problem comes from revisions, I just need the last synchronized change to be used. Do you think that disabling confli resolution and going to 1 revision can help me?
“allow_conflicts”: false,
“revs_limit”: 1

Sorry for my English

Please show the API calls or HTTP requests you’re using.

Hi Jens,

I have a little more info :
I think it is the limit of 20Mb per document because I can put images and at a moment only the small images synchronize more nothing. It would seem that the weight of the previous image remains on the document while it has been changed

Maybe update tickets with this new info:

To answer your question, here is my code (I don’t think it will help you because it is sync side that it messes up):

Set = new com.couchbase.lite.Database(name, this.config);
const document =;
const nativeBlob = new com.couchbase.lite.Blob(mimeType, new;
document.setBlob(name, nativeBlob);


let document = as com.couchbase.lite.Document;
if (!document) return null;
const blob = document.getBlob(name);
if (!blob) return null;
new Blob(blob);

And my config:

  "adminInterface": "",
  "interface": "",
  "log": ["*"],
  "databases": {
    "smart-totem": {
      "server": "http://***:8091",
      "bucket": "***",
      "username": "***",
      "password": "***",
      "enable_shared_bucket_access": true,
      "import_docs": true,
      "num_index_replicas": 0,
      "users": {
        "GUEST": { "disabled": true}
      "sync": `function (doc, oldDoc) {

Blobs are not stored inside the document. They don’t add to the size of the document; each blob has its own 20MB limit.

Does this problem occur on the client side, or on the server?

Could you please describe in detail what you’re doing, and what unexpected results you get?

On the client side there is no problem, I update the blobs to infinity without problem, during the sync with the server the pull goes well and the good blob data is sent

It is on the server where after many update the metadata no longer updated for the blob (attachment) and therefore the push to the clients have the old blob…

This does sound like CBG-789. Any ideas, @bbrks?

I’ve not had chance to repro and debug the issue yet, but I’ll update this post if I find something.