matrix-org / matrix-org/matrix-rust-sdk

Panic during Oidc login

Open
#5,010 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2.3k
Forks
500
Avg merge
1d 16h
Merged PRs (30d)
106

Description

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 '' 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
```

Contributor guide

Open the contributing guide

Research direction

Start with the OIDC login failure at RustMatrixAuthenticationService.kt:250 and compare it with the linked rageshake and logcat extract. Trace the authorization code grant failure and the reported Tokio reactor panic, then reproduce the login path and verify that this error no longer crashes the application.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin, rust
Domain
authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.