I'm encountering a RoomException$ConnectException in my Android app using LiveKit SDK 2.24.0 and Server 1.9.1.
The error specifically triggers during metrics collection (RTCMetricsManager.kt:104). It seems the SDK attempts to send subscriber metrics over the RELIABLE data channel before it's fully established or after it has been closed.
Log:
Room I Connected to server, server version: 1.9.1, client version: 2.24.0
ActiveCal...ct$1[37] I call event: io.livekit.android.events.RoomEvent$Connected@f709f4d
messaging.debug I Compiler allocated 8878KB to compile void com.x.messaging.feature.call.screen.ActiveCallScreenKt.ActiveCallLogicWrapper(com.x.messaging.feature.call.model.CallState$Active, kotlin.jvm.functions.Function1, io.livekit.android.room.Room, io.livekit.android.audio.AudioSwitchHandler, boolean, boolean, boolean, androidx.compose.ui.graphics.vector.ImageVector, boolean, boolean, kotlin.jvm.functions.Function1, androidx.compose.runtime.Composer, int, int)
ActiveCal...ct$1[37] I call event: io.livekit.android.events.RoomEvent$TrackPublished@7fd225e
I call event: io.livekit.android.events.RoomEvent$TrackE2EEStateEvent@2d51f36
I call event: io.livekit.android.events.RoomEvent$ParticipantConnected@c64df0e
RTCMetricsManagerKt I Error sending metrics: (Fix with AI)
io.livekit.android.room.RoomException$ConnectException: channel not established for RELIABLE
at io.livekit.android.room.RTCEngine.sendData_gIAlu_s$sendDataImpl(RTCEngine.kt:768)
at io.livekit.android.room.RTCEngine.sendData-gIAlu-s$livekit_android_sdk_release(RTCEngine.kt:779)
at io.livekit.android.room.metrics.RTCMetricsManagerKt.collectSubscriberMetrics(RTCMetricsManager.kt:104)
at io.livekit.android.room.metrics.RTCMetricsManagerKt.access$collectSubscriberMetrics(RTCMetricsManager.kt:1)
at io.livekit.android.room.metrics.RTCMetricsManagerKt$collectSubscriberMetrics$1.invokeSuspend(Unknown Source:13)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:829)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:717)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:704)
ActiveCal...ct$1[37] I call event: io.livekit.android.events.RoomEvent$TrackUnpublished@1c02cf
I call event: io.livekit.android.events.RoomEvent$ParticipantDisconnected@fe2745c
I call event: io.livekit.android.events.RoomEvent$Disconnected@7ffceb
AND
Room I Connected to server, server version: 1.9.1, client version: 2.24.0
RTCMetricsManagerKt I Error sending metrics: (Fix with AI)
io.livekit.android.room.RoomException$ConnectException: Publisher data channel not established for RELIABLE; is the room connected?
at io.livekit.android.room.RTCEngine.ensurePublisherConnected(RTCEngine.kt:829)
at io.livekit.android.room.RTCEngine.access$ensurePublisherConnected(RTCEngine.kt:111)
at io.livekit.android.room.RTCEngine$ensurePublisherConnected$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:35)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:101)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:47)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:829)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:717)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:704)
I’ve searched through the documentation and existing issues but couldn't find a solution or a similar report.
Questions
What is the root cause of this "channel not established" error during the metrics collection phase?
Is this a known race condition in version 2.24.0?
How can I ensure the RELIABLE channel is ready before the metrics manager attempts to use it?
I'm encountering a RoomException$ConnectException in my Android app using LiveKit SDK 2.24.0 and Server 1.9.1.
The error specifically triggers during metrics collection (RTCMetricsManager.kt:104). It seems the SDK attempts to send subscriber metrics over the RELIABLE data channel before it's fully established or after it has been closed.
Log:
AND
I’ve searched through the documentation and existing issues but couldn't find a solution or a similar report.
Questions
What is the root cause of this "channel not established" error during the metrics collection phase?
Is this a known race condition in version 2.24.0?
How can I ensure the RELIABLE channel is ready before the metrics manager attempts to use it?