Cloud Websocket error


#1

I’ve been working in a cloud instance today without any issues in an Android app. I updated to 5.0.0-BETA1 (I’ve also tried 5.0.0-SNAPSHOT) and ran it a couple of times fine but then started receiving the following errors over and over in the log:

03-07 10:50:03.614 6734-6969/edu.ucdavis.oh E/REALM_SYNC: Connection[2]: Websocket: HTTP response is 502-504
03-07 10:50:03.615 6734-6969/edu.ucdavis.oh W/REALM_JAVA: Unknown error code: 8
03-07 10:50:03.615 6734-6969/edu.ucdavis.oh E/REALM_JAVA: Session Error[realms://licensed-soft-salad.us1.cloud.realm.io/onehealth]: UNKNOWN(-1)
                                                          Bad WebSocket handshake response 502-504 received
03-07 10:50:04.144 6734-6969/edu.ucdavis.oh D/libc-netbsd: [getaddrinfo]: hostname=licensed-soft-salad.us1.cloud.realm.io; servname=443; netid=0; mark=0
03-07 10:50:04.144 6734-6969/edu.ucdavis.oh D/libc-netbsd: [getaddrinfo]: ai_addrlen=0; ai_canonname=(null); ai_flags=1024; ai_family=0
03-07 10:50:04.150 6734-6969/edu.ucdavis.oh D/libc-netbsd: getaddrinfo: licensed-soft-salad.us1.cloud.realm.io get result from proxy gai_error = 0

After awhile it starts spitting out the following:

03-07 10:51:20.160 6734-6969/edu.ucdavis.oh I/art: +++ added at 508 top=509 holes=0
03-07 10:51:20.162 6734-6969/edu.ucdavis.oh I/art:     at java.lang.StringFactory.newStringFromChars!(Native method)
03-07 10:51:20.162 6734-6969/edu.ucdavis.oh I/art:     at java.lang.AbstractStringBuilder.toString(AbstractStringBuilder.java:629)
03-07 10:51:20.162 6734-6969/edu.ucdavis.oh I/art:     at java.lang.StringBuilder.toString(StringBuilder.java:663)
03-07 10:51:20.162 6734-6969/edu.ucdavis.oh I/art:     at org.apache.harmony.security.x501.AttributeValue.makeCanonical(AttributeValue.java:326)
03-07 10:51:20.162 6734-6969/edu.ucdavis.oh I/art:     at org.apache.harmony.security.x501.AttributeTypeAndValue.appendName(AttributeTypeAndValue.java:289)
03-07 10:51:20.162 6734-6969/edu.ucdavis.oh I/art:     at org.apache.harmony.security.x501.Name.getName0(Name.java:184)
03-07 10:51:20.162 6734-6969/edu.ucdavis.oh I/art:     at org.apache.harmony.security.x501.Name.getName(Name.java:130)
03-07 10:51:20.162 6734-6969/edu.ucdavis.oh I/art:     at javax.security.auth.x500.X500Principal.getCanonicalName(X500Principal.java:155)
03-07 10:51:20.162 6734-6969/edu.ucdavis.oh I/art:   - locked <0x0bccf3be> (a javax.security.auth.x500.X500Principal)
03-07 10:51:20.162 6734-6969/edu.ucdavis.oh I/art:     at javax.security.auth.x500.X500Principal.equals(X500Principal.java:169)
03-07 10:51:20.162 6734-6969/edu.ucdavis.oh I/art:     at com.android.org.bouncycastle.jce.provider.CertPathValidatorUtilities.isSelfIssued(CertPathValidatorUtilities.java:289)
03-07 10:51:20.162 6734-6969/edu.ucdavis.oh I/art:     at com.android.org.bouncycastle.jce.provider.RFC3280CertPathUtilities.prepareNextCertL(RFC3280CertPathUtilities.java:2149)
03-07 10:51:20.162 6734-6969/edu.ucdavis.oh I/art:     at com.android.org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi.engineValidate(PKIXCertPathValidatorSpi.java:390)
03-07 10:51:20.162 6734-6969/edu.ucdavis.oh I/art:     at java.security.cert.CertPathValidator.validate(CertPathValidator.java:191)
03-07 10:51:20.162 6734-6969/edu.ucdavis.oh I/art:     at com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:337)
03-07 10:51:20.162 6734-6969/edu.ucdavis.oh I/art:     at com.android.org.conscrypt.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:215)
03-07 10:51:20.162 6734-6969/edu.ucdavis.oh I/art:     at io.realm.SyncManager.sslVerifyCallback(SyncManager.java:441)
03-07 10:51:20.162 6734-6969/edu.ucdavis.oh I/art:   - locked <0x0a189910> (a java.lang.Class<io.realm.SyncManager>)

Which then ends by the app crashing with the following:

03-07 10:39:06.680 6062-6137/? A/art: art/runtime/indirect_reference_table.cc:115] JNI ERROR (app bug): local reference table overflow (max=512)
03-07 10:39:06.680 6062-6137/? A/art: art/runtime/indirect_reference_table.cc:115] local reference table dump:
03-07 10:39:06.680 6062-6137/? A/art: art/runtime/indirect_reference_table.cc:115]   Last 10 entries (of 512):
03-07 10:39:06.680 6062-6137/? A/art: art/runtime/indirect_reference_table.cc:115]       511: 0x13348000 java.lang.String "-----BEGIN CERTI... (1606 chars)
03-07 10:39:06.680 6062-6137/? A/art: art/runtime/indirect_reference_table.cc:115]       510: 0x12cdee20 java.lang.String "licensed-soft-sa... (38 chars)
03-07 10:39:06.680 6062-6137/? A/art: art/runtime/indirect_reference_table.cc:115]       509: 0x13227720 java.lang.String "/data/data/edu.u... (104 chars)
03-07 10:39:06.680 6062-6137/? A/art: art/runtime/indirect_reference_table.cc:115]       508: 0x12c63780 java.lang.String "Bad WebSocket ha... (49 chars)
03-07 10:39:06.680 6062-6137/? A/art: art/runtime/indirect_reference_table.cc:115]       507: 0x1321e000 java.lang.String "-----BEGIN CERTI... (1614 chars)
03-07 10:39:06.680 6062-6137/? A/art: art/runtime/indirect_reference_table.cc:115]       506: 0x130fa9a0 java.lang.String "licensed-soft-sa... (38 chars)
03-07 10:39:06.680 6062-6137/? A/art: art/runtime/indirect_reference_table.cc:115]       505: 0x1321d000 java.lang.String "-----BEGIN CERTI... (1545 chars)
03-07 10:39:06.680 6062-6137/? A/art: art/runtime/indirect_reference_table.cc:115]       504: 0x130fa640 java.lang.String "licensed-soft-sa... (38 chars)
03-07 10:39:06.680 6062-6137/? A/art: art/runtime/indirect_reference_table.cc:115]       503: 0x131bb000 java.lang.String "-----BEGIN CERTI... (1647 chars)
03-07 10:39:06.680 6062-6137/? A/art: art/runtime/indirect_reference_table.cc:115]       502: 0x130fa5e0 java.lang.String "licensed-soft-sa... (38 chars)
03-07 10:39:06.680 6062-6137/? A/art: art/runtime/indirect_reference_table.cc:115]   Summary:
03-07 10:39:06.680 6062-6137/? A/art: art/runtime/indirect_reference_table.cc:115]       512 of java.lang.String (512 unique instances)
03-07 10:39:06.680 6062-6137/? A/art: art/runtime/indirect_reference_table.cc:115] 
03-07 10:39:07.392 6062-6137/? W/art: Attempted to destroy barrier with non zero count -1
03-07 10:39:07.392 6062-6137/? A/art: art/runtime/runtime.cc:412] Runtime aborting...
03-07 10:39:07.392 6062-6137/? A/art: art/runtime/runtime.cc:412] Aborting thread:
03-07 10:39:07.392 6062-6137/? A/art: art/runtime/runtime.cc:412] "Thread-15013" prio=5 tid=26 Runnable
03-07 10:39:07.392 6062-6137/? A/art: art/runtime/runtime.cc:412]   | group="" sCount=0 dsCount=0 obj=0x12ce73a0 self=0xa1bd5b00
03-07 10:39:07.392 6062-6137/? A/art: art/runtime/runtime.cc:412]   | sysTid=6137 nice=0 cgrp=default sched=0/0 handle=0xa0c7f930
03-07 10:39:07.392 6062-6137/? A/art: art/runtime/runtime.cc:412]   | state=R schedstat=( 15639616265 1028170473 3092 ) utm=1296 stm=267 core=1 HZ=100
03-07 10:39:07.392 6062-6137/? A/art: art/runtime/runtime.cc:412]   | stack=0xa0b83000-0xa0b85000 stackSize=1014KB
03-07 10:39:07.392 6062-6137/? A/art: art/runtime/runtime.cc:412]   | held mutexes= "abort lock" "mutator lock"(shared held)
03-07 10:39:07.392 6062-6137/? A/art: art/runtime/runtime.cc:412]   native: #00 pc 0035ad8f  /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiPKcPNS_9ArtMethodEPv+126)
03-07 10:39:07.392 6062-6137/? A/art: art/runtime/runtime.cc:412]   native: #01 pc 0033bdab  /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE+138)
03-07 10:39:07.393 6062-6137/? A/art: art/runtime/runtime.cc:412]   native: #02 pc 0031f985  /system/lib/libart.so (_ZNK3art10AbortState10DumpThreadERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPNS_6ThreadE+20)
03-07 10:39:07.393 6062-6137/? A/art: art/runtime/runtime.cc:412]   native: #03 pc 0031fc53  /system/lib/libart.so (_ZN3art7Runtime5AbortEv+622)
03-07 10:39:07.393 6062-6137/? A/art: art/runtime/runtime.cc:412]   native: #04 pc 000f3b09  /system/lib/libart.so (_ZN3art10LogMessageD2Ev+2092)
03-07 10:39:07.393 6062-6137/? A/art: art/runtime/runtime.cc:412]   native: #05 pc 001d5437  /system/lib/libart.so (_ZN3art22IndirectReferenceTable3AddEjPNS_6mirror6ObjectE+1406)
03-07 10:39:07.393 6062-6137/? A/art: art/runtime/runtime.cc:412]   native: #06 pc 0027821f  /system/lib/libart.so (_ZN3art3JNI9NewStringEP7_JNIEnvPKti+350)
03-07 10:39:07.393 6062-6137/? A/art: art/runtime/runtime.cc:412]   native: #07 pc 00108075  /system/lib/libart.so (_ZN3art8CheckJNI9NewStringEP7_JNIEnvPKti+392)
03-07 10:39:07.393 6062-6137/? A/art: art/runtime/runtime.cc:412]   native: #08 pc 000b2333  /data/app/edu.ucdavis.oh-2/lib/arm/librealm-jni.so (???)
03-07 10:39:07.393 6062-6137/? A/art: art/runtime/runtime.cc:412]   native: #09 pc 0007824b  /data/app/edu.ucdavis.oh-2/lib/arm/librealm-jni.so (???)
03-07 10:39:07.393 6062-6137/? A/art: art/runtime/runtime.cc:412]   native: #10 pc 0011fab1  /data/app/edu.ucdavis.oh-2/lib/arm/librealm-jni.so (???)
03-07 10:39:07.393 6062-6137/? A/art: art/runtime/runtime.cc:412]   native: #11 pc 00166e04  /data/app/edu.ucdavis.oh-2/lib/arm/librealm-jni.so (???)
03-07 10:39:07.393 6062-6137/? A/art: art/runtime/runtime.cc:412]   (no managed stack frames)
03-07 10:39:07.393 6062-6137/? A/art: art/runtime/runtime.cc:412] Dumping all threads without appropriate locks held: thread list lock
//....etc.

I also got a notice from Realm Studio “Faild while synchronizing Realm: End of input” and the same message about the websocket error which I assume means the server is down?

I should also mention that I’m using a Partial Realm which I understand is in beta. Maybe that’s why it was unable to recover gracefully?


#2

Sorry for that - the Android SDK got updated with a version of our sync engine that is incompatible with the version of ROS deployed on cloud which is why you’re seeing these errors. We’re planning to release a compatible non-beta version of ROS in the next few days which we’ll deploy to cloud instances shortly after.

In the future, we plan to expose controls for selecting the ROS version, running on cloud instances so you can choose to run a beta version if you’d like to experiment with a beta version of one of the SDKs.


#3

Thanks for the response @nirinchev I appreciate it.

Do I need to downgrade to 4.3.3 then to be able to work with ROS on Realm Cloud until it is updated?


#4

Yes, that would allow you to sync (but you won’t be able to open Realms created with 5.x). Once again, sorry for the inconvenience and we’ll do better in the future.


Partial Sync on Realm Cloud