question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RPC error when using Ganache GUI but not Ganache CLI.

See original GitHub issue

Truffle v5.0.43 Ganache GUI 2.1.2 Metamask 7.6.1 Mac OSX 10.15 Chrome 78.0.3904.108

Using the default truffle react box, if I migrate it onto ganache-cli and then interact with it (via Metamask) it works great. But if I try and do the exact same thing using ganahe-gui the contract deploys fine, but interacting with it fails.

This is the error when I try and interact with the ‘set’ function which happens automatically upon page load:

transact to SimpleStorage.set errored: Error: [ethjs-rpc] rpc error with payload {"id":4054640964707,"jsonrpc":"2.0","params":["0xf88906843b9aca0082a2d494f2b3d44f40c5d9082bfc6855063ca5eae508db6e80a460fe47b10000000000000000000000000000000000000000000000000000000000000003822d46a09924fdd8d1d1e81bc486ade4f28a7c0e62d1d7870fe0d82211e6f3971352fc1ea07fddeb019bb65318edac2dd619ae6df1970f175ffc8465cf41d24109c81841ad"],"method":"eth_sendRawTransaction"} [object Object]

I am using the same ‘chain’ on Metmask for both gui and cli- localhost:8545. Metamask is detecting the chain properly because I can see that I have 100 ether (99.9 after contract deployment). Metmask does not give any errors prior to submitting the tx, it is only when I press Send that it gives me the error. If it wasn’t detecting the chain, I wouldn’t be able to send as I’d have a 0 balance.

Please note that the above error is from remix IDE because metamask doesn’t store the error anywhere, it only appears as a notification.

Steps to reproduce

  1. launch truffle gui, quickstart
  2. truffle unbox react
  3. truffle migrate
  4. cd client
  5. npm run start
  6. Browser opens- asks for metamask password and then permission to connect, I put in password and connect. Then I am asked to sign a tx, which I do, and the above error is seen.

To get the error message within remix:

  1. copy the code of SimpleStorage.sol
  2. change environment to ‘injected web3’
  3. deploy at contract address (taken from ganache gui)
  4. call ‘set’ function with any integer

My truffle-config is as below:

const path = require("path");

module.exports = {
  // See <http://truffleframework.com/docs/advanced/configuration>
  // to customize your Truffle configuration!
  contracts_build_directory: path.join(__dirname, "client/src/contracts"),
  networks: {
    development: {
      host: "127.0.0.1",     // Localhost (default: none)
      port: 8545,            // Standard Ethereum port (default: none)
      network_id: "*",       // Any network (default: none)
      gasPrice: 1000000000, // 1 gwei
    }
  }
};

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nicholasjpaternocommented, Dec 1, 2019

👍 Anytime!

0reactions
mcplumscommented, Dec 1, 2019

Thanks for your help 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

RPC error when interacting with contract using Ganache GUI ...
The answer is: I need to reset metamask between sessions: Settings > advanced > Reset Account. Not sure why this is needed for...
Read more >
Invalid JSON RPC Error #1057 - trufflesuite/ganache-ui - GitHub
Note, the error happens with ganache-cli and the latest version of Ganache GUI, so my belief is that it's a problem with ganache-core....
Read more >
Problems using ganache-cli command - Stack Overflow
Hello! Terminating local RPC client... Share.
Read more >
Ganache CLI - Nethereum Documentation
It allows you to make calls to the blockchain without the overheads of running an actual Ethereum node. Transactions are “mined” instantly. No...
Read more >
HERCone/dev-truffle-ganache - Gitter
I'm setting vmErrorsOnRPCResponse: false, but I am getting the following response via JSON RPC: {'id': 0, 'jsonrpc': '2.0', 'error': {'message': 'VM ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found