Synchronization between Atlas and Device Sync has been stopped. Terminating doesn't help

This is the errors we’re facing all of a sudden:

Synchronization between Atlas and Device Sync has been stopped, due to error:

non-recoverable error processing event: dropping namespace ns='db.collection' being synchronized with Device Sync is not supported. Sync cannot be resumed from this state and must be terminated and re-enabled to continue functioning.

Now I know from other threads that this happens when you drop a collection. But how do I fix it? I’ve terminated the sync and re-enabled it twice but the same error persists.

Hi @Renie_Ravin,

Thanks for posting! Can you confirm that you followed these instructions to terminate sync? Note that if you have drafts enabled, you’ll need to deploy the draft in between terminating and re-enabling for the termination to go through.

1 Like

@Renie_Ravin

You need to establish CLIENT RESET LOGIC.

As Realm/Device Sync does not automatically do this, so when something happens to disconnect Device Sync from the clients, you’ll never recover and your app will be in a pit of doom. But luckily, there is a super easy fix that isn’t in the QuickStart guides but should be so people are aware you need this functionality.

You can find this by going to Mongodb.com going to search, type in Language + Client Reset Logic.

This is an example for C# https://www.mongodb.com/docs/realm/sdk/dotnet/sync/client-reset/

2 Likes

This was it, thank you so much - I had not deployed the change in between termination and re-syncing.

Thank you, we had not implemented this, we’re building in React Native, so we’re using that SDK now.

This was it, thank you so much - I had not deployed the change in between termination and re-syncing.

I knew immediately that’s what the issue was, I used to support Realm/Device Sync/App Services for 2 years working for MBD.

The reason Kiro didn’t mention this, is because Client Reset Logic is literally unknown to people in other areas of MBD, and those inside Realm have no idea it exists unless someone more senior to them mentions it like I mentioned it to you.

Where Client Reset Logic for you, is right here hidden in the docs where you’d never find it if you didn’t take a lot of time reading for it, or knew exactly what you were looking for. https://www.mongodb.com/docs/realm/sdk/react-native/sync-data/handle-sync-errors/#handle-client-reset-errors

Why Client Reset Logic is so important.

  • Client Reset Logic is important because it allows your app to recover after issues like this, anytime the app client disconnects from Sync for literally any reason, even a period of time offline, it will fail to ever sync again if this isn’t in place.

  • Client Reset Logic if it’s not in place can cause global app outages should a major event take place.

This is MongoDB Device Syncs/Realm’s most critical recovery feature, and I know you were not aware it existed, which is why I’m clarifying this and bringing it to your attention.

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