Metamask-extension: [ethjs-rpc] rpc error with payload - Error: Replacement transaction underpriced

Created on 5 Jan 2018  路  9Comments  路  Source: MetaMask/metamask-extension

Hi

I have been trying all morning to send some ERC20 tokens from my Metamask wallet using MyEtherWallet.com and I have been always receiving the below error message.

Can anyone please help

Error: Error: [ethjs-rpc] rpc error with payload {"id":xxx,"jsonrpc":"2.0","params":["xxx"],"method":"eth_sendRawTransaction"} Error: replacement transaction underpriced at Object.InvalidResponse (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:14335:28098) at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:14335:60527 at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:9909:9 at completeRequest (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:9960:9) at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:683:16 at replenish (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:1203:25) at iterateeCallback (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:1193:17) at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:1168:16 at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:9837:7 at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:9933:18

N02-needsReproduction P2-sooner question

All 9 comments

Yes! i have te same problem! please help!

Anyone to help on this please?! I have been unable to send any tx for the last couple of days and it is frustrating...
Regards

Can you please provide us with state logs according to https://github.com/MetaMask/faq/blob/master/LOGS.md?

Thank you for your patience!

I've got the same problem, too. And here's the console in Chrome. Hope that it can help. @Zanibas

[ethjs-rpc] rpc error with payload {"id":7688448862969,"jsonrpc":"2.0","params":["0xf8ac198504a817c80083012e5f94345ca3e014aaf5dca488057592ee47305d9b3e1080b844a9059cbb000000000000000000000000c5fdf4076b8f3a5357c5e395ab970b5b54098fef00000000000000000000000000000000000000000000000000000000000007d0822d46a03f9eff51715f33d94d5b1088b70bbcf4c0366797a3200f7b8381fbf7c63c4bfda02226b37e2e8a3d310de219d67a678365e18683dcd2b5c7c488b09f9856eecd3e"],"method":"eth_sendRawTransaction"} Error: Error: the tx doesn't have the correct nonce. account has nonce of: 4 tx has nonce of: 25
    at runCall (/Applications/Ganache.app/Contents/Resources/app/node_modules/ganache-cli/build/lib.node.js:66266:10)
    at /Applications/Ganache.app/Contents/Resources/app/node_modules/ganache-cli/build/lib.node.js:13427:24
    at replenish (/Applications/Ganache.app/Contents/Resources/app/node_modules/ganache-cli/build/lib.node.js:10559:17)
    at iterateeCallback (/Applications/Ganache.app/Contents/Resources/app/node_modules/ganache-cli/build/lib.node.js:10544:17)
    at /Applications/Ganache.app/Contents/Resources/app/node_modules/ganache-cli/build/lib.node.js:10519:16
    at /Applications/Ganache.app/Contents/Resources/app/node_modules/ganache-cli/build/lib.node.js:13432:13
    at /Applications/Ganache.app/Contents/Resources/app/node_modules/ganache-cli/build/lib.node.js:62474:16
    at replenish (/Applications/Ganache.app/Contents/Resources/app/node_modules/ganache-cli/build/lib.node.js:62421:25)
    at /Applications/Ganache.app/Contents/Resources/app/node_modules/ganache-cli/build/lib.node.js:62430:9
    at eachLimit (/Applications/Ganache.app/Contents/Resources/app/node_modules/ganache-cli/build/lib.node.js:62354:36)
    at /Applications/Ganache.app/Contents/Resources/app/node_modules/ganache-cli/build/lib.node.js:63534:16
    at VM.AsyncEventEmitter.emit (/Applications/Ganache.app/Contents/Resources/app/node_modules/ganache-cli/build/lib.node.js:62125:3)

Hi

I've got the same problem.
I uninstalled metamask, created new account etc...

The problem is not resolved.

I have the same problem in Ropsten, the plugin assume 0 as gasprice by default . It must be 1 at least

For some reason metamask seems to be unable to determine gasPrice and it does not let you to manually setup the gasprice. (using Rinkeby testnetwork)

Unable to send any transaction with metamask at all.

you can manually edit the gas price and limit from the advanced options in the transaction fee

I had this problem and finally solved it.

The problem is a refresh issue when you change from one Ganache account to another on Metamask. If you do no do a corresponding code refresh in your App.js you will have a null somewhere that results in this error.

In my case for a DApp that buys and sells items, after selling an item successfully when connected to ganache account 0 (coinbase account) on MetaMask, I sell the item, and then switch to Ganache account 1 (or any other ganache account) to buy the Item just sold. Now I kept getting this error and it was bad. On checking my code, i found the from account: App.account was pointed to 0x0 by default and was probably not refreshed after changing Ganache accounts on Metamask (even though you refresh on the browser physically), you need to ensure there is a code refresh to reload items. So you need to rerun your displayAccount function to refresh App.account and ensure it is not null and this Solves the problem: See my code:

        App.displayAccountInfo(); //I had to add this line before the buyItem method could work

        const transactionReceipt = await itemStoreInstance.buyItem(
            _itemId, {
                from: App.account,  // This was the cause and null until I called displayAccountInfo
                value: _price,
                gas: 5000000
            }
        ).on("transactionHash", hash => {
            console.log("transaction hash", hash);
        });

The display account simply recalls eth.getAccounts after you have changed to a different Ganache account on Metamask and assigns this to App.account: see below:

displayAccountInfo: async () => {
    const accounts = await window.web3.eth.getAccounts();
    App.account = accounts[0];
    $('#account').text(App.account);
    const balance = await window.web3.eth.getBalance(App.account);
    $('#accountBalance').text(window.web3.utils.fromWei(balance, "ether") + " ETH");
},

Apply this to the context of your problem, look for where the null is, and it will solve the problem

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kumavis picture kumavis  路  3Comments

kumavis picture kumavis  路  3Comments

whyrusleeping picture whyrusleeping  路  3Comments

aecc picture aecc  路  3Comments

rossbulat picture rossbulat  路  3Comments