Metamask-extension: Kovan - eth_call fails due to non-standard key in req

Created on 25 Jan 2018  路  18Comments  路  Source: MetaMask/metamask-extension

Good morning,
I'm experiencing an error when calling a contract public method, this is done when trying to import a Multisig Contract in https://wallet.gnosis.pm using Kovan
Add wallet > restore > 0x2e52603770bce8d4286c325df141c7f74c5a39b2 > ok

  • Actual behaviour
    Get this error:
Error: Invalid request
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:90976:44
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:65263:9
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:12364:16
at next (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:17206:29)
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:12849:16
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:12364:16
at replenish (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:12884:25)
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:12893:9
at eachLimit$1 (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:15073:24)
at Object. (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:12923:16)
at RpcEngine._runReturnHandlersUp (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:65357:13)
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:65275:22
at nextTask (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:17201:14)
at next (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:17208:9)
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:12849:16
at checkForCompletion (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:65294:16)
at nextTask (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:17201:14)
at next (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:17208:9)
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:12849:16
at completeRequest (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:65348:9)
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:13017:9
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:12364:16
at replenish (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:12884:25)
at iterateeCallback (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:12874:17)
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:12849:16
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:13014:13
at end (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:65333:11)
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:54443:9
at d (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:8300:26)
  • Browser Used: Chrome 63
  • Operating System Used: MacOS 10.13

Note: With older version metamask it works, the function called is https://github.com/gnosis/MultiSigWallet/blob/master/contracts/MultiSigWallet.sol#L24

Thanks,

All 18 comments

the same error...

when i try to call contract method call, in all functions i get this error.

I'm also getting this error on every contract call.

Ran a simple test trying to deploy a simple contract through browser-solidity onto Kovan. The same error is given. Deploying the same contract onto Rinkeby goes through correctly.

Network: Kovan
Browser: Chrome 63
OS: macOS 10.12.6

I have the same issue.

Browser: Chrome 63
MetaMask: 3.13.7

The same issue..

+1 (metaMask: 3.13.7).
Fixed after rollback to the prev. version (3.13.6)
https://github.com/MetaMask/metamask-extension/releases

Same, calling a contract variable on kovan

Is anyone experiencing this on a different network than kovan?

issue has been diagnosed:
infura uses parity only for kovan, so there are some differences from geth

we append a non-standard origin key to the request params which parity rejects as Invalid request.

can be reproduced with

curl 'https://api.infura.io/v1/jsonrpc/kovan' -H 'pragma: no-cache' -H 'origin: null' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: en-US,en;q=0.9' -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36' -H 'content-type: application/json' -H 'accept: application/json' -H 'cache-control: no-cache' -H 'authority: api.infura.io' --data-binary '{"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0x8385b6e21c97258a25c901189ca8cd2ec951ff7d","data":"0x70a0823100000000000000000000000027f880d10656e2ce1a83dd0f9d2b0f8dbc9ed2bc"},"latest"],"id":1600634549,"origin":"tokenfactory.surge.sh"}' --compressed

fixed in [email protected], will pull into metamask soon

Thanks @kumavis

Published, should auto-update soon.

Was this fixed? I'm experiencing the same now.

Denying load of chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/background.js. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension. errors.js:38 Uncaught (in promise) Error: Error: Error: [ethjs-rpc] rpc error with payload {"id":7178096065713,"jsonrpc":"2.0","params":

index.js:2429 GET chrome-extension://invalid/ 0 () _callee$ @ index.js:2429 tryCatch @ index.js:2616 invoke @ index.js:2850 prototype.(anonymous function) @ index.js:2668 step @ index.js:2493 (anonymous) @ index.js:2493 (anonymous) @ index.js:2493 (anonymous) @ index.js:2452 _callee2$ @ index.js:2421 tryCatch @ index.js:2616 invoke @ index.js:2850 prototype.(anonymous function) @ index.js:2668 step @ index.js:2493 (anonymous) @ index.js:2493 (anonymous) @ index.js:2493 map @ index.js:2489 getStackFrames @ index.js:2270 crashWithFrames @ index.js:1927 (anonymous) @ index.js:1945 rejectionHandler @ index.js:2041 funds:1 Denying load of chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/sourcemaps/inpage.js.map. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension. index.js:885 GET chrome-extension://invalid/ 0 ()

Denying load of chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/background.js. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension.

p.s. I'm connecting metamask to local ganache now. If I disable metamask it run fine if I connect to local node directly without metamask.

I am still getting "Denying load of chrome-extension..." using my local geth client. I am using React and Web3.

The code I use to get my web3 instance is:

 import Web3 from "web3";    
  const getWeb3 = () =>
  new Promise((resolve, reject) => {
    // Wait for loading completion to avoid race conditions with web3 injection timing.
    window.addEventListener("load", async () => {
      console.log("Loading Web3...");
      // Modern dapp browsers...
      if (window.ethereum) {
        console.log("Modern dapp browser detected!");
        const web3 = new Web3(window.ethereum);
        try {
          // Request account access if needed
          await window.ethereum.enable();
          // Acccounts now exposed
          resolve(web3);
        } catch (error) {
          reject(error);
        }
      }
      // Legacy dapp browsers...
      else if (window.web3) {
        // Use Mist/MetaMask's provider.
        const web3 = window.web3;
        console.log("Injected web3 detected (Mist/MetaMask).");
        resolve(web3);
      }
      // Fallback to localhost; use dev console port by default...
      else {
        const provider = new Web3.providers.HttpProvider(
          "http://127.0.0.1:8545"
        );
        const web3 = new Web3(provider);
        console.log("No web3 instance injected, using Local web3 (http://127.0.0.1:8545).");
        resolve(web3);
      }
    });
  });

export default getWeb3;

NOTES:
1) The first strange thing is that => if (window.ethereum) returns true so it's not using window.web3.
2) await window.ethereum.enable(); works fine, I see the popup window and I can accept.
3) when it gets here it throws the error:
// Acccounts now exposed
resolve(web3);

image

Uncaught (in promise) DOMException: Failed to execute 'postMessage' on 'Window': function 
(error, response) {
        if (!error) {
          resolve(response);
        }

    ...<omitted>... } could not be cloned.
at i._write (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:117661)


Denying load of chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/sourcemaps/inpage.js.map. Resources must be 
listed in the web_accessible_resources manifest key in order to be loaded by pages outside the 
extension.

GET chrome-extension://invalid/ net::ERR_FAILED

I experienced this in two projects I worked on, I tried different things without any luck. What I end up doing is to disable Metamask to move forward with development. I would appreciate any help/guidance you could provide. Thanks!!

I'm having the same problem, but I can't identify the origins of it. @Juan-cc did you ever solve this?

Was this page helpful?
0 / 5 - 0 ratings