realm / realm-object-server

Tracking of issues related to the Realm Object Server and other general issues not related to the specific SDK's
https://realm.io
293 stars 42 forks source link

Error after upgrade to 3.3.0: The type of the Realm file was invalid #370

Closed joluet closed 6 years ago

joluet commented 6 years ago

ROS 3.1.8 worked fine but after upgrading to ROS 3.3.0 I see this error in my Java client:

Sync session error
    UNKNOWN(-1)
    The type of the Realm file was invalid.
        at io.realm.internal.network.AuthServerResponse.createError(AuthServerResponse.java:74)
        at io.realm.internal.network.AuthenticateResponse.from(AuthenticateResponse.java:58)
        at io.realm.internal.network.OkHttpAuthenticationServer.authenticate(OkHttpAuthenticationServer.java:146)
        at io.realm.internal.network.OkHttpAuthenticationServer.loginToRealm(OkHttpAuthenticationServer.java:70)
        at io.realm.SyncSession$1.execute(SyncSession.java:541)
        at io.realm.SyncSession$1.execute(SyncSession.java:537)
        at io.realm.internal.network.ExponentialBackoffTask.run(ExponentialBackoffTask.java:75)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)

This is the ROS log:

info: Realm Object Server version 3.3.0 is starting
info: [sync] Configuring SyncService with a custom dataPath is deprecated and will be removed in a future version and the value will default to 'sync', relative to the server's dataPath.
info: [sync] Realm sync server started ([realm-core-5.6.0], [realm-sync-3.3.0])
info: [sync] Directory holding persistent state: /home/jonastech/TravelSpend-Staging/data/sync/user_data
info: [sync] Cluster mode: Root node
info: [sync] Backup mode: disabled
info: [sync] Log level: info
info: [sync] Download log compaction is enabled
info: [sync] Max download size: 16777216 bytes
info: [sync] Listening on 127.0.0.1:42634 (sync protocol version 24, max backlog is 128, non-TLS)
info: Realm Object Server has started and is listening on http://0.0.0.0:9090
Realm Object Server was started on 0.0.0.0:9090
error: [http] HTTP response: 9b42c7d0-b115-4bf7-a4b7-a54456006ef4
{"type":"https://realm.io/docs/object-server/problems/invalid-realm-type","title":"The type of the Realm file was invalid.","status":400,"code":619}
info: Open files in Realm Object Server: {"regular":405,"directory":0,"character-device":6,"block-device":0,"pipe":18,"symbolic-link":0,"socket":484,"unknown":8,"total":921}
raudabaugh commented 6 years ago

I'm seeing the same issue on ROS 3.4.1

joluet commented 6 years ago

@nirinchev has this been resolved?

nirinchev commented 6 years ago

This has been fixed, yes, and will be released with the next version of ROS.

In the meantime, you can work around it by opening the /__admin Realm (you may need to turn on "Show system Realm" in the "View" menu in Studio), then find all RealmFile records that have an empty value for realmType and set that to full.

josecarlosgarciacubillo commented 6 years ago

Query to modify 20K records?

nirinchev commented 6 years ago

@josecarlosgarcia can you elaborate?

josecarlosgarciacubillo commented 6 years ago

@nirinchev Hi Nikola, I'll have to modify more >20K records after upgrading to ROS 3.1.4

screen shot 2018-05-24 at 1 34 26 pm

So the question is who do I modify these records from Realm Studio

nirinchev commented 6 years ago

Please file a new issue as that seems unrelated to the original problem reported here.

joluet commented 6 years ago

@nirinchev I still see this error on ROS 3.4.2:

HTTP response: 02325daa-4884-45d8-948b-8af4cd495621 {"type":"https://realm.io/docs/object-server/problems/invalid-realm-type","title":"The type of the Realm file was invalid.","status":400,"code":619}
joluet commented 6 years ago

Ok, on 3.4.3 it seems to be fixed 👍 Is that the latest backwards compatible version I can safely use as a self-hosted developer server? On 3.4.5 I see this error:

error: [http] HTTP upgrade failed (service did not respond properly) {"type":"https://realm.io/docs/object-server/problems/service-unavailable","title":"The requested service is temporarily unavailable.","status":503,"code":802}