首页 > 解决方案 > 对等点崩溃:运行时错误:无效的内存地址或 nil 指针取消引用

问题描述

很长一段时间后,每当我遇到以下错误 hf 版本时,我的同行都会崩溃:1.4.2 go version go1.12.6 linux/amd64 ubuntu TLS 16.04

free -m
              total        used        free      shared  buff/cache   available
Mem:         257611       11125      151795        2657       94689      241076
Swap:           976           0         976

对等日志

2019-11-28 17:29:53.646 UTC [deliveryClient] try -> WARN de55 Got error: rpc error: code = Unavailable desc = transport is closing , at 1 attempt. Retrying in 1s
2019-11-28 17:29:53.829 UTC [deliveryClient] try -> WARN de56 Got error: rpc error: code = Unavailable desc = transport is closing , at 1 attempt. Retrying in 1s
2019-11-28 17:29:55.826 UTC [deliveryClient] try -> WARN de57 Got error: rpc error: code = Unavailable desc = transport is closing , at 1 attempt. Retrying in 1s
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xaed020]

goroutine 136 [running]:
github.com/hyperledger/fabric/protos/gossip.(*SecretEnvelope).InternalEndpoint(0x0, 0x40c4c3, 0x7f849226ddc8)
    /opt/gopath/src/github.com/hyperledger/fabric/protos/gossip/extensions.go:480 +0x40
github.com/hyperledger/fabric/gossip/discovery.newAliveMsgStore.func4(0x1243280, 0xc00254ab10)
    /opt/gopath/src/github.com/hyperledger/fabric/gossip/discovery/discovery_impl.go:1032 +0xfd
github.com/hyperledger/fabric/gossip/gossip/msgstore.(*messageStoreImpl).expireMessages(0xc002656180)
    /opt/gopath/src/github.com/hyperledger/fabric/gossip/gossip/msgstore/msgs.go:212 +0x34c
github.com/hyperledger/fabric/gossip/gossip/msgstore.(*messageStoreImpl).expirationRoutine(0xc002656180)
    /opt/gopath/src/github.com/hyperledger/fabric/gossip/gossip/msgstore/msgs.go:253 +0x141
created by github.com/hyperledger/fabric/gossip/gossip/msgstore.NewMessageStoreExpirable
    /opt/gopath/src/github.com/hyperledger/fabric/gossip/gossip/msgstore/msgs.go:53 +0xb2

链码日志

2019/11/27 10:04:13 This complaintno already exists: 1709157484903969657
2019-11-28 17:44:50.198 UTC [shim] chatWithPeer -> ERRO 001 Received error from server, ending chaincode stream: rpc error: code = Unavailable desc = transport is closing
receive failed
github.com/hyperledger/fabric/core/chaincode/shim.chatWithPeer
    /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim/chaincode.go:362
github.com/hyperledger/fabric/core/chaincode/shim.Start
    /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim/chaincode.go:156
main.main
    /chaincode/input/src/github.com/chaincode/complaints/complaintchaincode.go:134
runtime.main
    /opt/go/src/runtime/proc.go:201
runtime.goexit
    /opt/go/src/runtime/asm_amd64.s:1333
2019/11/28 17:44:50 Error starting Complaint chaincode: receive failed: rpc error: code = Unavailable desc = transport is closing

我很长一段时间都面临这个错误,但无法调试它。

标签: hyperledger-fabrichyperledgerhyperledger-chaincode

解决方案


您遇到了一个在 1.4.2 中引入并在 1.4.3中修复的错误


推荐阅读