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.

ganache-cli 6.7.0 - Could not connect to your Ethereum client with the following parameters

See original GitHub issue

Hi Team,

Our travis tests are running on ganache-cli version 6.7.0. ganache-cli is behaving strangely. Issue we are facing is that ganache is getting killed abruptly. After restarting the build multiple times, test passes. Below is the build url: https://travis-ci.org/mosaicdao/mosaic-1/builds/620642401

{ Error: 
Could not connect to your Ethereum client with the following parameters:
    - host       > localhost
    - port       > 8545
    - network_id > 1575468748758
Please check that your Ethereum client:
    - is running
    - is accepting RPC connections (i.e., "--rpc" option is used in geth)
    - is accessible over the network
    - is properly configured in your Truffle configuration file (truffle-config.js)
    at ProviderError.ExtendableError (/home/travis/build/mosaicdao/mosaic-1/node_modules/truffle/build/webpack:/packages/error/index.js:10:1)
    at new ProviderError (/home/travis/build/mosaicdao/mosaic-1/node_modules/truffle/build/webpack:/packages/provider/error.js:12:1)
    at /home/travis/build/mosaicdao/mosaic-1/node_modules/truffle/build/webpack:/packages/provider/wrapper.js:75:1
    at /home/travis/build/mosaicdao/mosaic-1/node_modules/truffle/build/webpack:/packages/provider/wrapper.js:107:1
    at XMLHttpRequest.request.onreadystatechange (/home/travis/build/mosaicdao/mosaic-1/node_modules/truffle/build/webpack:/~/web3-providers-http/src/index.js:102:1)
    at XMLHttpRequestEventTarget.dispatchEvent (/home/travis/build/mosaicdao/mosaic-1/node_modules/truffle/build/webpack:/~/xhr2-cookies/dist/xml-http-request-event-target.js:34:1)
    at XMLHttpRequest._setReadyState (/home/travis/build/mosaicdao/mosaic-1/node_modules/truffle/build/webpack:/~/xhr2-cookies/dist/xml-http-request.js:208:1)
    at XMLHttpRequest._onHttpRequestError (/home/travis/build/mosaicdao/mosaic-1/node_modules/truffle/build/webpack:/~/xhr2-cookies/dist/xml-http-request.js:349:1)
    at ClientRequest.<anonymous> (/home/travis/build/mosaicdao/mosaic-1/node_modules/truffle/build/webpack:/~/xhr2-cookies/dist/xml-http-request.js:252:47)
    at emitOne (events.js:116:13)
    at ClientRequest.emit (events.js:211:7)
    at Socket.socketErrorListener (_http_client.js:401:9)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at emitErrorNT (internal/streams/destroy.js:73:8)
    at _combinedTickCallback (internal/process/next_tick.js:139:11)
    at process._tickCallback (internal/process/next_tick.js:181:9)

Below is the truffle config:

module.exports = {
  networks: {
    development: {
      host: 'localhost',
      network_id: '*',
      port: 8545,
      gas: 12000000,
      gasPrice: 0x01,
    },
  },
  compilers: {
    solc: {
      version: '0.5.8',
      settings: {
        optimizer: {
          enabled: true,
          runs: 200,
        },
      },
    },
  },
  mocha: {
    enableTimeouts: false
  },
};

Ganache is being started with below command:

./node_modules/.bin/ganache-cli" \
    --accounts=1000 \
    --defaultBalanceEther=10000 \
    --gasLimit 0xfffffffffff

Below is how we are creating our web3 object:

const web3 = new Web3('http://localhost:8545');

How can above issue be fixed?

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
2608027102commented, Nov 16, 2020

I also get this error when I perform multiple tests by truffle test.

Truffle v5.1.51 (core: 5.1.51)
Solidity - 0.4.24 (solc-js)
Node v12.16.1
Web3.js v1.2.9

Ganache CLI v6.12.1 (ganache-core: 2.13.1)
1reaction
abhayks1commented, Dec 10, 2019

@cgewecke test passes with below package versions:

"ganache-cli": "6.8.1-beta.0",
"truffle": "5.0.43",
"web3": "1.2.1",

Can you please explain the issue in more details?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not connect to your Ethereum client with the following ...
My problem was that I was using WSL2 to run my truffle commands and my ganache GUI is in windows. My fix configures...
Read more >
Bountysource
ganache -cli 6.7.0 - Could not connect to your Ethereum client with the following parameters.
Read more >
ganache-cli - npm.io
Ganache CLI uses ethereumjs to simulate full client behavior and make developing Ethereum applications faster, easier, and safer. It also includes all popular ......
Read more >
ConsenSys/truffle - Gitter
Hi, I am using truffle console and ganache-cli to fork mainnet as my testing ... Could not connect to your Ethereum client with...
Read more >
Network Management — Brownie 1.14.5 documentation
cmd : The command used to launch the local RPC client, e.g. ganache-cli . ... If not given as a unique field, it...
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