element-x-android icon indicating copy to clipboard operation
element-x-android copied to clipboard

Error In Login Flow

Open iDubno opened this issue 2 years ago • 11 comments

Steps to reproduce

  1. I'm on a Google Pixel 7 Pro with the Android 13 QPR2 Beta 3 Build. Start the latest instance of Element X Android (v8 architecture)
  2. Login using your login details.
  3. Tap on "Continue" An error message occurs, (shown in screenshot)

No logs are provided as Rageshake does not work in this scenario.

Outcome

What did you expect?

The app to login, and proceed to the Home Chat List Page.

What happened instead?

An Error Message occurred (see screenshot) Screenshot_20230311-144352

Your phone model

Google Pixel 7 Pro

Operating system version

Android 13 QPR2 Beta 3

Application version and app store

Element X Android V0.1.0, arm64 v8a architecture, version code 1001002

Homeserver

matrix.org

Will you send logs?

No

Are you willing to provide a PR?

No

iDubno avatar Mar 11 '23 15:03 iDubno

Having the logs are pretty important to be able to debug this issue.

image

I'm able to trigger a rageshake at the login window. You may just need to shake your phone harder (The default shake detection threshold is also quite conservative). Or have you been able to login previously and disabled rageshakes? They should be on by default, so try clearing the storage of the app in that case.

Alternatively, you could (with some setup) enable developer mode on your phone, connect your phone to your computer and export logs via adb logcat.

I'll note that I don't see an attempted login from @idubno:matrix.org on matrix.org from either today or yesterday. So it seems the login request is not actually making it to the homeserver due to this error.

anoadragon453 avatar Mar 13 '23 11:03 anoadragon453

Ah yes, I thought of using LogCat before, but I wasn't sure if it did internal app logs. (turns out it does)

Anyhow, I have used LogCat to debug the app, and now have obtained logs.

Here they are:

2023-03-15 12:09:39.676 12360-12389 RustMatrix...vice$login io.element.android.x.debug           E  Fail login
                                                                                                    org.matrix.rustcomponents.sdk.AuthenticationException$Generic: An error occurred: failed to read or write to the crypto store the account in the store doesn't match the account in the constructor: expected @idubno:matrix.org:LAJVCCSATX, got @idubno:matrix.org:SMAPTYFEDV
                                                                                                    	at org.matrix.rustcomponents.sdk.FfiConverterTypeAuthenticationError.read(matrix_sdk_ffi.kt:7035)
                                                                                                    	at org.matrix.rustcomponents.sdk.FfiConverterTypeAuthenticationError.read(matrix_sdk_ffi.kt:7027)
                                                                                                    	at org.matrix.rustcomponents.sdk.FfiConverter$DefaultImpls.liftFromRustBuffer(matrix_sdk_ffi.kt:153)
                                                                                                    	at org.matrix.rustcomponents.sdk.FfiConverterRustBuffer$DefaultImpls.liftFromRustBuffer(matrix_sdk_ffi.kt:165)
                                                                                                    	at org.matrix.rustcomponents.sdk.FfiConverterTypeAuthenticationError.liftFromRustBuffer(matrix_sdk_ffi.kt:7027)
                                                                                                    	at org.matrix.rustcomponents.sdk.FfiConverterTypeAuthenticationError.liftFromRustBuffer(matrix_sdk_ffi.kt:7027)
                                                                                                    	at org.matrix.rustcomponents.sdk.FfiConverterRustBuffer$DefaultImpls.lift(matrix_sdk_ffi.kt:166)
                                                                                                    	at org.matrix.rustcomponents.sdk.FfiConverterTypeAuthenticationError.lift(matrix_sdk_ffi.kt:7027)
                                                                                                    	at org.matrix.rustcomponents.sdk.FfiConverterTypeAuthenticationError.lift(matrix_sdk_ffi.kt:7027)
                                                                                                    	at org.matrix.rustcomponents.sdk.AuthenticationException$ErrorHandler.lift(matrix_sdk_ffi.kt:7023)
                                                                                                    	at org.matrix.rustcomponents.sdk.AuthenticationException$ErrorHandler.lift(matrix_sdk_ffi.kt:7022)
                                                                                                    	at org.matrix.rustcomponents.sdk.AuthenticationService.login(matrix_sdk_ffi.kt:9466)
                                                                                                    	at io.element.android.libraries.matrix.impl.auth.RustMatrixAuthenticationService$login$2.invokeSuspend(RustMatrixAuthenticationService.kt:99)
                                                                                                    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                                                                                                    	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
                                                                                                    	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
                                                                                                    	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

Hope this helps!

iDubno avatar Mar 15 '23 12:03 iDubno

Interesting, it sounds like the application is not clearing out the storage of the rust-sdk correctly between login attempts.

@iDubno can you try clear the app's storage via Android's App Info screen (tap and hold on the app icon and touch Info -> Clear Storage) and see if you can then login successfully? Perhaps monitor logs while doing so just in case you receive a different error.

anoadragon453 avatar Mar 15 '23 13:03 anoadragon453

I also had this error message after logging out and trying to log back in. Clearing the Apps Storage solved the Problem.

speatzle avatar Mar 17 '23 13:03 speatzle

Hello, after multiple tries (as this was my initial intuition of fixing the problem, except the first time I tried it didn't appear to fix the Problem), this seems to be a workaround for the Problem. (:

Thanks for all your help!

iDubno avatar Mar 17 '23 18:03 iDubno

@jmartinesp is it not supposed to be fixed?

ganfra avatar Mar 20 '23 12:03 ganfra

I think this can still happen if either a logout attempt or the restoreSession call somehow fail. We probably need a cleanup step there that removes any traces of the local session storage.

jmartinesp avatar Mar 20 '23 12:03 jmartinesp

I think this can still happen if either a logout attempt or the restoreSession call somehow fail.

I think this is what Happened in my case, i haven't gotten around to opening a Issue yet but i Logged out as a Troubleshooting step because the App would successfully log in on my matrix server but would then not talk to my own sliding-sync proxy (Works with other clients) and just show a Placeholder Roomlist Instead.

speatzle avatar Mar 20 '23 13:03 speatzle

@iDubno are you still seeing this issue?

kittykat avatar Jul 04 '23 13:07 kittykat

Hi, I'm going to close this issue for now as we haven't been able to reproduce it recently. Please tag me in your reply if you're still seeing it and I can reopen it for you

kittykat avatar Jul 14 '23 08:07 kittykat

I just ran into this on release 0.4.6, latest APK here from GitHub. I've been logged out (no clue why), couldn't log back in with the not-very-helpful message "An error occured". Clearing the app cache and storage helped.

Sorry that I can't give you anything more useful than that, I didn't capture logs before clearing storage :( Still, you might want to know that this is still happening. @kittykat

Eisfunke avatar Mar 18 '24 07:03 Eisfunke