question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Test: Reconnect not happening correctly

See original GitHub issue

Leaving a phone in airplane mode for a couple of minutes, then try to activate it again. The Java layer does not seem to handle this well resulting in the access token not being refreshed

10-10 13:58:15.082 20935-21485/io.realm.examples.objectserver E/REALM_SYNC: Connection[2]: Failed to connect to endpoint '192.168.87.111:9080': Network is unreachable
10-10 13:58:15.083 20935-21485/io.realm.examples.objectserver E/REALM_SYNC: Connection[2]: Failed to connect to '192.168.87.111:9080': All endpoints failed
10-10 13:58:15.083 20935-21485/io.realm.examples.objectserver D/REALM_SYNC: Connection[2]: Reconnecting in 55173 milliseconds
10-10 13:58:20.776 20935-20935/io.realm.examples.objectserver D/REALM_JAVA: NetworkListener: Connection available
10-10 13:58:47.485 20935-22048/io.realm.examples.objectserver D/REALM_JAVA: Network request (authenticate): http://192.168.87.111:9080/auth
10-10 13:58:54.420 20935-20935/io.realm.examples.objectserver D/REALM_JAVA: NetworkListener: Connection available
10-10 13:58:54.422 20935-20935/io.realm.examples.objectserver D/REALM_JAVA: NetworkListener: Connection available
10-10 13:58:59.640 20935-22048/io.realm.examples.objectserver D/REALM_JAVA: AuthenticateResponse - Error: UNKNOWN(-1)
                                                                            java.net.SocketException: Connection reset
                                                                                at java.net.SocketInputStream.read(SocketInputStream.java:209)
                                                                                at java.net.SocketInputStream.read(SocketInputStream.java:139)
                                                                                at okio.Okio$2.read(Okio.java:138)
                                                                                at okio.AsyncTimeout$2.read(AsyncTimeout.java:236)
                                                                                at okio.RealBufferedSource.indexOf(RealBufferedSource.java:344)
                                                                                at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:216)
                                                                                at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:210)
                                                                                at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)
                                                                                at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:75)
                                                                                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                                at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
                                                                                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
                                                                                at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
                                                                                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
                                                                                at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
                                                                                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                                at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
                                                                                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
                                                                                at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)
                                                                                at okhttp3.RealCall.execute(RealCall.java:69)
                                                                                at io.realm.internal.network.OkHttpAuthenticationServer.authenticate(OkHttpAuthenticationServer.java:145)
                                                                                at io.realm.internal.network.OkHttpAuthenticationServer.refreshUser(OkHttpAuthenticationServer.java:80)
                                                                                at io.realm.SyncSession$4.execute(SyncSession.java:644)
                                                                                at io.realm.SyncSession$4.execute(SyncSession.java:640)
                                                                                at io.realm.internal.network.ExponentialBackoffTask.run(ExponentialBackoffTask.java:66)
                                                                                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
                                                                                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                                                                                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
                                                                                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
                                                                                at java.lang.Thread.run(Thread.java:764)
10-10 13:58:59.643 20935-22048/io.realm.examples.objectserver E/REALM_JAVA: Unrecoverable error, while refreshing the access Token (UNKNOWN(-1)
                                                                            java.net.SocketException: Connection reset
                                                                                at java.net.SocketInputStream.read(SocketInputStream.java:209)
                                                                                at java.net.SocketInputStream.read(SocketInputStream.java:139)
                                                                                at okio.Okio$2.read(Okio.java:138)
                                                                                at okio.AsyncTimeout$2.read(AsyncTimeout.java:236)
                                                                                at okio.RealBufferedSource.indexOf(RealBufferedSource.java:344)
                                                                                at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:216)
                                                                                at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:210)
                                                                                at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)
                                                                                at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:75)
                                                                                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                                at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
                                                                                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
                                                                                at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
                                                                                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
                                                                                at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
                                                                                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                                at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
                                                                                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
                                                                                at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)
                                                                                at okhttp3.RealCall.execute(RealCall.java:69)
                                                                                at io.realm.internal.network.OkHttpAuthenticationServer.authenticate(OkHttpAuthenticationServer.java:145)
                                                                                at io.realm.internal.network.OkHttpAuthenticationServer.refreshUser(OkHttpAuthenticationServer.java:80)
                                                                                at io.realm.SyncSession$4.execute(SyncSession.java:644)
                                                                                at io.realm.SyncSession$4.execute(SyncSession.java:640)
                                                                                at io.realm.internal.network.ExponentialBackoffTask.run(ExponentialBackoffTask.java:66)
                                                                                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
                                                                                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                                                                                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
                                                                                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
                                                                                at java.lang.Thread.run(Thread.java:764)
                                                                            ) reschedule will not happen
10-10 13:59:10.055 20935-21485/io.realm.examples.objectserver I/REALM_SYNC: Connection[2]: Resolving '192.168.87.111:9080'
10-10 13:59:10.061 20935-21485/io.realm.examples.objectserver I/REALM_SYNC: Connection[2]: Connecting to endpoint '192.168.87.111:9080' (1/1)
10-10 13:59:10.503 20935-21485/io.realm.examples.objectserver I/REALM_SYNC: Connection[2]: Connected to endpoint '192.168.87.111:9080' (from '192.168.87.104:44952')
10-10 13:59:10.503 20935-21485/io.realm.examples.objectserver D/REALM_SYNC: Connection[2]: WebSocket::initiate_client_handshake()
10-10 13:59:10.577 20935-21485/io.realm.examples.objectserver E/REALM_SYNC: Connection[2]: Websocket: HTTP response invalid
10-10 13:59:10.577 20935-21485/io.realm.examples.objectserver I/REALM_SYNC: Connection[2]: Connection closed due to error
10-10 13:59:10.577 20935-21485/io.realm.examples.objectserver D/REALM_SYNC: Connection[2]: Reconnecting in 3182343 milliseconds

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
SiarheiSmcommented, Jan 19, 2018

it seems to work now. thank you 👍

2reactions
Zhuindencommented, Jan 13, 2018

Upgraded to Realm Sync 2.1.8.

Previously was Realm Sync 2.1.4

@nhachicha I guess that’s where something broke, there was no relevant change in Realm Java

Read more comments on GitHub >

github_iconTop Results From Across the Web

Auto reconnect doesn't work properly · Issue #1479 - GitHub
Mongoose 3.6.9 doesn't seem to have working auto-reconnect. Here is my test case against a local MongoDB server which I kill to test...
Read more >
Fix a "Reconnect me" error - Android - Chromecast Help
Step 1. Check the internet access · If other devices are able to connect to the Wi-Fi network, and Chromecast is not working,...
Read more >
How to kill a socket in unit tests for reconnect test
I'm trying to test some code that reconnects to a server after a disconnect. This works perfectly fine outside the tests, but it...
Read more >
Common errors and troubleshooting tips - IFTTT Help Center
If you are using a connection with an IoT device that is not running successfully, try a full reset of the device, double-check...
Read more >
How To Fix The "Error Establishing a Database Connection" in ...
If this isn't working correctly, you are left with the “error establishing a database connection” message, as seen below.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found