Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

System Error when running Ganache 2.0.0-beta.2 on darwin #1117

Closed
BlinkyStitt opened this issue Feb 7, 2019 · 4 comments · Fixed by trufflesuite/truffle#1875
Closed

System Error when running Ganache 2.0.0-beta.2 on darwin #1117

BlinkyStitt opened this issue Feb 7, 2019 · 4 comments · Fixed by trufflesuite/truffle#1875

Comments

@BlinkyStitt
Copy link

I am using sol-compiler to build my contracts because it supports mixing versions of solidity.

I successfully migrated and ran truffle tests, but ganache crashed when I tried to browse details on the contracts tab in the GUI.

PLATFORM: darwin
GANACHE VERSION: 2.0.0-beta.2

EXCEPTION:

TypeError: Cannot read property 'ast' of undefined
    at Object.getContractNode (/node_modules/truffle-decoder/dist/interface/contract-decoder.js:37:33)
    at getStateVariables (/node_modules/truffle-decoder/dist/allocate/references.js:187:45)
    at Object.getContractStateVariables (/node_modules/truffle-decoder/dist/allocate/references.js:209:27)
    at TruffleContractDecoder.<anonymous> (/node_modules/truffle-decoder/dist/interface/contract-decoder.js:78:55)
    at Generator.next (<anonymous>)
    at /node_modules/truffle-decoder/dist/interface/contract-decoder.js:7:71
    at Promise (<anonymous>)
    at __awaiter (/node_modules/truffle-decoder/dist/interface/contract-decoder.js:3:12)
    at TruffleContractDecoder.init (/node_modules/truffle-decoder/dist/interface/contract-decoder.js:69:16)
    at Object.getContractState (/src/truffle-integration/decode.js:9:11)
    at process.<anonymous> (/src/truffle-integration/index.js:78:52)
    at emitTwo (events.js:125:13)
    at process.emit (events.js:213:7)
    at emit (internal/child_process.js:768:12)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

APPLICATION LOG:

T+225934ms: eth_blockNumber
T+225964ms: eth_getBlockByNumber
T+225988ms: eth_getBlockByNumber
T+226018ms: eth_getBlockByNumber
T+226051ms: eth_getBlockByNumber
T+226092ms: eth_sendTransaction
T+226134ms:   Transaction: 0x0457f9ed17b5a0542d39538f26b3123465f6c7be2dd333c5552f9b5dabcdbd4d
T+226134ms:   Gas usage: 51370
T+226134ms:   Block Number: 2825
T+226202ms:   Block Time: Thu Feb 07 2019 12:39:23 GMT-0800 (PST)
T+226226ms: eth_getTransactionReceipt
T+226292ms: eth_subscribe
T+226292ms: eth_getBlockByNumber
T+226292ms: eth_call
T+226320ms: eth_getBlockByNumber
T+226350ms: eth_getBlockByNumber
T+226373ms: eth_getTransactionReceipt
T+226404ms: eth_getBlockByNumber
T+226436ms: eth_getTransactionReceipt
T+226467ms: eth_getBlockByNumber
T+226498ms: eth_getBlockByNumber
T+226522ms: eth_getTransactionByHash
T+226567ms: eth_getTransactionReceipt
T+226626ms: eth_getCode
T+226662ms: eth_getBlockByNumber
T+226693ms: eth_getBlockByNumber
T+226722ms: eth_blockNumber
T+226742ms: eth_getBlockByNumber
T+226771ms: eth_getBlockByNumber
T+226800ms: eth_getBlockByNumber
T+226828ms: eth_getBlockByNumber
T+226856ms: eth_call
T+226876ms: eth_getBlockByNumber
T+226906ms: eth_sendTransaction
T+226951ms:   Transaction: 0xb4836f2195185cf3db90afdc0b51479b6001dc489eced9dc689aa625f24387ca
T+226951ms:   Gas usage: 54267
T+226951ms:   Block Number: 2826
T+226951ms:   Block Time: Thu Feb 07 2019 12:39:24 GMT-0800 (PST)
T+227013ms: eth_unsubscribe
T+227130ms: eth_getTransactionReceipt
T+227130ms: eth_subscribe
T+227130ms: eth_getBlockByNumber
T+227130ms: eth_call
T+227166ms: eth_getBlockByNumber
T+227201ms: eth_getBlockByNumber
T+227225ms: eth_getTransactionReceipt
T+227257ms: eth_getBlockByNumber
T+227290ms: eth_getTransactionReceipt
T+227323ms: eth_getBlockByNumber
T+227356ms: eth_getBlockByNumber
T+227380ms: eth_getTransactionByHash
T+227413ms: eth_getTransactionReceipt
T+227445ms: eth_getCode
T+227484ms: eth_getBlockByNumber
T+227523ms: eth_getBlockByNumber
T+227591ms: eth_blockNumber
T+227613ms: eth_getBlockByNumber
T+227645ms: eth_getBlockByNumber
T+227677ms: eth_getBlockByNumber
T+227709ms: eth_getBlockByNumber
T+227743ms: eth_call
T+227769ms: eth_getBlockByNumber
T+227810ms: eth_sendTransaction
T+227843ms:   Transaction: 0xf5680684f66f3fd73fcaaff78d99e87b9cabf9244fa9d5bae537fa5fbf5530ec
T+227843ms:   Gas usage: 42014
T+227843ms:   Block Number: 2827
T+227874ms:   Block Time: Thu Feb 07 2019 12:39:25 GMT-0800 (PST)
T+227928ms: eth_unsubscribe
T+227928ms: eth_getTransactionReceipt
T+227928ms: eth_subscribe
T+227928ms: eth_getBlockByNumber
T+227974ms: eth_call
T+228036ms: eth_getBlockByNumber
T+228078ms: eth_getBlockByNumber
T+228109ms: eth_getTransactionReceipt
T+228141ms: eth_getBlockByNumber
T+228162ms: eth_getTransactionReceipt
T+228192ms: eth_getBlockByNumber
T+228222ms: eth_getBlockByNumber
T+228251ms: eth_getTransactionByHash
T+228281ms: eth_getTransactionReceipt
T+228302ms: eth_getCode
T+228331ms: eth_getBlockByNumber
T+228364ms: evm_revert
T+228405ms: evm_snapshot
T+228445ms: eth_getBlockByNumber
T+228511ms: eth_getBlockByNumber
T+228533ms: eth_blockNumber
T+228564ms: eth_getBlockByNumber
T+228596ms: eth_getBlockByNumber
T+228627ms: eth_getBlockByNumber
T+228657ms: eth_call
T+228678ms: eth_getBlockByNumber
T+228707ms: eth_getBlockByNumber
T+228737ms: eth_getTransactionReceipt
T+228768ms: eth_getTransactionByHash
T+228789ms: eth_getBlockByNumber
T+228822ms: eth_getBlockByNumber
T+228868ms: eth_getBlockByNumber
T+228937ms: eth_blockNumber
T+228937ms: eth_getBlockByNumber
T+228937ms: eth_getBlockByNumber
T+228937ms: eth_getLogs
T+228979ms: eth_getBlockByNumber
T+229011ms: eth_unsubscribe
T+229011ms: eth_unsubscribe
T+229011ms: eth_unsubscribe
T+229011ms: eth_unsubscribe
T+229011ms: eth_unsubscribe
T+229011ms: eth_unsubscribe
T+229011ms: eth_unsubscribe
T+229011ms: eth_unsubscribe
T+229011ms: eth_unsubscribe
T+229011ms: eth_unsubscribe
T+229011ms: eth_unsubscribe
T+229011ms: eth_unsubscribe
T+229011ms: eth_unsubscribe
T+229011ms: eth_unsubscribe
T+229011ms: eth_unsubscribe
T+229011ms: eth_unsubscribe
T+229011ms: eth_unsubscribe
T+229011ms: eth_unsubscribe
T+229011ms: eth_unsubscribe
T+229011ms: eth_unsubscribe
T+229011ms: eth_unsubscribe
T+246580ms: eth_unsubscribe
T+246580ms: eth_unsubscribe
T+246580ms: eth_unsubscribe
T+246580ms: eth_unsubscribe
T+246580ms: eth_unsubscribe

My compiler.json:

{
    "contractsDir": "contracts-sol-compiler",
    "artifactsDir": "build/external/sol-compiler",
    "contracts": "*",
    "compilerSettings": {
        "optimizer": { "enabled": true },
        "outputSelection": {
            "*": {
                "": [
                    "legacyAST",
                    "ast"
                ],
                "*": [
                    "abi",
                    "evm.bytecode.object",
                    "evm.bytecode.sourceMap",
                    "evm.deployedBytecode.object",
                    "evm.deployedBytecode.sourceMap",
                    "userdoc",
                    "devdoc"
                ]
            }
        }
    }
}

My truffle-config.js:

  compilers: {
    ...
    external: {
      command: "sol-compiler",
      targets: [
        {
          // https://github.com/trufflesuite/truffle/blob/e913be03c564cd967d58a67ddc16360188db3ead/packages/truffle-external-compile/index.js#L208
          path: "build/external/sol-compiler/*.json",
          command: "node sol-compiler-json-to-truffle.js",
          stdin: false,
        },
      ],
    },

sol-compiler-json-truffle.js

The truffle contract I tried to view: https://gist.github.com/WyseNynja/8b481e829796f2b01318f750400c6127

The contracts themselves are built inside a docker container and so the absolute paths are from inside docker and not on my laptop where ganache is running. Maybe that is related?

@jooray
Copy link

jooray commented Mar 24, 2019

Same or similar.

TypeError: Cannot read property 'nodes' of undefined
    at getContractNode (/node_modules/truffle-decoder/dist/interface/contract-decoder.js:42:37)
    at TruffleContractDecoder.relevantContracts.forEach (/node_modules/truffle-decoder/dist/interface/contract-decoder.js:69:24)
    at Array.forEach (<anonymous>)
    at TruffleContractDecoder (/node_modules/truffle-decoder/dist/interface/contract-decoder.js:68:32)
    at Object.forContract (/node_modules/truffle-decoder/dist/interface/index.js:28:12)
    at Object.getDecodedEvent (/src/truffle-integration/decode.js:37:34)
    at process.<anonymous> (/src/truffle-integration/index.js:92:31)
    at emitTwo (events.js:125:13)
    at process.emit (events.js:213:7)
    at emit (internal/child_process.js:768:12)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

I don't do anything special, only that I mix vyper and solidity code in truffle (although this happens when I open solidity contract built with solc-js 0.5.6).

@davidmurdoch
Copy link
Member

@davidmurdoch
Copy link
Member

@davidmurdoch
Copy link
Member

davidmurdoch commented Apr 2, 2019

Hey @wysenynja, thanks for opening up the issue! Can you put together a github repo I can clone that I can test with? I'm having difficulty reproducing the issue with the snippets you've attached.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants