5

I got this error on the object server console on login and can't sync anymore. The same user account was working before.

2016-12-13T13:20:52.858Z - error: sync-server: Connection[6]: Session[1]: Bad changeset received: Assertion failed: left().link_target_table_ndx == right().link_target_table_ndx (message_type='upload')

2016-12-13T13:20:52.858Z - info: sync-server: Connection[6]: Session[1]: Session terminated (session_ident=1).

2016-12-13T13:20:52.858Z - info: sync-server: Connection[6]: Sending: ERROR(error_code=212, message_size=22, try_again=0, session_ident=1)

2016-12-13T13:20:52.859Z - info: sync-server: Connection[6]: Connection closed by client: End of input

What does it mean? How do I fix it?

Edit: I tried incrementing the schema version, then I got:

IMPORTANT: if you see this error, please send this log to help@realm.io.

2016-12-13 14:37:07.407848 proj[34851:10576594] Sync: Opening Realm file: /var/mobile/Containers/Data/Application/65681835-AE09-4E4C-830A-BA7A8ADF0D69/Documents/realm-object-server/b77ccd68258d68251aafb1bac5d8d653/realm%3A%2F%2F192.168.0.12%3A9080%2F%7E%2Fz

2016-12-13 14:37:07.408088 proj[34851:10576378] /Users/x/y/z/Pods/Realm/Realm/RLMClassInfo.mm:97: [realm-core-2.2.0] Assertion failed: rlmSchema.objectSchema.count == schema.size()

(sent it to help@realm.io)

User
  • 31,811
  • 40
  • 131
  • 232

1 Answers1

3

It means that you have two schemas where one field is nullable and another is not (Error could be better, granted). This is a common error for Swift/Java models, because Java is nullable by default, while Swift strings are not.

Christian Melchior
  • 19,978
  • 5
  • 62
  • 53
  • I'm not using Java, only Swift. I restructured several things but I'm not aware of having changed the nullability of anything... – User Dec 13 '16 at 13:51
  • In that case it sounds like you are trying to sync two versions of your app with incompatible schemas – Christian Melchior Dec 13 '16 at 13:52
  • Well as I said I restructured my schema. Did a lot of changes. Doesn't increasing the schema version fix this? I'm in dev environment, only want to reset/overwrite the schema in the obj server. – User Dec 13 '16 at 13:56
  • If you did reset the server it should work, if not the "old" schema will still be on the server, so when you connect a new client with the "new" schema it will throw this error if they are incompatible. SyncConfigurations doesn't use the version number as far as I know. You can also test this by giving the Realm another name that doesn't exist on the server yet. – Christian Melchior Dec 13 '16 at 14:00
  • How do I reset the server? How do I give the realm another name? – User Dec 13 '16 at 14:05
  • Ok I found where to rename it. Only questions pending how / what is the best way to reset it. And why does it say to send `Assertion failed: rlmSchema.objectSchema.count == schema.size()` to help@realm.io? Is this also only because of the schema change? – User Dec 13 '16 at 14:24
  • It's because you shouldn't be hitting an assertion, and we should have a proper error message for that. – teotwaki Dec 15 '16 at 09:38
  • Ok thanks. I +1 this but I'm not selecting it because the answer doesn't answer the question ("How to handle...") and the comments are also not quite complete, e.g. how to properly reset the server or if the only way is to reinstall it, etc. – User Dec 23 '16 at 18:17