Stuck in Bad changeset (DOWNLOAD) statusCode=112

Hello,

I wanted to add a new collection to an existing Realm Sync using Partitions.
I first declared the schema from RealmUI and I added the model to the iOS client.
Then I ran the app, but forgot to add the collection in Realm DB (Atlas).
So I activated Dev mode, and ran the app.
It worked at first. The iOS client created an entry which was then available online (I checked with Compass).

Then… I wanted to connect to the same account on 2 other devices.
And here is the problem, I always get
“related decl ‘e’ for RLMSyncError(_nsError: Error Domain=io.realm.sync Code=6 “Bad changeset (DOWNLOAD)” UserInfo={NSLocalizedDescription=Bad changeset (DOWNLOAD), statusCode=112})”
on any other device beside the first one.

First one can connect. All other devices are stuck even when I uninstall + reinstall.

I tried to delete the schema on RealmUI + delete the collection from Compass.
I got a strange RealmUI error at first saying that I needed to restart Sync because it failed something (unfortunately I can’t find the error anymore).

Nothing works, I’m afraid my specific user is now stuck in limbo and can’t use Realm anymore on any device (beside the first one where I haven’t uninstalled the app yet). Other users seem fine.
(If someone from Mongo reads this, it’s userId = 6149dda8ad610a7e02f9b285 on my pyra-dev project.)

My 2 questions are:

  • How can I unjam my user from getting bad changeset?
  • What actually happened to end up in this situation?

Hi Jerome,

The bad changeset errors are usually because there is some disparity in the changeset instructions that client is receiving, for example an instruction trying to update an object that does not exist. The causes of this can be various and would require in depth investigation via a support ticket.

Your Realm logs recently show successful sessions for the user id you pointed out so it looks like you’ve resolved the issue. The previous error logs for that user showed that a client reset was required so it may be what fixed if they uninstalled/reinstalled the app. Example:
client file not found. The server has forgotten about the client-side file presented by the client.

To get more clues on the root cause you can also choose to enable .trace client log level (ios example linked) that output more verbose logs when reproducing the issue.

Sometimes you may also need to terminate sync for the cloud app and restart it depending on what kind of schema changes are made. Please see list of Breaking vs Non-Breaking changes.

Regarding Sync developer mode, please ensure this is only used in non-production environments as this can potentially cause bad changeset issues. Please also find article on make breaking schema changes in a production app.

Hope that helps.

Regards
Manny

1 Like