Mobile device syncing issues

Hello,

We use CE Couchbase Server 6.6 and Couchbase Lite 2.8 and 3.0 for a mobile Android and iOS application with continuous replication. The syncing works fine in general, but in some instances, we see issues where documents will not sync until we delete the mobile app, which deletes the CBL database and runs a full sync.

Our CB documents have a key called “channel” which filters the data. Each mobile device has a unique channel ID in it.

"databases": {
    "appdb":
              {
            "server": "http://xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx:8091",
            "bucket": "appdb",
            "bucket_op_timeout_ms": 5000,
            "username": "appdbadmin",
            "password": "xxxxxxxxxxx",
            "enable_shared_bucket_access": true,
            "use_views":false,
            "num_index_replicas": 0,
            "allow_conflicts": false,
            "revs_limit": 20,
            "import_docs": "continuous",
      "users": {
         "admin" : {"password" : "xxxxxxxxxxx", "admin_channels": ["0", "100"] }
      },
                "cache": {
                        "channel_cache_max_length": 250000,
                "rev_cache": {
                        "size": 80000
                }
                },
"sync": `function (doc, oldDoc) {
                if (doc.channel) {
                    channel(doc.channel);
                }
            }`
    }
  }

We have tried SGW 2.8 and 3.0 (“disable_persistent_config”: true) but seeing the same results. The behavior seems the same for both Android and iOS devices.

In the SGW logs, we are noticing a number of errors related to the version of the document. See below:

2022-03-19T22:21:17.116Z [INF] SyncMsg: c:[11214afc] MSG#1105~: norev for doc "<ud>user:26CBE069-9A8D-4698-B649-8D86F0C66103</ud>" / "61-283c00bdf25e8c771385c002ee1968f80e4cf17b" - error: "410" - reason: ""

I am not sure what this error means and if this may be a potential cause of the issue. Any thoughts or suggestions that may lead us towards finding the root cause of this issue?

-RJ

Hi,

A norev message is not an error. It just means that the requested revision of that document doesn’t exist. Here is the definition of it: couchbase-lite-core/replication-protocol.adoc at master · couchbase/couchbase-lite-core · GitHub

It would be clearer whether the sync issue you are facing is related to that nonrev message or not if you could provide the CBL logs and SG logs when the documents are not replicated. We can also be more helpful if there are steps to reproduce the issue.

Thank you! We dont have CBL logs yet but attached is the SGW log. It seems like syncing stops and until you delete the local database (CBL) and initiate a new instance of replicator, the synching doesn’t start.

sg_info.log.zip (6.7 MB)