status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.91k stars 984 forks source link

Empty account is randomly created #21151

Closed VolodLytvynenko closed 1 week ago

VolodLytvynenko commented 2 months ago

Unfortunately, this issue doesn't happen consistently, and there are no exact steps to reproduce it. Hopefully, the logs will help

Steps:

Create new account

Actual result:

The display name is not shown for such account; The wallet is not created; Additional wallet account can't be created; Assets are not shown

https://github.com/user-attachments/assets/d882b793-511e-445c-a1c9-1b649bef69a2

Additional info:

In some cases, an error is shown after key generation when such empty account is going to be created, as @pavloburykh encountered once. However, I didn’t face this error in my case.

Device:

Pixel 7a, Android 13

Logs:

logcat.txt Status-debug-logs.zip

ENV:

nightly 30 Aug 2024

churik commented 2 months ago

Reproduced in e2e builds several times per day.

qfrank commented 2 months ago
ERROR[08-30|10:56:02.169|github.com/status-im/status-go/mobile/status.go:343]                                                                      failed to create account                 error="account not found"
qfrank commented 2 months ago

Does this problem often occur when a new account is created immediately after logging out?

qfrank commented 2 months ago

If yes, I guess it's because we didn't take care of race operation on accountsGenerator in the backend as Logout/CreateAccountAndLogin are aync invoked

churik commented 2 months ago

@qfrank I couldn't really reproduce it with when a new account is created immediately after logging out?

In e2e tests, like mentioned in the issue, but we continue to encounter to this issue just on simple account creation on Enable notification screen image

TestOneToOneChatMultipleSharedDevicesNewUi_geth1.log

churik commented 2 months ago

moreover, users are also facing this error after upgrade:

1. Issue Description
Please shake the phone to report this error and restart the app. multiaccount is currently empty, which means something went wrong when trying to update it with

2. Steps to reproduce
<no value>

3. Attach screenshots that can demo the problem, please
qfrank commented 2 months ago

emm.. let me draft a PR and see if it make any difference

qfrank commented 2 months ago

could you try this PR to see if it make any difference? thank you! @churik

churik commented 2 months ago

hm, it is hard to catch it, but let me try 5-6 times in the loop

churik commented 2 months ago

no, it doesn't :( same place, same error TestOneToOneChatMultipleSharedDevicesNewUiTwo_geth0.log

qfrank commented 2 months ago

no, it doesn't :( same place, same error TestOneToOneChatMultipleSharedDevicesNewUiTwo_geth0.log

can't see the error(account not found) in the log, so it's not relate to this issue 🤔

qfrank commented 2 months ago

the log message "started a node, and created account" shows account created successfully. What if restart app?

qfrank commented 2 months ago

I'm running out of idea ATM, unassign myself, maybe back one day when inspiration comes.

yevh-berdnyk commented 1 month ago

One more example of appearing this error pop up:

image

In this case the second user is created on the device.

Logs: requests.log geth.log

churik commented 1 month ago

@yevh-berdnyk let's try to find out if in this case account is created and usable, because if it is, we should move it to different issue

yevh-berdnyk commented 1 month ago

@churik yes, we have a lot of examples in e2e test runs when account is created and usable after closing this pop up. And we already have a separate issue https://github.com/status-im/status-mobile/issues/20806, I'll add logs there

vkjr commented 1 month ago

@churik, is it Android-only issue?

churik commented 1 month ago

@vkjr I've seen it on IOS also, but only once. Important note: this issue and https://github.com/status-im/status-mobile/issues/20806 are different - in case of this the empty account is created, in case of https://github.com/status-im/status-mobile/issues/20806 (it might be only Android, hard to say) - account might be created and usually created but in the middle of the process there is a popup "Please, shake your phone".

vkjr commented 1 month ago

@churik, thank you, will try to test more on Android, because on iOS I've created 15 accounts and never experienced this

Btw, if "Please shake your phone" related to other issue, can it be removed from the issue description?

vkjr commented 1 month ago

@pavloburykh, I created tons of accounts on iOS, Android and simulator but wasn't able to reproduce the issue. Don't know is it good or bad :) I'd suggest to lower the priority of this issue until we encounter it again or get complains from the users. Because it looks like very rare and not too harmful because user can't lose any assets and can create account again if problem encountered. Wdyt?

churik commented 1 month ago

we got a couple of complains, that say exactly - empty multiaccount is created. I'll move it from the milestone then, as we really don't have a solution now.

Thanks for investigation @vkjr

churik commented 1 month ago

image Just confirming that we contine to receive these reports from users; cc @ilmotta @vkjr

shivekkhurana commented 1 month ago

Got it, I'm gonna put it in 2.32 milestone. Seems to be a recurring bug.

pavloburykh commented 1 month ago

@ilmotta @churik I have faced the issue on my physical IOS in today's nightly (Oct 9, 2024) while recovering existing account. Attaching logs, though not sure they will be helpful as debug level was disabled

status_logs (8).zip

Image

https://github.com/user-attachments/assets/16e45863-6b16-4f17-a7d0-ad5a674b05e9

ilmotta commented 3 weeks ago

@pavloburykh @churik, quick question, once you face this bug, what happens if you delete the profile and try to recover again, will it work this time around?

churik commented 3 weeks ago

it is pretty random, I didn't face it myself, but I suppose it will. It even might work in case user skip this error, but not always. Pretty sure that @pavloburykh might try that.

churik commented 3 weeks ago

Should be closed along with https://github.com/status-im/status-mobile/issues/20806

seanstrom commented 1 week ago

Closing this issue now that #20806 has been closed