Search code examples
androidrealmrealm-mobile-platformrealm-object-server

ROS v1.8.3 with android realm 4.1.0 sync issue


trying to connect ROS v1.8.3 with android realm 4.1.0, but got an error on connection:

Connection[1]: Writing failed: End of input 
Connection[1]: Connection closed due to error
Connection[1]: Reconnecting in 472 milliseconds
Connection[1]: Resolving 'ec2....us-west-2.compute.amazonaws.com:9080'
Connection[1]: Connecting to endpoint '34.215.139.88:9080' (1/1)
Connection[1]: Connected to endpoint '34.215.139.88:9080' (from '10.0.2.15:35808')
Connection[1]: WebSocket::initiate_client_handshake()
Connection[1]: HTTP request =
                                                              GET /realm-sync/%2F0e38f9551d63d9e08f0d0bf%2Faccount HTTP/1.1
                                                              Authorization: Realm-Access-Token version=1 token="ey.......=="
                                                              Connection: Upgrade
                                                              Host: ec.....us-west-2.compute.amazonaws.com
                                                              Sec-WebSocket-Key: azTr3bmRnl1FbSvLCK0pvA==
                                                              Sec-WebSocket-Protocol: io.realm.sync.22
                                                              Sec-WebSocket-Version: 13
                                                              Upgrade: websocket

is it version incompatibility issue?

previously it works well with realm 3.4.0 build. only changes i've made during migration:

project gradle:

 classpath "io.realm:realm-gradle-plugin:4.1.0"

gradle:

android {
    configurations.all {
        resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.2'
    }

code (added <SyncUser>):

SyncUser.loginAsync(syncCred, serverH, new SyncUser.Callback <SyncUser> () {...

application have been deleted from phone before install with new realm build.

is some other options required?

logs on server:

sync: HTTP Connection[2165]: Connection is closed after HTTP response.
sync: HTTP Connection[2165]: 404 Not Found
sync: HTTP Connection[2165]: HTTP request received, url 
sync: HTTP Connection[2165]: Connection initiates HTTP receipt
proxy: attempting to upgrade client ::ffff:93.85.144.134:48862 => headers: {"authorization":"Realm-Access-Token version=1 token=\"eyJhY...Q==\"","connection":"Upgrade","host":"ec....us-west-2.compute.amazonaws.com","sec-websocket-key":"Wtpq5fNSWwwJicg8E8/RTQ==","sec-websocket-protocol":"io.realm.sync.22","sec-websocket-version":"13","upgrade":"websocket"}.}

Solution

  • Realm 4.0.0 was updated to use Realm Sync 2.0.x, which requires ROS 2.0 which is most likely incompatible with ROS 1.x.

    The last version to use Realm Sync 1.x is 3.7.2.