Skip to content

Fix undefined accountId property that is causing an Engine failure during initialization #14276

Open
@Cal-L

Description

@Cal-L

What is this about?

We are continuing to see instances of Sentry errors where it shows that Engine is not found. There are currently two variants of the issue that we believe are caused by the same root issue. In one instance, Engine is not found when NetworkController is being accessed, while in the other, KeyringController is being accessed when Engine is not found:

Diving into their stack traces. Ex: https://metamask.sentry.io/issues/trace/94c89e86313d4860971193ff0d352bb7/?environment=production&groupId=6463179230&node=error-21e301158800481db25188e99925cd3d&pageEnd=2025-03-28T05%3A21%3A22.734&pageStart=2025-03-27T05%3A21%3A22.734&project=2299799&query=is%3Aunresolved%20issue.priority%3A%5Bhigh%2C%20medium%5D%20dist%3A1637%20engine%20does%20not%20exist&referrer=issue-stream&sort=date&source=issue_details&stream_index=2&timestamp=1743096082, we can see that in both cases, the underlying error being thrown during Engine.init is accountId being undefined. Furthermore, the error throws in the AccountsController. Lastly, there has been past suspicions that the error is thrown when another controller is using the AccountsController methods.

Some more investigative work is needed to get to the bottom of this issue. Below are some steps to take to get there:

  • Collect and record all of the areas where accountId is set on the AccountsController. Record this in a document and attach the link to this issue
  • Add logs to these areas whenever the value being set is undefined
  • See if there are common errors occurring on Extension - Can indicate an issue related to controller interactions between controllers
  • BONUS - Fix area if it's obvious and identified

Scenario

No response

Design

No response

Technical Details

  • Collect and record all of the areas where accountId is set on the AccountsController. Record this in a document and attach the link to this issue
  • Add logs to these areas whenever the value being set is undefined
  • See if there are common errors occurring on Extension - Can indicate an issue related to controller interactions between controllers
  • BONUS - Fix area if it's obvious and identified

Threat Modeling Framework

No response

Acceptance Criteria

These are performed

  • Collect and record all of the areas where accountId is set on the AccountsController. Record this in a document and attach the link to this issue
  • Add logs to these areas whenever the value being set is undefined
  • See if there are common errors occurring on Extension - Can indicate an issue related to controller interactions between controllers
  • BONUS - Fix area if it's obvious and identified

Stakeholder review needed before the work gets merged

  • Engineering (needed in most cases)
  • Design
  • Product
  • QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
  • Security
  • Legal
  • Marketing
  • Management (please specify)
  • Other (please specify)

References

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions