CouchbaseLiteException: CouchbaseLite,10, properties excessively large

I am using couchbase-lite-android:2.6.0, sync-gateway: 2.6, couchbase-server 6.0.0. I see this error very often in my Android App.
Error message: CouchbaseLiteException{CouchbaseLite,10,‘properties excessively large’}
What does the error exactly mean here? Is that document I am creating is large?
I am not modifying the document more than 20 times as mentioned in the thread Threw C++ exception: properties excessively large

I see this error very often and it gets resolved automatically when I kill and restart the app.

“Properties” here doesn’t refer to your documents; it’s about messages in the replicator protocol. The error means that a replication message had more than 64KB of metadata. In the thread you linked to, this happened because the revision history — a list of all the ancestor revision IDs — grew extremely long. (This was fixed in 2.7.)

Is an exception being logged? Can you post the logs at the time the error occurs?

This is all I am getting in logcat.

2019-10-24 10:45:21.985 16645-16645/ I/GSDBSyncHandler: Error while syncing data. Sync change error: CouchbaseLiteException{CouchbaseLite,10,‘properties excessively large’}
2019-10-24 10:45:21.986 16645-16645/ W/System.err: java.lang.Exception: Sync change error: CouchbaseLiteException{CouchbaseLite,10,‘properties excessively large’}
2019-10-24 10:45:21.986 16645-16645/ W/System.err: at mypackage.data.db.GSDatabase.lambda$addReplicatorStatusChangeListener$1(GSDatabase.java:164)
2019-10-24 10:45:21.986 16645-16645/ W/System.err: at mypackage.data.db.-$$Lambda$GSDatabase$1dQ-XrB7SDKXQ2ncQJ_55KcqDGs.changed(Unknown Source:2)
2019-10-24 10:45:21.986 16645-16645/ W/System.err: at com.couchbase.lite.ReplicatorChangeListenerToken.lambda$notify$0(ReplicatorChangeListenerToken.java:33)
2019-10-24 10:45:21.986 16645-16645/ W/System.err: at com.couchbase.lite.-$$Lambda$ReplicatorChangeListenerToken$qCZ8Gq_s8Z0hCUKjSADVc9EfrAI.run(Unknown Source:4)
2019-10-24 10:45:21.986 16645-16645/ W/System.err: at android.os.Handler.handleCallback(Handler.java:794)
2019-10-24 10:45:21.986 16645-16645/ W/System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
2019-10-24 10:45:21.986 16645-16645/ W/System.err: at android.os.Looper.loop(Looper.java:176)
2019-10-24 10:45:21.986 16645-16645/ W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6651)
2019-10-24 10:45:21.986 16645-16645/ W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2019-10-24 10:45:21.986 16645-16645/ W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
2019-10-24 10:45:21.986 16645-16645/ W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)

I guess 2.7 is not released for the public yet. When can we expect it to be released?
And what is the quick workaround that we we can adopt till 2.7 is released?

Assuming that the cause of the error is because of a long revision history because you are making a large number of changes to the document before it gets a chance to sync up, then you should probably try and coalesce some of the changes before saving.
Alternatively, if you don’t have many changes in a document, are you pushing a large number of documents as specified by docIds.
That said, I am not clear what the cause is based on the logs shared. Jens can provide more insights

And 2.7 is scheduled for early next year.

@prasadm please turn on more verbose sync logging.

How can I enable that?
I have already pasted logcat verbose logs.

Use the logging API

Database logger configuration:

    CouchbaseLite.init(context);
    final File path = context.getCacheDir();
    Database.log.getFile().setConfig(new LogFileConfiguration(path.toString()));
    Database.log.getFile().setLevel(LogLevel.VERBOSE);

Log:

2019-11-07 11:36:47.795 2449-2611/mypackage.classical.test E/CouchbaseLite/REPLICATOR: {N8litecore4repl6PullerE#735} Threw C++ exception: properties excessively large
2019-11-07 11:36:47.796 2449-2611/mypackage.classical.test W/CouchbaseLite/NETWORK: C4Socket.write() handle → 478532239744
2019-11-07 11:36:47.797 2449-2611/mypackage.classical.test W/CouchbaseLite/NETWORK: completedWrite(long) handle → 478532239744, byteCount → 68
2019-11-07 11:36:47.798 2449-2611/mypackage.classical.test W/CouchbaseLite/NETWORK: C4Socket.write() handle → 478532239744
2019-11-07 11:36:47.798 2449-2611/mypackage.classical.test W/CouchbaseLite/NETWORK: completedWrite(long) handle → 478532239744, byteCount → 32
2019-11-07 11:36:47.799 2449-2611/mypackage.classical.test E/CouchbaseLite/REPLICATOR: {Repl#732} Stopping due to fatal error: LiteCore error 10 “properties excessively large”
2019-11-07 11:36:47.801 2449-2616/mypackage.classical.test W/CouchbaseLite/NETWORK: C4Socket.requestClose() handle → 478532239744
2019-11-07 11:36:47.847 2449-2608/mypackage.classical.test W/CouchbaseLite/NETWORK: C4Socket.completedReceive() handle → 478532239744
2019-11-07 11:36:47.849 2449-2608/mypackage.classical.test W/CouchbaseLite/NETWORK: C4Socket.write() handle → 478532239744
2019-11-07 11:36:47.849 2449-2608/mypackage.classical.test E/CouchbaseLite/NETWORK: CBLWebSocket.send() FAILED to send data
2019-11-07 11:36:47.888 2449-2618/mypackage.classical.test W/CouchbaseLite/NETWORK: C4Socket.requestClose() handle → 478532239744
2019-11-07 11:36:47.889 2449-2618/mypackage.classical.test W/CouchbaseLite/NETWORK: CBLWebSocket.requestClose() Failed to attempt to initiate a graceful shutdown of this web socket.
2019-11-07 11:36:47.889 2449-2611/mypackage.classical.test W/CouchbaseLite/NETWORK: C4Socket.dispose() handle → 478532239744
2019-11-07 11:36:47.891 2449-2614/mypackage.classical.test E/CouchbaseLite/REPLICATOR: {Repl#732} Stopping due to fatal error: LiteCore error 10 “properties excessively large”
2019-11-07 11:36:47.935 2449-2449/mypackage.classical.test I/GSDatabase: sync status change error: Sync change error: CouchbaseLiteException{CouchbaseLite,10,‘properties excessively large’}
2019-11-07 11:36:47.935 2449-2449/mypackage.classical.test W/System.err: java.lang.Exception: Sync change error: CouchbaseLiteException{CouchbaseLite,10,‘properties excessively large’}
2019-11-07 11:36:47.935 2449-2449/mypackage.classical.test W/System.err: at mypackage.data.db.GSDatabase.lambda$addReplicatorStatusChangeListener$1(GSDatabase.java:170)
2019-11-07 11:36:47.935 2449-2449/mypackage.classical.test W/System.err: at mypackage.data.db.-$$Lambda$GSDatabase$1dQ-XrB7SDKXQ2ncQJ_55KcqDGs.changed(Unknown Source:2)
2019-11-07 11:36:47.935 2449-2449/mypackage.classical.test W/System.err: at com.couchbase.lite.ReplicatorChangeListenerToken.lambda$notify$0(ReplicatorChangeListenerToken.java:33)
2019-11-07 11:36:47.936 2449-2449/mypackage.classical.test W/System.err: at com.couchbase.lite.-$$Lambda$ReplicatorChangeListenerToken$qCZ8Gq_s8Z0hCUKjSADVc9EfrAI.run(Unknown Source:4)
2019-11-07 11:36:47.936 2449-2449/mypackage.classical.test W/System.err: at android.os.Handler.handleCallback(Handler.java:794)
2019-11-07 11:36:47.936 2449-2449/mypackage.classical.test W/System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
2019-11-07 11:36:47.936 2449-2449/mypackage.classical.test W/System.err: at android.os.Looper.loop(Looper.java:176)
2019-11-07 11:36:47.936 2449-2449/mypackage.classical.test W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6651)
2019-11-07 11:36:47.936 2449-2449/mypackage.classical.test W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2019-11-07 11:36:47.936 2449-2449/mypackage.classical.test W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
2019-11-07 11:36:47.936 2449-2449/mypackage.classical.test W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
2019-11-07 11:36:47.937 2449-2449/mypackage.classical.test I/GSUserDataManager: Sync error. Sync change error: CouchbaseLiteException{CouchbaseLite,10,‘properties excessively large’}
2019-11-07 11:36:47.937 2449-2449/mypackage.classical.test W/System.err: java.lang.Exception: Sync change error: CouchbaseLiteException{CouchbaseLite,10,‘properties excessively large’}
2019-11-07 11:36:47.937 2449-2449/mypackage.classical.test W/System.err: at mypackage.data.db.GSDatabase.lambda$addReplicatorStatusChangeListener$1(GSDatabase.java:170)
2019-11-07 11:36:47.937 2449-2449/mypackage.classical.test W/System.err: at mypackage.data.db.-$$Lambda$GSDatabase$1dQ-XrB7SDKXQ2ncQJ_55KcqDGs.changed(Unknown Source:2)
2019-11-07 11:36:47.937 2449-2449/mypackage.classical.test W/System.err: at com.couchbase.lite.ReplicatorChangeListenerToken.lambda$notify$0(ReplicatorChangeListenerToken.java:33)
2019-11-07 11:36:47.937 2449-2449/mypackage.classical.test W/System.err: at com.couchbase.lite.-$$Lambda$ReplicatorChangeListenerToken$qCZ8Gq_s8Z0hCUKjSADVc9EfrAI.run(Unknown Source:4)
2019-11-07 11:36:47.938 2449-2449/mypackage.classical.test W/System.err: at android.os.Handler.handleCallback(Handler.java:794)
2019-11-07 11:36:47.938 2449-2449/mypackage.classical.test W/System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
2019-11-07 11:36:47.938 2449-2449/mypackage.classical.test W/System.err: at android.os.Looper.loop(Looper.java:176)
2019-11-07 11:36:47.938 2449-2449/mypackage.classical.test W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6651)
2019-11-07 11:36:47.938 2449-2449/mypackage.classical.test W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2019-11-07 11:36:47.938 2449-2449/mypackage.classical.test W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
2019-11-07 11:36:47.938 2449-2449/mypackage.classical.test W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
2019-11-07 11:36:47.939 2449-2449/mypackage.classical.test I/GSDBSyncHandler: Error while syncing data. Sync change error: CouchbaseLiteException{CouchbaseLite,10,‘properties excessively large’}
2019-11-07 11:36:47.939 2449-2449/mypackage.classical.test W/System.err: java.lang.Exception: Sync change error: CouchbaseLiteException{CouchbaseLite,10,‘properties excessively large’}
2019-11-07 11:36:47.939 2449-2449/mypackage.classical.test W/System.err: at mypackage.data.db.GSDatabase.lambda$addReplicatorStatusChangeListener$1(GSDatabase.java:170)
2019-11-07 11:36:47.939 2449-2449/mypackage.classical.test W/System.err: at mypackage.data.db.-$$Lambda$GSDatabase$1dQ-XrB7SDKXQ2ncQJ_55KcqDGs.changed(Unknown Source:2)
2019-11-07 11:36:47.939 2449-2449/mypackage.classical.test W/System.err: at com.couchbase.lite.ReplicatorChangeListenerToken.lambda$notify$0(ReplicatorChangeListenerToken.java:33)
2019-11-07 11:36:47.939 2449-2449/mypackage.classical.test W/System.err: at com.couchbase.lite.-$$Lambda$ReplicatorChangeListenerToken$qCZ8Gq_s8Z0hCUKjSADVc9EfrAI.run(Unknown Source:4)
2019-11-07 11:36:47.939 2449-2449/mypackage.classical.test W/System.err: at android.os.Handler.handleCallback(Handler.java:794)
2019-11-07 11:36:47.940 2449-2449/mypackage.classical.test W/System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
2019-11-07 11:36:47.940 2449-2449/mypackage.classical.test W/System.err: at android.os.Looper.loop(Looper.java:176)
2019-11-07 11:36:47.940 2449-2449/mypackage.classical.test W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6651)
2019-11-07 11:36:47.940 2449-2449/mypackage.classical.test W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2019-11-07 11:36:47.940 2449-2449/mypackage.classical.test W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
2019-11-07 11:36:47.940 2449-2449/mypackage.classical.test W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)

What you did was enable file based logging and then pasted the console logs. If you want to take the logs from the console then you will need to adjust the level on Database.log.getConsole() not Database.log.getFile()

Log file is pretty large, so attaching it as google doc.

Thanks! (FYI, people usually use Gist to post big logs, as it’s more developer-friendly.)

Um, this doesn’t show anything before the “properties excessively large” error. That’s the important part, not what happens afterwards.

Sorry for that. Here is the detailed log.

Thanks. This is happening to the puller, right after it starts:

{N8litecore4repl6PullerE#731}==> N8litecore4repl6PullerE ->ws://mydomain.com:4984/mydb/_blipsync @0x6f6b1e1cc8
{N8litecore4repl6PullerE#731} Starting pull from remote seq 
{N8litecore4repl6PullerE#731} Threw C++ exception: properties excessively large

How is your replication configured? Are you pulling a specific set of documents?

Actually it looks like, if you have a huge list of channel names that total more than 64KB, you can get an error like this. Is that happening?

That’s correct!. There is a bug in our code where duplicate channels are getting added and the channels list is growing over time.
Fixed it now. Thank you.