deso-protocol / run

Run your own DeSo node
https://docs.deso.org
190 stars 94 forks source link

Segmentation Fault with PostgreSQL sync #84

Closed andreioprisan closed 3 years ago

andreioprisan commented 3 years ago

I'm running a host node with PostgreSQL enabled and DB sync keeps getting stuck randomly due to a panic code. Even after a docker container, volume, image etc. clean and retunning the ./run command, same issue comes up. I even tried with new DB instances, which leads to a full sync and runs for a while, but eventually dies out. This is on an AWS c5d.9xlarge with similarly beefy low latency PostgreSQL instance, latest deso-protocol code.

Has anyone else seen this issue come up or has any suggestions for resolution path?


backend     | I1016 15:20:22.420506       1 base.go:185] Blockchain exchange rate: 9301 [9301 9301 9301 9301 9301 9301 9301 9301 9301 9301]
backend     | I1016 15:20:22.420555       1 base.go:211] Final exchange rate: 9301
backend     | I1016 15:20:27.032242       1 base.go:226] Refreshing USD to ETH exchange rate
backend     | I1016 15:20:27.202166       1 base.go:233] New USD to ETH exchange rate: 3895.900000
backend     | I1016 15:20:28.003027       1 base.go:215] Refreshing USD to BTC exchange rate
backend     | I1016 15:20:28.274780       1 base.go:222] New USD to BTC exchange rate: 60853.150000
backend     | I1016 15:20:28.620430       1 server.go:1131] Server._handleBlock: Received block ( 67217 / 69673 ) from Peer [ Remote Address: 35.232.92.5:17000 PeerID=1 ]
backend     | panic: runtime error: invalid memory address or nil pointer dereference
backend     | [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb5bdaa]
backend     |
backend     | goroutine 309 [running]:
backend     | github.com/deso-protocol/core/lib.(*UtxoView).GetPublicKeyForPKID(0xc00199a000, 0xc001078c90, 0xc0007fc330, 0x21, 0xc001077860)
backend     |   /deso/src/core/lib/block_view.go:4887 +0x1ca
backend     | github.com/deso-protocol/core/lib.(*UtxoView)._connectAcceptNFTBid(0xc00199a000, 0xc0003acd90, 0xc0019bc720, 0x10691, 0x1c0, 0x0, 0x0, 0x3, 0x4, 0x0, ...)
backend     |   /deso/src/core/lib/block_view.go:7025 +0x999
backend     | github.com/deso-protocol/core/lib.(*UtxoView)._connectTransaction(0xc00199a000, 0xc0003acd90, 0xc0019bc720, 0x0, 0x10691, 0xc00054f940, 0x3, 0x4, 0x966c, 0x958f, ...)
backend     |   /deso/src/core/lib/block_view.go:9414 +0xc28
backend     | github.com/deso-protocol/core/lib.(*UtxoView).ConnectTransaction(0xc00199a000, 0xc0003acd90, 0xc0019bc720, 0x0, 0x10691, 0xc00054f940, 0x3, 0x4, 0x966c, 0x958f, ...)
backend     |   /deso/src/core/lib/block_view.go:9314 +0x79
backend     | github.com/deso-protocol/core/lib.(*UtxoView).ConnectBlock(0xc00199a000, 0xc000621320, 0xc006c03000, 0x43, 0x80, 0x0, 0x80, 0x0, 0x0, 0xc003937800, ...)
backend     |   /deso/src/core/lib/block_view.go:9509 +0x213
backend     | github.com/deso-protocol/core/lib.(*Blockchain).ProcessBlock(0xc0004a6c60, 0xc000621320, 0xc00173de00, 0x0, 0x0, 0x0)
backend     |   /deso/src/core/lib/blockchain.go:1930 +0xd7b
backend     | github.com/deso-protocol/core/lib.(*Server)._handleBlock(0xc0002b0480, 0xc00033ab40, 0xc000621320)
backend     |   /deso/src/core/lib/server.go:1177 +0x3c6
backend     | github.com/deso-protocol/core/lib.(*Server)._handlePeerMessages(0xc0002b0480, 0xc004a7c620)
backend     |   /deso/src/core/lib/server.go:1480 +0x287
backend     | github.com/deso-protocol/core/lib.(*Server).messageHandler(0xc0002b0480)
backend     |   /deso/src/core/lib/server.go:1520 +0x1c5
backend     | created by github.com/deso-protocol/core/lib.(*Server).Start
backend     |   /deso/src/core/lib/server.go:1696 +0xbd
backend exited with code 2
tijno commented 3 years ago

I had this issue earlier in the week for that specific block as well, see the other issue (will add link) - but that was fixed.

pull fresh images, full wipe of db & docker volume resolved it after resync

tijno commented 3 years ago

https://github.com/deso-protocol/backend/issues/172

maebeam commented 3 years ago

Hi! You are probably using stable when you need to use latest. I will release a stable version to fix this.