CouchbaseLiteException{CouchbaseLite, 10403: rejected by validation function}

I am curious to know what causes the above. I see in my log.

payment_0b68e04f-0332-48d2-bf42-f791424566a4 CouchbaseLiteException{CouchbaseLite, 10403: rejected by validation function
payment_0b68e04f-0332-48d2-bf42-f791424566a4 CouchbaseLiteException{CouchbaseLite, 10403: rejected by validation function

I see the above log

for (replicatedDocument in replication.documents) {
            if (replicatedDocument.error != null) {
                Log.i("error", "${replicatedDocument.id} ${replicatedDocument.error}")
            } 

not sure why I see two log messages for the same document. So the use case is as follows: I create my documents offline and be online. Out of 10 for e.g. 8 would go through but I would see the above for some documents but eventually they also find their way into my database.

I have no validation function (unless there is a default one that I am missing) and the document structure is the same.

Is there something I can learn exactly what the validation is failing? Then I assume a retry is processing the initially rejected document (?) but does it go through the same process again? I mean, would I see that same document come back to replication.documents loop?

Is this on push or on pull that you are receiving this error? I’m assuming that this is replicating with sync gateway. Have you checked any sync gateway sync functions as well?

It’s probably referring to rejection by the sync function in Sync Gateway / App Services. Check the server-side logs, and review the sync function for bugs.