Integrating changesets failed: error finding the previous history size for version 80: client is disconnected (ProtocolErrorCode=101)

I just recently came across this in my release version (i.e. I can’t trace what was happening when the client device made the request) - the execution is in a cloud function

Error Log contents:


integrating changesets failed: error finding the previous history size for version 80: client is disconnected (ProtocolErrorCode=101)

Write originated from MongoDB

Write Summary:
  "_Following": {
    "inserted": [
  "_Request": {
    "updated": [

Following that error in the logs, there is this:


Ending session with error: integrating changesets failed: error finding the previous history size for version 80: client is disconnected (ProtocolErrorCode=101)

Ending sync session to MongoDB
  "Session was active for: 7h44m11s"

Session Metrics:
  "uploads": 1

The session was active for almost 8 hours, and both the logs say the “client is disconnected”. Can anyone shed any light on what this means? I still haven’t found a table of Protocol Error Codes to aid in diagnosing these errors when they happen.


Hi Eric,

It has been a while since you posted this, are you still experiencing the issue?

Was this a one-off error or has it happened consistently?

Have you made any changes to the app recently? (specifically schema changes)
If destructive schema changes were made for example, then you may need to terminate sync and re-enable if possible.



This has happened once so far. There have been no schema changes or app releases for ~20 days (at the time of the original post it had been 12 days since any deployments, which may not have included schema changes). I am familiar with the need to reset sync when making destructive schema changes.

Thank you for replying - now, is there a place to find information on the list of different ProtocolErrorCode values?

Hi Eric,

This is not documented at this time but I have included the list of error codes.

The reason for this is that the error codes are internal statuses that are more relevant for the MongoDB engineering team to investigate the server-side component of Realm Sync. If you have any issues with sync, it would be best to open a chat or ticket directly with the MongoDB Support team: Cloud: MongoDB Cloud.

Please know that the list below is subject to change and may not be consistent in the future.

ErrorCode = 100 // Connection closed (no error)
ErrorCode = 101 // Other connection level error
ErrorCode = 102 // Unknown type of input message
ErrorCode = 103 // Bad syntax in input message head
ErrorCode = 104 // Limits exceeded in input message
ErrorCode = 105 // Wrong protocol version (CLIENT) (obsolete)
ErrorCode = 106 // Bad session identifier in input message
ErrorCode = 107 // Overlapping reuse of session identifier (BIND)
ErrorCode = 108 // Client file bound in other session (IDENT)
ErrorCode = 109 // Bad input message order
ErrorCode = 110 // Error in decompression (UPLOAD)
ErrorCode = 111 // Bad syntax in a changeset header (UPLOAD)
ErrorCode = 112 // Bad size specified in changeset header (UPLOAD)
ErrorCode = 200 // Session closed (no error)
ErrorCode = 201 // Other session level error
ErrorCode = 202 // Access token expired
ErrorCode = 203 // Bad user authentication (BIND, REFRESH)
ErrorCode = 204 // Illegal Realm path (BIND)
ErrorCode = 205 // No such Realm (BIND)
ErrorCode = 206 // Permission denied (STATE_REQUEST, BIND, REFRESH)
ErrorCode = 207 // Bad server file identifier (IDENT) (obsolete!)
ErrorCode = 208 // Bad client file identifier (IDENT)
ErrorCode = 209 // Bad server version (IDENT, UPLOAD, TRANSACT)
ErrorCode = 210 // Bad client version (IDENT, UPLOAD)
ErrorCode = 211 // Diverging histories (IDENT)
ErrorCode = 212 // Bad changeset (UPLOAD)
ErrorCode = 213 // Superseded by new session for same client-side file (deprecated)
ErrorCode = 214 // Partial sync disabled (BIND, STATE_REQUEST)
ErrorCode = 215 // Unsupported session-level feature
ErrorCode = 216 // Bad origin file identifier (UPLOAD)
ErrorCode = 217 // Synchronization no longer possible for client-side file
ErrorCode = 218 // Server file was deleted while session was bound to it
ErrorCode = 219 // Client file has been blacklisted (IDENT)
ErrorCode = 220 // User has been blacklisted (BIND)
ErrorCode = 221 // Serialized transaction before upload completion
ErrorCode = 222 // Client file has expired
ErrorCode = 223 // User mismatch for client file identifier (IDENT)
ErrorCode = 224 // ErrorSessionsLimitExceeded
ErrorCode = 225 // Changeset contained an invalid schema change (UPLOAD)



Thank you Good Sir. I check your remarks about the caveats that come with this list. I will not hesitate to open a support ticket if something crops up.

Best, Eric

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.