Metamask-extension: Newer version of matamask throws errors when sending transaction.

Created on 5 Sep 2017  ·  22Comments  ·  Source: MetaMask/metamask-extension

I have two versions of metamask chrome extensions. 3.5.2 and 3.9.11.
I'm currently running private geth node Version: 1.6.7-stable

I can process transactions with older version of metamask, but when I switch to newer I get this error.
The message comes instantaneously, every time.

[ethjs-rpc] rpc error with payload {"id":7663982154336,"jsonrpc":"2.0","params":["0xf86b808504a817c800833d090094001a4039eed5a5099b2bd25085b48ef137902be38084be9a65558207f2a0aff9e56abb6bbeee508bf3fc3918176df97ae118b24bf78d90a9edb762900c1fa0649f391910b82dc97f3259f0d781dde56bf1ed710d5723eeea8fc63bb351a48d"],"method":"eth_sendRawTransaction"} Error: invalid sender

Most helpful comment

You need to make sure you specify both networkId and chainId and they are the same values.

Using an older MetaMask works because we lacked the EIP155 security feature back then.

All 22 comments

This seems to be a duplicate of #1999, will be working to fix this soon there.

The "invalid sender" error generally occurs because Metamask uses EIP 155 transaction signing, and your private network isn't supporting it.

Make sure that the genesis block for your private network is set up with the proper "config" parameters: https://github.com/ethereum/go-ethereum/wiki/Private-network . In particular, you will want to make sure that eip155block is set to 0.

I'm able to get it to work when I'm connecting to ropsten from Metamask. Thanks for the pointer.
However after following steps of the genesis file you have pointed, problem still persists. I also tried to connect to http://localhost:8545 from metamask on my machine while geth was connecting to ropsten. This didn't work either. It seems like the problem is while connecting to localhost regardless off where localhost is pointing to.

Anyway I'm glad that it works in the settings which users will find themselves.

Can this be related to running geth with --dev? Recently i've started using this option and MetaMask stopped working.

I'm having the same issue. My current genesis block is like this:

{
  "config": {
    "chainId": 54723,
    "homesteadBlock": 0,
    "eip150Block": 0,
    "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "eip155Block": 0,
    "eip158Block": 0,
    "clique": {
      "period": 5,
      "epoch": 30000
    }
  },

I'm using geth 1.7.1

Suggestions? Shouldn't this be reopened or is it really related to #1999?

Following @win2win note: I installed v3.5.1 and works.

You need to make sure you specify both networkId and chainId and they are the same values.

Using an older MetaMask works because we lacked the EIP155 security feature back then.

@flyswatter Thanks Dan! I'll try that. Pity I'll be missing this year's Devcon... would be great to see you all there!

Yeah, I'll actually be missing it too, so we'll just have to keep attending things :)

I've had the same issue, but specifying config.eip155block and networkId that is equal to config.chainId actually helped, thanks @danfinlay!

I've created a repo containing a pre-initialized dev chain that works with MetaMask, just in case it would save someone time configuring this.

However, it seems that, for some reason, truffle-contract in my Dapp doesn't resolve promises of transactions when pointed to MetaMask's provider, even though MetaMask shows these transactions as completed and I can see them recorded to the blockchain. This reproduces both on my local dev net and on Ropsten test net. But this is a different issue, I guess (probably related to #2426).

@skozin Why specifying config.eip155block and networkId equal to config.chainId makes it work..? I couldn't guess any reason for it.

@nujabes403 config.eip155block helps because it enables EIP 155 transaction signing, which Metamask uses. I don't know why it doesn't work when networkId is not the same as config.chainId.

@skozin & @danfinlay 👍 Confirmed. it works like a charm when networkId is equal to config.chainId.

@skozin it solved my problem!

UPDATE:: ignore, I reinstalled my MM as well as rebuilt docker images and things are working now.

Can someone help please? I'm getting same errors but have tried everything mentioned in this thread without success.

Here's a screenshot showing that my chainid and networkid are the same.

> admin.nodeInfo
{
  enode: "enode://15c14ef0690fe92f187e5eac07ef2c94afc597fd333d0f07b569f4cae2aecc50f56c685af8abe5283a36811e4d288928b8f3bc1f2c64eb9c7918a054ae52c7ea@[::]:30303",
  id: "15c14ef0690fe92f187e5eac07ef2c94afc597fd333d0f07b569f4cae2aecc50f56c685af8abe5283a36811e4d288928b8f3bc1f2c64eb9c7918a054ae52c7ea",
  ip: "::",
  listenAddr: "[::]:30303",
  name: "Geth/v1.8.14-stable-316fc7ec/linux-amd64/go1.10.3",
  ports: {
    discovery: 30303,
    listener: 30303
  },
  protocols: {
    eth: {
      config: {
        byzantiumBlock: 4,
        chainId: 993,
        clique: {...},
        eip150Block: 0,
        eip150Hash: "0x0000000000000000000000000000000000000000000000000000000000000000",
        eip155Block: 0,
        eip158Block: 0,
        homesteadBlock: 0
      },
      difficulty: 157,
      genesis: "0x62f58463e4612edb857fd89e9e0658f603936ea73b3ddf3ae0e26389bd23ba54",
      head: "0x99544057225eb6b4b18a3ee3a57b3eb921b99a170dd62ce33ef763dbd3e9c4e6",
      network: 993
    }
  }
}

And here you can see I've set eip155Block in my genesis to 0.

root@geth-dev-miner-3:/opt# cat genesis.json
{
  "config": {
    "chainId": 993,
    "homesteadBlock": 0,
    "eip150Block": 0,
    "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "eip155Block": 0,
    "eip158Block": 0,
    "byzantiumBlock": 4,
    "clique": {
      "period": 15,
      "epoch": 30000
    }
  },

I'm getting the following error when executing the set function of the Truffle SimpleStorage example contract

{code: -32603, message: "Error: Error: [ethjs-rpc] rpc error with payload {…":"eth_sendRawTransaction"} Error: invalid sender"}
code
:
-32603
message
:
"Error: Error: [ethjs-rpc] rpc error with payload {"id":9541115724430,"jsonrpc":"2.0","params":["0xf88904843b9aca0082f42794309cb2ad217b3d673f53d404369234c5e51e884480a460fe47b1000000000000000000000000000000000000000000000000000000000000002a82040ba0545b3083a98e9d1af479b9e9b31a4df31745831398fa35d02e84fed9d0bbc4eca0272472ba63ce76271023b73f7b82bd187949d3d11f1f1c720087862660a026fb"],"method":"eth_sendRawTransaction"} Error: invalid sender"

Getting this error too, it's hurting my brain because I've tried everything. It went away for a few days and now it's back

@waylandc@JacobCooley

  • Step First:
    This comment by skozin and the files in the repo he provided help me to fix the
    problem:

https://github.com/MetaMask/metamask-extension/issues/2015#issuecomment-345405915

Basically, make sure to set in the genesis.conf :

eip155Block:0 and chainId equals to the networkId (used with geth)

  • Step Second:
    if you had fixed the problem mentioned above (the problem mentioned in Step First), then it Most likely is you start local network in a wrong way like:
geth --ipcpath test-chain-directory/geth.ipc --datadir test-chain-directory --dev --rpc --rpccorsdomain "*" console

you should cut the --dev off! Because using Geth with the 'dev' flag to avoid needing a genesis block and a DAG, you should start your local network Like below:

geth --ipcpath test-chain-directory/geth.ipc --datadir test-chain-directory --rpc --rpccorsdomain "*" 

Good luck!

@danfinlay Hello, sir. Can you tell me how to set the chainID is equal to networkID when I use truffle, ganache ang metamask as develop tool. I only know I can set networkID in 'truffle-config.js', but I cannot find where chainID is. Thanks for your kind help!

@danfinlay I also used truffle, ganache & metamask as a development tool, and now I'm facing a similar issue, and I can't determine exactly the main problem and what the source of this error.

MetaMask - RPC Error: Internal JSON-RPC error. {code: -32603, message: "Internal JSON-RPC error.", data: {…}, stack: "Error: Error: [ethjs-rpc] rpc error with payload {…method":"eth_sendRawTransaction"} [object Object]"}

@LikeYears You should be able to just set the --networkId flag in ganache-cli to set the chainId also.

@bayanhd
Please open a new issue for the error you are encountering, with detailed instructions on reproducing the issue, ideally a sample dapp that our team can visit and try.

@bayanhd Were you able to solve the issue?

I resolved the issue. check admin.nodeInfo if your chain id and network id is different you have a problem. I restarted geth in 10 mins with new genesis and got it working in metamask

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aakilfernandes picture aakilfernandes  ·  3Comments

whyrusleeping picture whyrusleeping  ·  3Comments

BassBauman picture BassBauman  ·  3Comments

DISC30 picture DISC30  ·  3Comments

MarkOSullivan94 picture MarkOSullivan94  ·  3Comments