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

[Sentry] Error: [ethjs-query] the Eth object requires that the first input 'provider' must be an object, got 'und... #8849

Closed
sentry-io bot opened this issue Mar 5, 2024 · 11 comments
Assignees
Labels
area-Sentry Issue from Sentry regression-prod-7.17.0 Regression bug that was found in production in release 7.17.0 Sev1-high An issue that may have caused fund loss or access to wallet in the past & may still be ongoing team-mobile-platform type-bug Something isn't working

Comments

@sentry-io
Copy link

sentry-io bot commented Mar 5, 2024

Sentry Issue: METAMASK-MOBILE-29PE

Error: [ethjs-query] the Eth object requires that the first input 'provider' must be an object, got 'undefined' (i.e. 'const eth = new Eth(provider);')
  at r (ses.cjs:7575:17)
  at constructor (app/core/Engine.ts:600:32)
  at default.init (app/core/Engine.ts:1190:39)
  at initalizeEngine (app/core/EngineService/EngineService.ts:32:12)
  at onPersistComplete (app/store/index.ts:61:19)
...
(17 additional frame(s) were not displayed)
@sethkfman sethkfman added team-snaps DEPRECATED: Use "team-snaps-platform" or "team-snaps-ecosystem" instead type-bug Something isn't working team-sdk SDK team and removed team-snaps DEPRECATED: Use "team-snaps-platform" or "team-snaps-ecosystem" instead labels Mar 5, 2024
@christopherferreira9
Copy link
Contributor

Hi! I can’t see any reference to WalletConnect other than the init that occurs when launching the wallet. Is there any extra info available?

@metamaskbot metamaskbot changed the title Error: [ethjs-query] the Eth object requires that the first input 'provider' must be an object, got 'und... [Sentry] Error: [ethjs-query] the Eth object requires that the first input 'provider' must be an object, got 'und... Mar 6, 2024
@metamaskbot metamaskbot added area-Sentry Issue from Sentry regression-prod-7.17.0 Regression bug that was found in production in release 7.17.0 labels Mar 6, 2024
@gauthierpetetin gauthierpetetin added the Sev2-normal An issue that may lead to users misunderstanding some limited risks they are taking label Mar 6, 2024
@sethkfman
Copy link
Contributor

Play Console Log

Exception v6.c: Error: [ethjs-query] the Eth object requires that the first input 'provider' must be an object, got 'undefined' (i.e. 'const eth = new Eth(provider);'), js engine: hermes, stack:
Eth@1:2775775
NonceTracker@1:7371352
TransactionController@1:7358673
Engine@1:2709815
init@1:2716810
anonymous@1:5988908
onPersistComplete@1:5708523
rehydrate@1:5776201
_rehydrate@1:5767164
anonymous@1:5767258
anonymous@1:363065
_callTimer@1:362347
callTimers@1:364149
__callFunction@1:266653
anonymous@1:265020
__guard@1:265972
callFunctionReturnFlushedQueue@1:264978
  at com.facebook.react.modules.core.ExceptionsManagerModule.reportException (ExceptionsManagerModule.java:72)
  at java.lang.reflect.Method.invoke
  at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:372)
  at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:188)
  at com.facebook.jni.NativeRunnable.run (NativeRunnable.java)
  at android.os.Handler.handleCallback (Handler.java:971)
  at android.os.Handler.dispatchMessage (Handler.java:107)
  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:27)
  at android.os.Looper.loopOnce (Looper.java:206)
  at android.os.Looper.loop (Looper.java:296)
  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:228)
  at java.lang.Thread.run (Thread.java:1012)

@sethkfman sethkfman added Sev1-high An issue that may have caused fund loss or access to wallet in the past & may still be ongoing and removed Sev2-normal An issue that may lead to users misunderstanding some limited risks they are taking labels Mar 6, 2024
@Cal-L
Copy link
Contributor

Cal-L commented Mar 6, 2024

@christopherferreira9 Digging into a little deeper:

We can see two logs

  • WalletConnectV2::init(), which indicates WCV2 is initializing (indicating it's most likely a cold start from a deeplink)
  • Error: Engine does not exist, which happens when you try to access Engine.context without it being defined

So far, I can see WCV2 being initialized in Nav/App/index.js, which is a flow that is mounted post rehydration (onPersistComplete). At the same time, onPersistComplete is where Engine is initialized. Both happens in parallel and I suspect we're seeing the issue because WCV2 is initializing faster than the Engine being initialized. You can probably reproduce the same error message by wrapping EngineService.initalizeEngine(store); in a timer.

@abretonc7s
Copy link
Contributor

abretonc7s commented Mar 7, 2024

Hey @Cal-L , I was just looking at it with Chris

For the init flow:

  • store initialize
  • onPersistComplete is triggered
  • Engine initializes via EngineService.initalizeEngine(store);
  • ConnectedRoot opens Nav/App/Index.js (after engine has initialized)
  • WalletConnectV2::init() is triggered

I don't think it is wallet connect / sdk related.

Any other ideas?

Copy link
Author

sentry-io bot commented Mar 7, 2024

Sentry Issue: METAMASK-MOBILE-29SX

@Cal-L
Copy link
Contributor

Cal-L commented Mar 8, 2024

@abretonc7s @christopherferreira9 Digging into a bit more, we found that to be the case as well. The WC message is just for initialization. I will reassign this to platform for now. Thanks for the investigation!

@Cal-L Cal-L added team-mobile-platform and removed team-sdk SDK team labels Mar 8, 2024
@metamaskbot metamaskbot added ready-for-dev in-progress needs-qa Any New Features that needs a full manual QA prior to being added to a release. and removed ready-for-dev in-progress labels Mar 8, 2024
@gauthierpetetin
Copy link
Contributor

This is probably related to the crash we're experiencing when upgrading the app to 7.17.0

Copy link
Author

sentry-io bot commented Mar 12, 2024

Sentry Issue: METAMASK-MOBILE-29X4

Copy link
Author

sentry-io bot commented Mar 12, 2024

Sentry Issue: METAMASK-MOBILE-29WC

@metamaskbot metamaskbot added in-progress and removed needs-qa Any New Features that needs a full manual QA prior to being added to a release. labels Mar 12, 2024
Cal-L added a commit that referenced this issue Mar 14, 2024
)

**Description**
Fix to migration 29 with missing tokens related migrations, migration 30
with PPOM enabled by default, migration 31 to help user impacted by
missing migration on 29, migration 32 remove goerli

Also added migration 33, to recover from the crash of the users that the
migration 29 and 30 didn't had effect.

## **Related issues**

Fixes #8849

## **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**

- [ ] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've clearly explained what problem this PR is solving and how it
is solved.
- [ ] I've linked related issues
- [ ] I've included manual testing steps
- [ ] I've included screenshots/recordings if applicable
- [ ] 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-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
- [ ] I’ve properly set the pull request status:
  - [ ] In case it's not yet "ready for review", I've set it to "draft".
- [ ] In case it's "ready for review", I've changed it from "draft" to
"non-draft".

## **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: Cal-L <cleun007@gmail.com>
@Cal-L Cal-L closed this as completed Mar 14, 2024
Copy link
Author

sentry-io bot commented Mar 15, 2024

Sentry Issue: METAMASK-MOBILE-2A8V

Copy link
Author

sentry-io bot commented Mar 15, 2024

Sentry Issue: METAMASK-MOBILE-2A8C

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Sentry Issue from Sentry regression-prod-7.17.0 Regression bug that was found in production in release 7.17.0 Sev1-high An issue that may have caused fund loss or access to wallet in the past & may still be ongoing team-mobile-platform type-bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

7 participants