'raft applied is out of range' causing panic
System information
Geth version:
# geth version
Geth
Version: 1.7.2-stable
Git Commit: f651c1befa8ea020f762d9d35ef0027846db2d3d
Quorum Version: 2.0.0
Architecture: amd64
Network Id: 1
Go Version: go1.9.2
Operating System: linux
GOPATH=
GOROOT=/usr/lib/go-1.9
OS & Version: Ubuntu 16.04
Branch, Commit Hash or Release: f651c1be
Expected behaviour
It is expected nodes can catch up with the records of the blockchain after restart.
Actual behaviour
The node failed to catch up and terminated with error.
Steps to reproduce the behaviour
Given a 6-node Quorum network running raft consensus, with some pending transactions in txpool,
- I observed that the minter (
node4) hasn't made new blocks for several minutes, - so I killed
node4'sgeth. - The network then elected new leader as minter and new blocks were kept making.
- Then I tried to run
gethinnode4again. At that moment,node4was behind the network for hundreds of blocks (I didn't mark down the number so I cannot tell the exact one). - Yet, I failed to start
gethand receiving panic.
Actually this node4 is the second node having this problem. When I first encounter this problem in node2, I tried to delete the whole data directory including chaindata and raft_log (but keeping the node keys and keystore) and see if the node can sync from scratch. But node2 just stuck at block 0. So I have no idea what I can do now.
Backtrace
2018-02-12 03:36:22.184171 I | rafthttp: started streaming with peer 6 (writer)
2018-02-12 03:36:22.184369 I | rafthttp: started streaming with peer 6 (writer)
2018-02-12 03:36:22.184539 I | rafthttp: started peer 6
2018-02-12 03:36:22.184577 I | rafthttp: added peer 6
INFO [02-12|03:36:22] updated cluster membership
INFO [02-12|03:36:22] blockchain is caught up; no need to synchronize
INFO [02-12|03:36:22] replaying WAL
2018-02-12 03:36:22.184644 I | rafthttp: started streaming with peer 6 (stream Message reader)
INFO [02-12|03:36:22] loading WAL term=0 index=0
2018-02-12 03:36:22.185131 I | rafthttp: started streaming with peer 6 (stream MsgApp v2 reader)
2018-02-12 03:36:22.186088 I | rafthttp: peer 6 became active
2018-02-12 03:36:22.186119 I | rafthttp: established a TCP streaming connection with peer 6 (stream Message reader)
2018-02-12 03:36:22.186405 I | rafthttp: established a TCP streaming connection with peer 6 (stream MsgApp v2 reader)
INFO [02-12|03:36:22] startRaft raft ID=4
INFO [02-12|03:36:22] remounting an existing raft log; connecting to peers.
raft2018/02/12 03:36:22 applied(344219) is out of range [prevApplied(344367), committed(344367)]
panic: applied(344219) is out of range [prevApplied(344367), committed(344367)]
goroutine 1 [running]:
log.(*Logger).Panicf(0xc4202600a0, 0x10a392c, 0x3c, 0xc42182cae0, 0x3, 0x3)
/usr/lib/go-1.9/src/log/log.go:219 +0xdb
github.com/ethereum/go-ethereum/vendor/github.com/coreos/etcd/raft.(*DefaultLogger).Panicf(0x1ab6f20, 0x10a392c, 0x3c, 0xc42182cae0, 0x3, 0x3)
/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/vendor/github.com/coreos/etcd/raft/logger.go:121 +0x60
github.com/ethereum/go-ethereum/vendor/github.com/coreos/etcd/raft.(*raftLog).appliedTo(0xc420416cb0, 0x5409b)
/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/vendor/github.com/coreos/etcd/raft/log.go:202 +0x174
github.com/ethereum/go-ethereum/vendor/github.com/coreos/etcd/raft.newRaft(0xc427f1d728, 0xc4200405c0)
/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/vendor/github.com/coreos/etcd/raft/raft.go:306 +0xc00
github.com/ethereum/go-ethereum/vendor/github.com/coreos/etcd/raft.RestartNode(0xc427f1d728, 0x35, 0x0)
/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/vendor/github.com/coreos/etcd/raft/node.go:224 +0x40
github.com/ethereum/go-ethereum/raft.(*ProtocolManager).startRaft(0xc420288f20)
/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/raft/handler.go:454 +0x90c
github.com/ethereum/go-ethereum/raft.(*ProtocolManager).Start(0xc420288f20, 0xc420300240)
/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/raft/handler.go:137 +0xf5
github.com/ethereum/go-ethereum/raft.(*RaftService).Start(0xc420417e30, 0xc420300240, 0xc4204efa58, 0x0)
/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/raft/backend.go:84 +0x39
github.com/ethereum/go-ethereum/node.(*Node).Start(0xc4201bc000, 0x0, 0x0)
/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/node/node.go:198 +0xb77
github.com/ethereum/go-ethereum/cmd/utils.StartNode(0xc4201bc000)
/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/cmd/utils/cmd.go:62 +0x2f
main.startNode(0xc4200b22c0, 0xc4201bc000)
/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/cmd/geth/main.go:231 +0x77
main.geth(0xc4200b22c0, 0x1102378, 0xb2d05e00)
/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/cmd/geth/main.go:219 +0x43
github.com/ethereum/go-ethereum/vendor/gopkg.in/urfave/cli%2ev1.HandleAction(0xeadfa0, 0x1103b48, 0xc4200b22c0, 0xc4200b22c0, 0xc4204eff40)
/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/urfave/cli.v1/app.go:490 +0xd2
github.com/ethereum/go-ethereum/vendor/gopkg.in/urfave/cli%2ev1.(*App).Run(0xc4204301a0, 0xc420010140, 0x14, 0x14, 0x0, 0x0)
/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/vendor/gopkg.in/urfave/cli.v1/app.go:264 +0x635
main.main()
/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/cmd/geth/main.go:208 +0x55
This has been addressed on master. Please reopen if this is still an issue. Thanks.
@fixanoid I am also getting same error when I am restarting geth. How can I fix this error ?
@samcrowindia if you are running on master / v2.1.0 of Quorum, I'd suggest opening a new ticket so we could figure out whats happening. If not, please upgrade first.