MetaMask / metamask-mobile

Mobile web browser providing access to websites that use the Ethereum blockchain
https://metamask.io
Other
2.11k stars 1.09k forks source link

[Bug]: Error: JSON Parse error: Unexpected token: o #8996

Closed DevDecayed closed 1 month ago

DevDecayed commented 5 months ago

Describe the bug

image image

Correct password is throwing Json parsing error instead of letting use the app. Incorrect password is correctly throwing the "Invalid password" validation error.

Expected behavior

Correct password should allow me to use the application.

Screenshots/Recordings

No response

Steps to reproduce

  1. Historically use bio-metrics to login
  2. Bio metrics was unresponsive. No error thrown, but also not logging in.
  3. Toggle bio metrics to false/off on the login screen
  4. Bio metrics toggle disappears
  5. input correct password string

Error: JSON Parse error: Unexpected token: o Is thrown.

Correct "Invalid Password" error is thrown with any other string that isn't correct password.

Error messages or log output

Error: JSON Parse error: Unexpected token: o

Version

7.17.1

Build type

None

Device

S21 Ultra 5G

Operating system

Android

Additional context

I had been using bio metrics to login to the application. The night it happened, I was trying to login but the bio metrics was un responsive. It seemed to be erroring out, but no error was thrown. I tried to use the biometrics a few times without success, so, I decided to toggle the option off (assuming the toggle would stay there and give me the option to toggle back on) so that I can turn it back on again (oldest trick in the book). Toggle to use bio metrics disappeared. So I tried to login with the correct string/password and got the Json Parse error. Any other string correctly tosses the invalid password error. I've cleared cache with no success. I have not seen any mention of this particular parse error.

I don't know how to replicate it without another phone, that I do not have. Please help! I'm locked out of a ton of funds.

image

Severity

Critical. Doesn't allow user to get into metamask wallet. If user has lost seed phrase, there is no way of recovering access.

DevDecayed commented 5 months ago

This has been going on since version 7.14.0. That is when the error first appeared. I update the app as soon as updates are pushed, but so far, none have addressed the issue.

Cal-L commented 4 months ago

@DevDecayed Thanks for reporting this. Just had a question to help us better debug this:

gauthierpetetin commented 4 months ago

@MetaMask/mobile-platform here are steps worth testing:

  1. Install version 7.13.0
  2. Do a custom import of a random token (@DevDecayed do you remember what tokens you had in the wallet?)
  3. Upgrade to version 7.14.0
DevDecayed commented 4 months ago

@DevDecayed Thanks for reporting this. Just had a question to help us better debug this:

* Are you able to consistently reproduce this bug and if so, what is the version(s) where you're experiencing it and the exact steps to reproduce (specifically referring to the steps leading up to a non responsive biometrics)?

@Cal-L Yes. I can consistently reproduce. My correct password throws the correct error message of "invalid password" while any other string throws the above json parse error. I was using the protocol HyperLiquid, on the Arbitrum chain. I had the protocol open on the browser section of the mobile app, and closed my phone and walked away for a few minutes. Came back, opened my phone with my biometrics, and the metamask needed me to log back in. Tried using my bio, nothing was happening so I used the toggle to turn biometrics options off, with the intention of putting it back on, but I guess metamask hides the toggle when it's set to false (could be a easy fix if that toggle shows up regardless, and I'm able to toggle it back on and login with biometrics).

I've experienced this issue since version 7.14.0. None of the versions since then have fixed the issue and I'm essentially locked out of my wallet.

@gauthierpetetin I believe I only had eth and usdc on arbitrum chain at the time of the incident.

gauthierpetetin commented 4 months ago

Thanks for this additional context @DevDecayed 🙏

DevDecayed commented 4 months ago

@gauthierpetetin No, thank you for all your hard work!

gauthierpetetin commented 4 months ago

@jpcloureiro managed to break the application state to reproduce the error we're seeing here. Next steps suggested:

gauthierpetetin commented 4 months ago

Hi @DevDecayed by any chance, were you using a keystone hardware wallet before this issue occured? Also, is it still reproducible on your side?

DevDecayed commented 4 months ago

@gauthierpetetin I was not using any hardware wallet. This was my mobile hot wallet. As for reproducible? I am still getting the error message for the correct password, the wrong passwords throw the "invalid password" error message.

gauthierpetetin commented 3 months ago

This might be fixed by the PR that will remove vault recreation log in: https://github.com/MetaMask/metamask-mobile/pull/9577 It will be part of release 7.23.0

DevDecayed commented 3 months ago

This is wonderful news. I've been following the progress like a hawk. I will be eagerly waiting for 7.23.0 and confirm once that goes live. Thank you all.

DevDecayed commented 3 months ago

No go with 7.23.0. Error still present. Cache was cleared and tried.

gauthierpetetin commented 3 months ago

cc @MetaMask/mobile-platform for visibility

DevDecayed commented 3 months ago

I see there was something handled for 7.24.0. It was a copy of this with the word [Sentry] added to the front. Will wait patiently for that patch and confirm once it's live.

Gudahtt commented 1 month ago

It sounds like this was a vault corruption error, but it wasn't caused by our vault corruption flow. If we are able to reproduce this even artificially, we should ensure that parse errors for the vault trigger the vault corruption flow.

gauthierpetetin commented 1 month ago

Here's an issue we'll work on soon: https://github.com/MetaMask/MetaMask-planning/issues/2832

gauthierpetetin commented 1 month ago

Closing this issue since we're not able to reproduce. We'll re-open if it occurs again.

We've also implemented this mitigation: https://github.com/MetaMask/metamask-mobile/pull/10481

Nikiiis commented 1 month ago

I have exactly the same problem.. can you please tell me how you solved it?

Văd că s-a rezolvat ceva pentru 7.24.0. Era o copie a acesteia cu cuvântul [Sentry] adăugat pe față. Va aștepta cu răbdare acel patch și va confirma odată ce este live.

gauthierpetetin commented 2 weeks ago

Hi @Nikiiis , can you please upgrade the app to latest version (7.28.1), and let us know if you still encounter this error? If so, can you send us steps to reproduce?

Nikiiis commented 2 weeks ago

My version is 7.27.1... in the Play Market, no update is available

dum., 18 aug. 2024, 21:11 Gauthier Petetin @.***> a scris:

Hi @Nikiiis https://github.com/Nikiiis , can you please upgrade the app to latest version (7.28.1), and let us know if you still encounter this error? If so, can you send us steps to reproduce?

— Reply to this email directly, view it on GitHub https://github.com/MetaMask/metamask-mobile/issues/8996#issuecomment-2295345848, or unsubscribe https://github.com/notifications/unsubscribe-auth/BKKVANXQH6XOAINOECOTBMLZSDPW7AVCNFSM6AAAAABE6DI43GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJVGM2DKOBUHA . You are receiving this because you were mentioned.Message ID: @.***>

gauthierpetetin commented 2 weeks ago

Thanks for your reply, I'll let you know when the release is available on the Play Market such that you can retry.