synechron-finlabs / quorum-maker

Utility to create and monitor Quorum nodes
Apache License 2.0
196 stars 97 forks source link

http: panic serving: runtime error: invalid memory address or nil pointer dereference #59

Closed jimmygchen closed 5 years ago

jimmygchen commented 5 years ago

Hi,

I'm experiencing a similar issue reported here https://github.com/jpmorganchase/quorum/issues/531

I'm running a network of 4 nodes locally using quote-maker. It's been working fine for a while, but all of a sudden I'm not able to write/read to the network.

Error:

node2    | 2018/10/31 10:58:45 http: panic serving 10.50.0.1:53204: runtime error: invalid memory address or nil pointer dereference
node2    | goroutine 704 [running]:
node2    | net/http.(*conn).serve.func1(0xc4200a6140)
node2    |  /usr/local/go/src/net/http/server.go:1726 +0xd0
node2    | panic(0x7d8a40, 0xc45d90)
node2    |  /usr/local/go/src/runtime/panic.go:502 +0x229
node2    | github.com/ybbus/jsonrpc.(*RPCResponse).GetObject(0x0, 0x79e260, 0xc42000c6a0, 0x85, 0x0)
node2    |  /go/src/github.com/ybbus/jsonrpc/jsonrpc.go:609 +0x26
node2    | github.com/synechron-finlabs/quorum-maker-nodemanager/client.(*EthClient).AdminPeers(0xc420126840, 0xc, 0xc42009a910, 0xc420090330)
node2    |  /go/src/github.com/synechron-finlabs/quorum-maker-nodemanager/client/EthClient.go:182 +0x137
node2    | github.com/synechron-finlabs/quorum-maker-nodemanager/contractclient.(*NetworkMapContractClient).ActiveNodesHandler(0xc420126840, 0x897220, 0xc420136000, 0xc420275300)
node2    |  /go/src/github.com/synechron-finlabs/quorum-maker-nodemanager/contractclient/NetworkMapContractHandler.go:200 +0x174
node2    | github.com/synechron-finlabs/quorum-maker-nodemanager/contractclient.(*NetworkMapContractClient).ActiveNodesHandler-fm(0x897220, 0xc420136000, 0xc420275300)
node2    |  /go/src/github.com/synechron-finlabs/quorum-maker-nodemanager/main.go:89 +0x48

Please see screenshots of the stacktrace attached

screenshot 2018-10-31 at 11 16 30 screenshot 2018-10-31 at 11 16 15

Please let me know if there any further details I can provide. Thank you!

dhyansraj commented 5 years ago

Looks like the Geth server is down. Are you able to do geth attach to the node ? or Can you check from Quorum Maker UI, the node is up and running ?

jimmygchen commented 5 years ago

@dhyansraj Thanks for your prompt reply!

I'm running a local dev/test network using docker-compose. I've tried restarting all the nodes with docker-compose (I'm guessing this does geth attach, please correct if I'm wrong), and Quorum Maker UI still doesn't show any information - no transactions, blocks and active nodes.

In the meantime, I'm setting up a new dev network as a workaround, but I'm suspecting that this may be caused by passing an incorrect value in {privateFor: } transaction. Will provide more details if I reproduce this issue in the new network.

Thanks!

jimmygchen commented 5 years ago

@dhyansraj

Looks like what I'm experiencing may be related to this bug https://github.com/jpmorganchase/quorum/pull/517

This has been resolved in Quorum v2.1.1 https://github.com/jpmorganchase/quorum/releases

The latest Quorum Maker uses v2.1.0, so I tried building the image locally. However, I'm having some problems with quorum-maker-image. Would you be able to release a new QM docker image with Quorum 2.1.1?

Thank you!

jimmygchen commented 5 years ago

I was able to reproduce the problem by sending a private transaction that fails (i.e. evm revert due to failed require() check), this creates a bad block.

I confirm that upgrading to v2.1.1 fixes my issue. PR created https://github.com/synechron-finlabs/quorum-maker-image/pull/5

jimmygchen commented 5 years ago

Looks like this change has been made in the latest release. Closing this issue as I'm no longer experiencing the error.

Thanks!