metamask-mobile icon indicating copy to clipboard operation
metamask-mobile copied to clipboard

[Bug]: KeyringController - All the accounts have disappeared and if I try to send a tx I get `KeyringController - No keyring found. Error info: there are keyrings, but none match the address`

Open seaona opened this issue 1 year ago • 11 comments

Describe the bug

After leaving the wallet open for several hours, when I came back and unlocked the phone I saw the Home screen of the wallet without the Account section. If I try to send a transaction I get the: KeyringController - No keyring found. Error info: there are keyrings, but none match the address.

This might relate to this other issue: https://github.com/MetaMask/metamask-mobile/issues/9167

Expected behavior

No response

Screenshots/Recordings

share_8033119271470173440

Screenshot from 2024-04-17 09-41-30

https://github.com/MetaMask/metamask-mobile/assets/54408225/e76632ca-5bee-4525-8db5-ade39b39256b

Steps to reproduce

  1. Leave the wallet open in your phone for some time (in my case it was all night)
  2. Unlock your phone
  3. Open the wallet
  4. See that you are in the Home screen already (no password needed for unlock it)
  5. See the account section has disappeared
  6. Try to perform a tx
  7. See the error KeyringController - No keyring found. Error info: there are keyrings, but none match the address

To fix this situation, close the wallet and re-open it again. This will trigger the Unlock screen and once you've entered the correct password you'll see again the Account section

Error messages or log output

No response

Version

7.20.0

Build type

None

Device

Pixel 6

Operating system

Android

Additional context

No response

Severity

No response

seaona avatar Apr 17 '24 07:04 seaona

@kumavis also witnessed this issue. Slack thread.

AlexJupiter avatar Apr 22 '24 11:04 AlexJupiter

Bumping this to a Sev1 as it seems to me the user cannot perform a transaction.

AlexJupiter avatar Apr 22 '24 11:04 AlexJupiter

Sentry Issue: METAMASK-X9V1

sentry-io[bot] avatar Apr 29 '24 17:04 sentry-io[bot]

Sentry Issue: METAMASK-X78M

sentry-io[bot] avatar Apr 29 '24 17:04 sentry-io[bot]

I was able to reproduce a similar error running the main branch locally on my android device. Here are the steps...

  • import account with funds (not sure if the funds are needed or not)
  • I waited 25 minutes with the app open and the phone locked
  • unlocked the phone
  • The app asked me for biometrics..it failed and then brought me to login
  • Login with password
  • wallet view opens with no Accounts or tokens

Here are the logs

 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Lockscreen::unlockKeychain - getting credentials
 LOG  [MetaMask DEBUG]: Failed to lock KeyringController [TypeError: Cannot read private member from an object whose class did not declare it]
 LOG  [MetaMask DEBUG]: Lockscreen::unlockKeychain - getting credentials
 LOG  [MetaMask DEBUG]: Failed to lock KeyringController [TypeError: Cannot read private member from an object whose class did not declare it]
 WARN  [MetaMask DEBUG]: [Error: Trouble initializing Branch. Invalid or missing app id, Branch key, or secret. The request was invalid.]
 WARN  Debugger and device times have drifted by more than 60s. Please correct this by running adb shell "date `date +%m%d%H%M%Y.%S`" on your debugger machine.
 WARN  [MetaMask DEBUG]: [Error: Trouble initializing Branch. Invalid or missing app id, Branch key, or secret. The request was invalid.]
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 INFO  TRACK event saved {"event": "Error occurred", "properties": {"error": true, "errorMessage": "Branch:", "type": "Trouble initializing Branch. Invalid or missing app id, Branch key, or secret. The request was invalid."}, "type": "track"}
 INFO  TRACK event saved {"event": "Error occurred", "properties": {"error": true, "errorMessage": "Branch:", "type": "Trouble initializing Branch. Invalid or missing app id, Branch key, or secret. The request was invalid."}, "type": "track"}
 INFO  TRACK event saved {"event": "Error occurred", "properties": {}, "type": "track"}
 INFO  TRACK event saved {"event": "Login Screen Viewed", "properties": {}, "type": "track"}
 INFO  TRACK event saved {"event": "Error occurred", "properties": {"error": true, "errorMessage": "code: 5, msg: Authentication canceled", "type": "Lockscreen: Authentication failed"}, "type": "track"}
 INFO  TRACK event saved {"event": "Error occurred", "properties": {"error": true, "errorMessage": "code: 5, msg: Authentication canceled", "type": "Lockscreen: Authentication failed"}, "type": "track"}
 INFO  TRACK event saved {"event": "Error occurred", "properties": {}, "type": "track"}
 INFO  TRACK event saved {"event": "Error occurred", "properties": {"error": true, "errorMessage": "Branch:", "type": "Trouble initializing Branch. Invalid or missing app id, Branch key, or secret. The request was invalid."}, "type": "track"}
 INFO  TRACK event saved {"event": "Error occurred", "properties": {"error": true, "errorMessage": "Branch:", "type": "Trouble initializing Branch. Invalid or missing app id, Branch key, or secret. The request was invalid."}, "type": "track"}
 INFO  TRACK event saved {"event": "Error occurred", "properties": {}, "type": "track"}
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 WARN  [MetaMask DEBUG]: [Error: KeyringController - Cannot persist vault without password and encryption key]
 WARN  [MetaMask DEBUG]: [Error: KeyringController - Cannot persist vault without password and encryption key]
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 LOG  [MetaMask DEBUG]: Engine Vault back up successful
 INFO  TRACK event saved {"event": "Login Screen Viewed", "properties": {}, "type": "track"}
 INFO  TRACK event saved {"event": "Error occurred", "properties": {"error": true, "errorMessage": "No HD keyring found", "type": "Lockscreen: Authentication failed"}, "type": "track"}
 INFO  TRACK event saved {"event": "Error occurred", "properties": {"error": true, "errorMessage": "No HD keyring found", "type": "Lockscreen: Authentication failed"}, "type": "track"}
 INFO  TRACK event saved {"event": "Error occurred", "properties": {}, "type": "track"}
 INFO  IDENTIFY event saved {"traits": {"Authentication Type": "biometrics"}, "type": "identify", "userId": "73868b3c-0484-4844-8043-0685b332541d"}
 INFO  Sent 15 events

Image

I was not able to reproduce the sending of a transaction error since no tokens were present.

owencraston avatar May 01 '24 00:05 owencraston

Experienced on iPhone Xs with iOS 17.4.1 with biometric authentication:

Steps:

  1. Configured wallet with QA build 7.18.0 (1268).
  2. Used Apple Configurator on Mac to replace .ipa for testing branch.
  3. Added a new HD account
  4. Downloaded and emailed state logs for a separate issue.
  5. Device screen locked due to display timeout.
  6. Upon unlocking, accounts disappeared, and wallet view matched previously described screenshots.

State logs from before and after are available.

Curiously, I am able to connect to the test dapp in this state, and the account that appeared in the connection modal was the last account that I had added before accounts disappeared. However, I was not able to attempt to reproduce the send attempt in the test dapp because the freshly added address does not have any assets at this moment.

plasmacorral avatar May 01 '24 22:05 plasmacorral

Here are the state logs for my device that experienced the issue. 92416936578977.txt

Searching for the keyword error in these logs brings me to errors regarding ICON URLs not being available (not what we are looking for).

Looking at the AccountsController state logs, all of the accounts seem to be in tact.

{
   "internalAccounts":{
      "accounts":{
         "54019396-3ec2-4497-9ff0-c177e4d6b824":{
            "id":"54019396-3ec2-4497-9ff0-c177e4d6b824",
            "address":"0x35b5add26b0397c601826faad37ea6b3dfaf67fe",
            "options":{
               
            },
            "methods":[
               "personal_sign",
               "eth_sign",
               "eth_signTransaction",
               "eth_signTypedData_v1",
               "eth_signTypedData_v3",
               "eth_signTypedData_v4"
            ],
            "type":"eip155:eoa",
            "metadata":{
               "name":"Account 1",
               "keyring":{
                  "type":"HD Key Tree"
               },
               "lastSelected":1714522474791
            }
         }
      },
      "selectedAccount":"54019396-3ec2-4497-9ff0-c177e4d6b824"
   }
}

same for the keyring controller....

{
   "keyrings":[
      {
         "type":"HD Key Tree",
         "accounts":[
            "0x35b5add26b0397c601826faad37ea6b3dfaf67fe"
         ]
      },
      {
         "type":"QR Hardware Wallet Device",
         "accounts":[
            
         ]
      }
   ],
   "isUnlocked":true
}

and same for the PreferencesController.identities

{
   "0x35B5ADD26B0397c601826fAad37eA6B3dfaF67FE":{
      "name":"Account 1",
      "address":"0x35B5ADD26B0397c601826fAad37eA6B3dfaF67FE",
      "importTime":1714523351266
   }
}

owencraston avatar May 02 '24 00:05 owencraston

Given that the controller state seems to be intact (which makes sense since issue is resolved by force reloading the app) this indicates to me that this is a hydration issue.I will investigate more and report back.

owencraston avatar May 02 '24 00:05 owencraston

Just experience this again on the same device as yesterday, but this time I swiped down on wallet view. After doing so, accounts re-appeared.

plasmacorral avatar May 02 '24 20:05 plasmacorral

We are waiting to see if the new Keyring controller updates will have an impact on this. If there is no change in a couple of weeks in regards to this bug, we'll need to come back to this.

AlexJupiter avatar May 14 '24 15:05 AlexJupiter

This is the dependency that needs to get resolved.

AlexJupiter avatar May 20 '24 13:05 AlexJupiter