Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Account Id [UUID] not found #26377

Closed
sentry-io bot opened this issue Aug 12, 2024 · 10 comments · Fixed by MetaMask/core#4623, #26573 or #27364
Closed

Error: Account Id [UUID] not found #26377

sentry-io bot opened this issue Aug 12, 2024 · 10 comments · Fixed by MetaMask/core#4623, #26573 or #27364
Assignees
Labels
needs-reproduction regression-prod-11.9.0 Regression bug that was found in production in release 11.9.0 release-12.4.0 Issue or pull request that will be included in release 12.4.0 release-12.6.0 Issue or pull request that will be included in release 12.6.0 Sev1-high High severity; partial loss of service with severe impact upon users, with no workaround. team-accounts type-bug

Comments

@sentry-io
Copy link

sentry-io bot commented Aug 12, 2024

Sentry Issue: METAMASK-X8QE

Error: Account Id eb211bb2-16eb-4054-8595-17bd83bc8847 not found
  at new MetamaskController (app/scripts/metamask-controller.js:878:50)
  at setupController (app/scripts/background.js:516:16)
  at initialize (app/scripts/background.js:294:5)

This is still happening in v12.0.1.

Duplicate issue with interesting context: #26623

@Gudahtt Gudahtt changed the title Error: Account Id eb211bb2-16eb-4054-8595-17bd83bc8847 not found Error: Account Id [UUID] not found Aug 12, 2024
@Gudahtt Gudahtt added type-bug Sev1-high High severity; partial loss of service with severe impact upon users, with no workaround. team-accounts labels Aug 12, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by severity Aug 12, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by team Aug 12, 2024
@Gudahtt Gudahtt added the regression-prod-11.9.0 Regression bug that was found in production in release 11.9.0 label Aug 12, 2024
@Gudahtt
Copy link
Member

Gudahtt commented Aug 12, 2024

I found two places in AccountsController where this error might be triggered. The first was resolved already in MetaMask/core#4322, but those changes aren't used yet in v12.0.1.

The second place is the updateAccounts method of AccountsController. It does not correctly update the selectedAccount state when the selected account is removed.

@gantunesr
Copy link
Member

Opening the issue again since the fix is not in the client yet

@gantunesr gantunesr reopened this Aug 20, 2024
@github-project-automation github-project-automation bot moved this from Fixed to To be fixed in Bugs by team Aug 20, 2024
montelaidev added a commit that referenced this issue Aug 22, 2024
…Account (#26573)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

This PR bumps the `AccountsController` and introduces a new migration.
The `updateAccounts` methods from the `AccountsController` now checks if
the selectedAccount is undefined and recovers from this. The migration
updates the selectedAccount values that are not defined.

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26573?quickstart=1)

## **Related issues**

Fixes: #26377

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by team Aug 22, 2024
@metamaskbot metamaskbot added the release-12.5.0 Issue or pull request that will be included in release 12.5.0 label Aug 22, 2024
montelaidev added a commit that referenced this issue Aug 22, 2024
…Account (#26573)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

This PR bumps the `AccountsController` and introduces a new migration.
The `updateAccounts` methods from the `AccountsController` now checks if
the selectedAccount is undefined and recovers from this. The migration
updates the selectedAccount values that are not defined.

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26573?quickstart=1)

Fixes: #26377

1. Go to this page...
2.
3.

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

<!-- [screenshots/recordings] -->

<!-- [screenshots/recordings] -->

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Gudahtt added a commit that referenced this issue Aug 29, 2024
## **Description**

Migration 121.1 has been updated to include more state validation, so
that it does not throw an error in the event that state is corrupted in
some unexpected way. Unexpected corrupted state is now reported to
Sentry as well.


[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26773?quickstart=1)

## **Related issues**

Related: #26377

## **Manual testing steps**

The unit tests outline the scenarios that the added validation are meant
to cover. Probably not worth anyone's time to manually test those.

To test the migration in general though, here are the steps:

* Create a dev build from v12.1.0
* Install the dev build from the `dist/chrome` directory and proceed
through onboarding
* Run this command in the background console: ```
chrome.storage.local.get( null, (state) => {
state.data.AccountsController.internalAccounts.selectedAccount =
'unknown id';
chrome.storage.local.set(state, () => chrome.runtime.reload()); } ); ```
  * The extension should now be in a broken state
* Note that you can use this same script to corrupt state in other ways
to test other scenarios
* Disable the extension
* Switch to this branch and create a dev build
* Enable and reload the extension
* You should see in the console that migration 121.1 has run without
error
* You can run `chrome.storage.local.get(console.log)` to check that the
AccountsController state is now valid
  * The extension should no longer be broken

## **Screenshots/Recordings**

N/A

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
owencraston pushed a commit that referenced this issue Aug 29, 2024
## **Description**

Migration 121.1 has been updated to include more state validation, so
that it does not throw an error in the event that state is corrupted in
some unexpected way. Unexpected corrupted state is now reported to
Sentry as well.


[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26773?quickstart=1)

## **Related issues**

Related: #26377

## **Manual testing steps**

The unit tests outline the scenarios that the added validation are meant
to cover. Probably not worth anyone's time to manually test those.

To test the migration in general though, here are the steps:

* Create a dev build from v12.1.0
* Install the dev build from the `dist/chrome` directory and proceed
through onboarding
* Run this command in the background console: ```
chrome.storage.local.get( null, (state) => {
state.data.AccountsController.internalAccounts.selectedAccount =
'unknown id';
chrome.storage.local.set(state, () => chrome.runtime.reload()); } ); ```
  * The extension should now be in a broken state
* Note that you can use this same script to corrupt state in other ways
to test other scenarios
* Disable the extension
* Switch to this branch and create a dev build
* Enable and reload the extension
* You should see in the console that migration 121.1 has run without
error
* You can run `chrome.storage.local.get(console.log)` to check that the
AccountsController state is now valid
  * The extension should no longer be broken

## **Screenshots/Recordings**

N/A

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
montelaidev added a commit that referenced this issue Aug 30, 2024
…Account (#26573)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

This PR bumps the `AccountsController` and introduces a new migration.
The `updateAccounts` methods from the `AccountsController` now checks if
the selectedAccount is undefined and recovers from this. The migration
updates the selectedAccount values that are not defined.

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26573?quickstart=1)

Fixes: #26377

1. Go to this page...
2.
3.

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

<!-- [screenshots/recordings] -->

<!-- [screenshots/recordings] -->

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
chloeYue pushed a commit that referenced this issue Aug 30, 2024
## **Description**

This PR cherry picks two improvements to the latest accounts controller
migrations into the latest release.
- #26742
- #26773

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26778?quickstart=1)

## **Related issues**

Fixes: #26377

## **Manual testing steps**


## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

---------

Co-authored-by: Monte Lai <monte.lai@consensys.net>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
montelaidev added a commit that referenced this issue Aug 30, 2024
…Account (#26573)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

This PR bumps the `AccountsController` and introduces a new migration.
The `updateAccounts` methods from the `AccountsController` now checks if
the selectedAccount is undefined and recovers from this. The migration
updates the selectedAccount values that are not defined.

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26573?quickstart=1)

Fixes: #26377

1. Go to this page...
2.
3.

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

<!-- [screenshots/recordings] -->

<!-- [screenshots/recordings] -->

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
@Gudahtt
Copy link
Member

Gudahtt commented Sep 5, 2024

We're still seeing this on v12.1.3

Copy link
Author

sentry-io bot commented Sep 10, 2024

Sentry Issue: METAMASK-XBSZ

Copy link
Author

sentry-io bot commented Sep 10, 2024

Sentry Issue: METAMASK-XATW

Copy link
Author

sentry-io bot commented Sep 10, 2024

Sentry Issue: METAMASK-XA1N

@gauthierpetetin
Copy link
Contributor

Duplicate issue with interesting context: #26623

@gauthierpetetin
Copy link
Contributor

Hi @gantunesr , kindly following up on this issue: what are the next steps identified for resolution?

@gauthierpetetin gauthierpetetin added release-12.4.0 Issue or pull request that will be included in release 12.4.0 and removed release-12.5.0 Issue or pull request that will be included in release 12.5.0 labels Sep 11, 2024
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by team Oct 9, 2024
@danroc
Copy link
Contributor

danroc commented Oct 14, 2024

The current PR partially solves the problem: the user will be able to log into the extension but it doesn't recover the accounts (if they went missing).

@ccharly ccharly reopened this Oct 15, 2024
@github-project-automation github-project-automation bot moved this from Fixed to To be fixed in Bugs by team Oct 15, 2024
@legobeat
Copy link
Contributor

That must be a GH bug behind my "marked as completed", no idea how that come together.

github-merge-queue bot pushed a commit that referenced this issue Oct 21, 2024
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

This PR introduces a new migration that updates the `selectedAccount` to
the first account if available or the default state.

## **Related issues**

Fixes: #26377

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

---------

Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net>
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by team Oct 21, 2024
@metamaskbot metamaskbot added the release-12.8.0 Issue or pull request that will be included in release 12.8.0 label Oct 21, 2024
@gauthierpetetin gauthierpetetin added release-12.6.0 Issue or pull request that will be included in release 12.6.0 and removed release-12.8.0 Issue or pull request that will be included in release 12.8.0 labels Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-reproduction regression-prod-11.9.0 Regression bug that was found in production in release 11.9.0 release-12.4.0 Issue or pull request that will be included in release 12.4.0 release-12.6.0 Issue or pull request that will be included in release 12.6.0 Sev1-high High severity; partial loss of service with severe impact upon users, with no workaround. team-accounts type-bug
Projects
Archived in project
9 participants