filecoin-project / boost

Boost is a tool for Filecoin storage providers to manage data storage and retrievals on Filecoin.
Other
109 stars 64 forks source link

Fix panic when recovering broken sector. #1921

Closed cryptowhizzard closed 2 weeks ago

cryptowhizzard commented 1 month ago

Fixes :

2024-05-22T10:00:57.990+0200 DEBUG boostd/recover.go:698 successfully processed sector {"sector": "24242", "took": "2m10.444991835s", "deals": [54737806]} 2024-05-22T10:00:57.990+0200 DEBUG boostd/recover.go:685 processing sector {"sector": "24245", "deals": [54737803]} 2024-05-22T10:00:57.991+0200 WARN boostd/recover.go:714 deal present in sector, but not in market actor state, so probably expired {"sector": "24245", "deal": 54737803, "err": "deal 54737803 not found - deal may not have completed sealing before deal proposal start epoch, or deal may have been slashed"} 2024-05-22T10:00:57.991+0200 DEBUG boostd/recover.go:698 successfully processed sector {"sector": "24245", "took": "1.1293ms", "deals": [54737803]} 2024-05-22T10:00:57.991+0200 DEBUG boostd/recover.go:685 processing sector {"sector": "24246", "deals": [54737805]} 2024-05-22T10:00:58.005+0200 DEBUG boostd/recover.go:544 processing piece {"sector": "24246", "piececid": "baga6ea4seaqofw6a4qv6toolne2rhobfdblq7mss5cwhffjaa47dedg3wxcs6pq", "piecesize": 34359738368, "offset": 0, "label": "bafybeifo6wh22ydwxf2eio4a6larmd4hj7kl2vz6esuwvymcu5gxyh4nmq"} 2024-05-22T10:00:58.135+0200 ERROR boostd/recover.go:507 isUnsealed(24246, 0, 34091302912) returned false, but storage find returns an unsealed copy; most probably unsealed copy is full of 0x00 and is corrupted (confirm with xxd) {"sector": "24246"} 2024-05-22T10:00:58.136+0200 DEBUG boostd/recover.go:586 processed piece {"took": "130.805405ms", "sector": "24246", "piececid": "baga6ea4seaqofw6a4qv6toolne2rhobfdblq7mss5cwhffjaa47dedg3wxcs6pq", "piecesize": 34359738368, "offset": 0, "label": "bafybeifo6wh22ydwxf2eio4a6larmd4hj7kl2vz6esuwvymcu5gxyh4nmq"} 2024-05-22T10:00:58.136+0200 DEBUG boostd/recover.go:698 successfully processed sector {"sector": "24246", "took": "144.511317ms", "deals": [54737805]} panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x2aad42f]

goroutine 74 [running]: main.processPiece({0x7c5d8e8, 0xc00035f900}, 0x5eb6, 0x3433b8d, {{0xc008743770?, 0x0?}}, 0x800000000, 0x0, {0xc000794180, 0x3b}) /root/build/boost/cmd/boostd/recover.go:593 +0x6af main.processSector({0x7c5d8e8, 0xc00035f900}, {{0xc0001509a0?, 0xc0001151a0?}}, 0xc001d3b710) /root/build/boost/cmd/boostd/recover.go:737 +0x472 main.action(0x0?) /root/build/boost/cmd/boostd/recover.go:270 +0xfdf main.glob..func23.1() /root/build/boost/cmd/boostd/recover.go:130 +0x25 created by main.glob..func23 in goroutine 1 /root/build/boost/cmd/boostd/recover.go:129 +0xf9