Failed to insert change into history during initial sync


AppSync.: failed to insert change into history during initial sync of AppSync.after copying 0 documents: failed to flush changes for ns “AppSync.” to unsynced documents cache during initial sync: connection(…) incomplete read of message header: context deadline exceeded

Can someone explain to me what this message means and the ways to solve it.

Thank you!

Hi John,

It has been a while since this was posted, were you able to find a solution to this issue?

If not, were there any other errors appearing in your the app? Please check your Realm error logs to see if there are any other unexpected errors that could provide more context e.g. duplicate key errors.

Did you make any changes to class structure in the code before this error appeared? If so, please ensure that these updates have also been done to your Realm schema. Additive changes can be persisted through Realm sync development mode.

If you’re working in a non-production environment, using the steps below you can try terminating and re-enabling sync to rectify schema inconsistencies due to changes in your class definitions:

  1. Terminate Sync
  2. Click “deploy” changes
  3. Drop the __realm_sync database (using Mongo Shell or Compass):
    use __realm_sync
  4. Re-enable sync

Did you see any warning notifications for your Atlas cluster or see any monitoring metrics in your dashboard that show resource issues? If this is the case, you may need to upgrade to a larger Atlas tier.

If you’re still seeing this error please provide details of the current situation and a link to your Realm app so I can have a further look into it.


1 Like