trufflesuite / ganache-ui

Personal blockchain for Ethereum development
https://www.trufflesuite.com/ganache
MIT License
4.66k stars 803 forks source link

System Error when running Ganache 1.1.0 on darwin #654

Open shenopkss opened 6 years ago

shenopkss commented 6 years ago

PLATFORM: darwin GANACHE VERSION: 1.1.0

EXCEPTION:

TypeError: Cannot read property 'error' of undefined
    at l.cleanUpErrorObject (/node_modules/ganache-cli/build/webpack:/ganache/node_modules/ganache-core/lib/provider.js:176:1)
    at l.reportErrorInResponse (/node_modules/ganache-cli/build/webpack:/ganache/node_modules/source-map/lib/array-set.js:9:1)
    at Object.r [as callback] (/node_modules/ganache-cli/build/webpack:/ganache/node_modules/ganache-core/lib/provider.js:97:1)
    at e.engine.sendAsync (/node_modules/ganache-cli/build/webpack:/ganache/node_modules/ganache-core/lib/provider.js:154:1)
    at /node_modules/ganache-cli/build/webpack:/ganache/node_modules/async/internal/map.js:35:1
    at /node_modules/ganache-cli/build/webpack:/ganache/node_modules/async/internal/eachOfLimit.js:3:1
    at s (/node_modules/ganache-cli/build/webpack:/ganache/node_modules/async/eachOf.js:70:1)
    at /node_modules/ganache-cli/build/webpack:/ganache/node_modules/lodash/isLength.js:30:1
    at /node_modules/ganache-cli/build/webpack:/ganache/node_modules/async/internal/map.js:16:39
    at /node_modules/ganache-cli/build/webpack:/ganache/node_modules/web3-provider-engine/index.js:109:1
    at /node_modules/ganache-cli/build/webpack:/ganache/node_modules/async/internal/eachOfLimit.js:3:1
    at l (/node_modules/ganache-cli/build/webpack:/ganache/node_modules/async/internal/eachOfLimit.js:16:1)
    at u (/node_modules/ganache-cli/build/webpack:/ganache/node_modules/async/internal/eachOfLimit.js:64:1)
    at /node_modules/ganache-cli/build/webpack:/ganache/node_modules/lodash/isLength.js:30:1
    at a.id (/node_modules/ganache-cli/build/webpack:/ganache/node_modules/web3-provider-engine/index.js:143:1)
    at /node_modules/ganache-cli/build/webpack:/ganache/node_modules/lodash/_overArg.js:11:1
    at l (/node_modules/ganache-cli/build/webpack:/ganache/node_modules/async/internal/eachOfLimit.js:20:1)
    at u (/node_modules/ganache-cli/build/webpack:/ganache/node_modules/async/internal/eachOfLimit.js:64:1)
    at /node_modules/ganache-cli/build/webpack:/ganache/node_modules/lodash/isLength.js:30:1
    at a.id (/node_modules/ganache-cli/build/webpack:/ganache/node_modules/web3-provider-engine/index.js:143:1)
    at /node_modules/ganache-cli/build/webpack:/ganache/node_modules/lodash/_overArg.js:11:1
    at l (/node_modules/ganache-cli/build/webpack:/ganache/node_modules/async/internal/eachOfLimit.js:20:1)
    at u (/node_modules/ganache-cli/build/webpack:/ganache/node_modules/async/internal/eachOfLimit.js:64:1)
    at /node_modules/ganache-cli/build/webpack:/ganache/node_modules/lodash/isLength.js:30:1
    at a.id (/node_modules/ganache-cli/build/webpack:/ganache/node_modules/web3-provider-engine/index.js:143:1)
    at /node_modules/ganache-cli/build/webpack:/ganache/node_modules/lodash/_overArg.js:11:1
    at l (/node_modules/ganache-cli/build/webpack:/ganache/node_modules/async/internal/eachOfLimit.js:20:1)
    at u (/node_modules/ganache-cli/build/webpack:/ganache/node_modules/async/internal/eachOfLimit.js:64:1)
    at /node_modules/ganache-cli/build/webpack:/ganache/node_modules/lodash/isLength.js:30:1
    at a.id (/node_modules/ganache-cli/build/webpack:/ganache/node_modules/web3-provider-engine/index.js:143:1)
    at /node_modules/ganache-cli/build/webpack:/ganache/node_modules/lodash/_overArg.js:11:1
    at l (/node_modules/ganache-cli/build/webpack:/ganache/node_modules/async/internal/eachOfLimit.js:20:1)
    at u (/node_modules/ganache-cli/build/webpack:/ganache/node_modules/async/internal/eachOfLimit.js:64:1)
    at /node_modules/ganache-cli/build/webpack:/ganache/node_modules/lodash/isLength.js:30:1

APPLICATION LOG:

T+0ms: Starting server with initial configuration: {"hostname":"127.0.0.1","port":8545,"network_id":5777,"total_accounts":10,"unlocked_accounts":[],"vmErrorsOnRPCResponse":true,"gasLimit":999999999999999,"gasPrice":1}
T+334ms: Ganache started successfully!
T+334ms: Waiting for requests...
T+3295ms: eth_getBlockByNumber
T+7288ms: eth_getBalance
T+7288ms: eth_call
T+7288ms: eth_call
T+7288ms: eth_call
T+7288ms: eth_call
T+7288ms: eth_getBalance
T+7288ms: eth_call
T+7296ms: eth_call
T+7296ms: eth_call
T+7296ms: eth_call
T+8301ms: eth_getBlockByNumber
davidmurdoch commented 5 years ago

This is likely caused by attempting to get a block with an invalid block number, but I'm not sure. A quick "fix" would be to make sure we check that response isn't undefined before using it here: https://github.com/trufflesuite/ganache-core/blob/56e8061b62b65fbb276704f2b7996ac10ebc469c/lib/provider.js#L186, but the root of the problem likely lies somewhere else; I think either err or result should always be defined at this point.