MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
11.83k stars 4.82k forks source link

[Sentry] Error: The method does not exist / is not available. #22286

Open sentry-io[bot] opened 8 months ago

sentry-io[bot] commented 8 months ago

Sentry Issue: METAMASK-X7W2

Error: The method does not exist / is not available.
  at new JsonRpcError (node_modules/@metamask/rpc-errors/dist/classes.js:24:1)
  at getJsonRpcError (node_modules/@metamask/rpc-errors/dist/errors.js:176:1)
  at exports.rpcErrors.methodNotFound (node_modules/@metamask/rpc-errors/dist/errors.js:35:1)
  at checkForHttpErrors (node_modules/@metamask/eth-json-rpc-middleware/dist/fetch.js:80:1)
  at <anonymous> (node_modules/@metamask/eth-json-rpc-middleware/dist/fetch.js:47:1)
...
(1 additional frame(s) were not displayed)
vandan commented 7 months ago

This log message should have more detail about which method is not available. From the sentry issue, it's unclear whether this is indeed an error or should just be a warning or informational item.

vandan commented 7 months ago

Re-assigning to Shared Libraries for further assessment. If its found to be an issue with a dapp-facing API issue, then please assign back to us.

adonesky1 commented 7 months ago

Full stack trace:

Error#176: PollingBlockTracker - encountered an error while attempting to update latest block:
{
  "code": -32601,
  "message": "The method does not exist / is not available.",
  "stack": "Error: The method does not exist / is not available.\n    at new o (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-0.js:1:433448)\n    at a (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-0.js:1:436553)\n    at Object.methodNotFound (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-0.js:1:437113)\n    at a (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/background-0.js:7:24534)\n    at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/background-0.js:7:25845\n    at async chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-0.js:1:193619"
}
  at new o (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-0.js:1:433448)
  at a (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-0.js:1:436553)
  at Object.methodNotFound (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-0.js:1:437113)
  at a (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/background-0.js:7:24534)
  at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/background-0.js:7:25845
  at async chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-0.js:1:193619
{
arguments: [
Error#176:, 
PollingBlockTracker - encountered an error while attempting to update latest block:
{
  "code": -32601,
  "message": "The method does not exist / is not available.",
  "stack": "Error: The method does not exist / is not available.\n    at new o (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-0.js:1:433448)\n    at a (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-0.js:1:436553)\n    at Object.methodNotFound (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-0.js:1:437113)\n    at a (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/background-0.js:7:24534)\n    at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/background-0.js:7:25845\n    at async chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-0.js:1:193619"
}
  at new o (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-0.js:1:433448)
  at a (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-0.js:1:436553)
  at Object.methodNotFound (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-0.js:1:437113)
  at a (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/background-0.js:7:24534)
  at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/background-0.js:7:25845
  at async chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-0.js:1:193619
], 
logger: console
}
desi commented 7 months ago

@desi Look for old ticket around this and mark as duplicate once we do.

Gudahtt commented 4 months ago

^ That was a suggestion I made, as I thought this sounded similar to another issue. But I had a look and was unable to find it, so maybe we can't close this as a dupe after all.

Ivan92750 commented 4 months ago

hello. please explain what it is about? what should I do and what is this topic anyway?

Gudahtt commented 3 months ago

It seems like this error would be caused by a user inputting an invalid RPC URL (one that doesn't support eth_blockNumber).

One problem here is that this type of failure should never land in Sentry. But another problem is that the block tracker shouldn't be continuously polling after it encounters an error that we expect to persistently fail.

For that second issue, I wonder if there is a way for the block tracker to indicate that it's in an invalid state (i.e. that polling was stopped).

desi commented 1 month ago

Main issue is that we aren't catching the error and because we aren't catching the error it is showing up in sentry but it shouldn't be.

The second issue is covered in the tech debt doc. Mark will amend the tech debt doc to make sure that case is considered.