ServiceException crash in Android when using kotlin sdk

I got a crash in sentry with the bellow stacktrace. What’s the meaning of this and how to avoid?

io.realm.kotlin.mongodb.exceptions.ServiceException: [Http][HttpError(4309)] http error code considered fatal. Server Error: 504.
    at io.realm.kotlin.mongodb.internal.RealmSyncUtilsKt.convertAppError(SourceFile:171)
    at io.realm.kotlin.mongodb.internal.RealmSyncUtilsKt$channelResultCallback$1.onError(SourceFile:66)
    at io.realm.kotlin.internal.interop.realmcJNI.complete_http_request(SourceFile)
    at io.realm.kotlin.internal.interop.realmc.complete_http_request
    at io.realm.kotlin.internal.interop.sync.ResponseCallbackImpl.response(SourceFile:26)
    at io.realm.kotlin.mongodb.internal.KtorNetworkTransport$sendRequest$1.invokeSuspend(SourceFile:123)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:33)
    at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SourceFile:138)
    at io.ktor.util.pipeline.SuspendFunctionGun.loop(SourceFile:112)
    at io.ktor.util.pipeline.SuspendFunctionGun.access$loop
    at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SourceFile:62)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:46)
    at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SourceFile:138)
    at io.ktor.util.pipeline.SuspendFunctionGun.loop(SourceFile:112)
    at io.ktor.util.pipeline.SuspendFunctionGun.access$loop
    at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SourceFile:62)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:46)
    at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SourceFile:138)
    at io.ktor.util.pipeline.SuspendFunctionGun.loop(SourceFile:112)
    at io.ktor.util.pipeline.SuspendFunctionGun.access$loop
    at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SourceFile:62)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:46)
    at io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SourceFile:138)
    at io.ktor.util.pipeline.SuspendFunctionGun.loop(SourceFile:112)
    at io.ktor.util.pipeline.SuspendFunctionGun.access$loop
    at io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SourceFile:62)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:46)
    at kotlinx.coroutines.DispatchedTask.run(SourceFile:106)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:923)

Hello @Gaurav_Bordoloi ,

Thanks for raising your concerns. The server Error 504 appears to be coming from the sync client. It is possible server was under a heavy load.

Could you please share if you are still getting the same crash? I will get feedback if this is still happening.

I look forward to your reply.

Cheers, :performing_arts:
henna,
Community Manager, MongoDB

Hi,
No, I am not facing the issue anymore but I am using a M10 paid instance with very less data and app clients, so the server shouldn’t be under a heavy load. I am using M10 for both prod and dev and if it is happening in dev, I doubt my prod server is stable. Any comment on this?

Hi @Gaurav_Bordoloi,

Thanks for your response back. M10 and M20 cluster tiers support development environments and low-traffic applications.

One of our engineers in the Cloud team has listed some helpful steps on how you can do performance testing on your cluster tier.

You can also refer to Cluster configuration details in MongoDB’s official documentation.

Please let me know if I can help you with anything else.

Cheers,
henna,
Community Manager, MongoDB