matrix-rust-sdk icon indicating copy to clipboard operation
matrix-rust-sdk copied to clipboard

Panic during Oidc login

Open bmarty opened this issue 7 months ago • 2 comments

I was trying to login using Oidc and when I was back to the application (so after login and continue on the MAS page) I got a crash.

Rageshake: https://github.com/element-hq/element-x-android-rageshakes/issues/5680

The logcat file contains more details about the problem.

Extract:

2025-05-07T09:18:53.701599Z ERROR elementx: Failed to login with OIDC
org.matrix.rustcomponents.sdk.OidcException$Generic: An error occurred: authorization code grant failed: failed to request token: Server returned error response: server_error: The authorization server encountered an unexpected condition that prevented it from fulfilling the request.
	at org.matrix.rustcomponents.sdk.FfiConverterTypeOidcError.read(matrix_sdk_ffi.kt:34537)
	at org.matrix.rustcomponents.sdk.FfiConverterTypeOidcError.read(matrix_sdk_ffi.kt:34529)
	at org.matrix.rustcomponents.sdk.FfiConverter$DefaultImpls.liftFromRustBuffer(matrix_sdk_ffi.kt:237)
	at org.matrix.rustcomponents.sdk.FfiConverterRustBuffer$DefaultImpls.liftFromRustBuffer(matrix_sdk_ffi.kt:249)
	at org.matrix.rustcomponents.sdk.FfiConverterTypeOidcError.liftFromRustBuffer(matrix_sdk_ffi.kt:34529)
	at org.matrix.rustcomponents.sdk.FfiConverterTypeOidcError.liftFromRustBuffer(matrix_sdk_ffi.kt:34529)
	at org.matrix.rustcomponents.sdk.FfiConverterRustBuffer$DefaultImpls.lift(matrix_sdk_ffi.kt:250)
	at org.matrix.rustcomponents.sdk.FfiConverterTypeOidcError.lift(matrix_sdk_ffi.kt:34529)
	at org.matrix.rustcomponents.sdk.FfiConverterTypeOidcError.lift(matrix_sdk_ffi.kt:34529)
	at org.matrix.rustcomponents.sdk.OidcException$ErrorHandler.lift(matrix_sdk_ffi.kt:34525)
	at org.matrix.rustcomponents.sdk.OidcException$ErrorHandler.lift(matrix_sdk_ffi.kt:34524)
	at org.matrix.rustcomponents.sdk.Matrix_sdk_ffiKt.uniffiCheckCallStatus(matrix_sdk_ffi.kt:313)
	at org.matrix.rustcomponents.sdk.Matrix_sdk_ffiKt.access$uniffiCheckCallStatus(matrix_sdk_ffi.kt:1)
	at org.matrix.rustcomponents.sdk.Matrix_sdk_ffiKt.uniffiRustCallAsync(matrix_sdk_ffi.kt:45053)
	at org.matrix.rustcomponents.sdk.Matrix_sdk_ffiKt$uniffiRustCallAsync$1.invokeSuspend(Unknown Source:19)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:124)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:820)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:717)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:704)
 | RustMatrixAuthenticationService.kt:250
2025-05-07T09:18:53.766901Z ERROR log: thread '<unnamed>' panicked at 'there is no reactor running, must be called from the context of a Tokio 1.x runtime': /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/deadpool-runtime-0.1.4/src/lib.rs:101

bmarty avatar May 07 '25 09:05 bmarty

Hmm, yeah. You should catch the error, though the panic seems to be the typical deadpool thing we have encountered multiple times.

Not sure if the deadpool thing is directly related to the not catching of the error.

poljar avatar May 20 '25 09:05 poljar

Ah sorry, the last line about the actual panic was hidden by the scrollbar. Removing my previous message...

jmartinesp avatar May 20 '25 10:05 jmartinesp