`Synchronization between Atlas and Device Sync has been stopped` in dev mode?

I keep seeing Synchronization between Atlas and Device Sync has been stopped, due to error: non-recoverable error processing event: dropping namespace ns='xxx' 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. in my dashboard, yet my devices keep syncing just fine (I’m using the Shared plan)

I wonder if this is related to me using the free plan as clearly the sync is working.

Also, when I try to view Collections, none of the data shows up. It’s pretty weird.

Hi. You are running into the issue that the error describes. Sync really exists in 2 places:

  1. Between devices
  2. To/From MongoDB

When you drop collections, the sync to/from mongodb (as described in the error message) stops because we cannot support that. Sync between devices will continue to work, but as you point out the sync to MongoDB will not work anymore until you terminate and re-enable sync (this has nothing to do with the free plan)

Let me know if you have any other questions.

Thanks,
Tyler

Right now I’m prototyping and playing a lot with the schemas so that kinda explains. Not sure what’s the best way to ‘restart’ everything. So far I use the web interface to delete the schema, drop all the tables, kill all sessions from my devices, even disable sync/delete users from the App Users page after any significant changes, but the errors keep coming back, sometimes instantly.

How do I, in Dev mode, make sure this error doesn’t come back? If you can point me to any resources for migration in production that’d be very useful too.

Thanks.

I realized I have removed all the Rules, so I set them to readAndWriteAll and restart the sync. I get this red warnings:

Enabling Sync...copying data Errors...xxx: "encountered error when flushing batch: error in onBatchComplete callback: error updating resumable progress: context canceled", xxx: "encountered error when flushing batch: error in onBatchComplete callback: error updating resumable progress: connection(xxx) incomplete read of message header: context canceled",xxx: "encountered error when flushing batch: error in onBatchComplete callback: error updating resumable progress: connection(xxx) incomplete read of message header: context canceled"

And again the sync process failed within seconds of restarting. I’m confused as how to exactly fix this issue. I’m in Dev mode.

EDIT: This ended up working for me.

I guess my main concern are:

  1. When I turn off Dev Mode, do I run into the risk of getting this kind of errors in production? Assuming I’m migrating properly.
  2. Is there a simpler way than db.dropDatabase() the __realm_sync database to fix my issues?

Hi Anh,

As per Tyler’s comment here are some conditions that require a Termination of Sync including the dropping of a collection.

Clicking restart sync in the banner will not work in these cases.

Note that the steps I mentioned in the link you provided is only required in the context if terminating sync by itself does not resolve the issue for some reason. You should not need to drop __realm_sync every time since the termination process should do this automatically.

Regards
Manny