Skip to content

bug(historic): Corrupted Zip file prevents BN from starting up. #1823

@AlfredoG87

Description

@AlfredoG87

Description

Recently we found that is possible for corrupted/incomplete zips to occur, on the historic plugin, possibly a badd restart, in those cases the BN is unable to recover and start-up becomes impossible.

The solution is for the BN to self-recover from such cases and prevent them from happening in the first place.

the issue is believed to be on: https://github.com/hiero-ledger/hiero-block-node/blob/main/block-node/block-providers/files.historic/src/main/java/org/hiero/block/node/blocks/files/historic/ZipBlockArchive.java#L161

Steps to Reproduce

TBD

Additional context

java.util.zip.ZipException: zip END header not found
        at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.findEND(ZipFileSystem.java:1320)
        at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.initCEN(ZipFileSystem.java:1541)
        at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.<init>(ZipFileSystem.java:179)
        at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getZipFileSystem(ZipFileSystemProvider.java:125)
        at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:120)
        at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:528)
        at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:475)
        at [email protected]/org.hiero.block.node.blocks.files.historic.ZipBlockArchive.minStoredBlockNumber(ZipBlockArchive.java:161)
        at [email protected]/org.hiero.block.node.blocks.files.historic.BlockFileHistoricPlugin.init(BlockFileHistoricPlugin.java:108)
        at [email protected]/org.hiero.block.node.app.BlockNodeApp.<init>(BlockNodeApp.java:178)
        at [email protected]/org.hiero.block.node.app.BlockNodeApp.main(BlockNodeApp.java:314)

2025-11-03 19:19:37.332+0000 INFO    [org.hiero.block.node.app.BlockNodeApp shutdown] Shutting down, reason: Error reading directory: /opt/hiero/block-node/data/historic/000/000/000/006/38 because zip END header not found, class: org.hiero.block.node.blocks.files.histor
ic.ZipBlockArchive
2025-11-03 19:19:37.833+0000 INFO    [org.hiero.block.node.app.BlockNodeApp shutdown] Stopping plugin: BlockMessagingFacilityImpl
2025-11-03 19:19:37.834+0000 INFO    [org.hiero.block.node.app.BlockNodeApp shutdown] Stopping plugin: HistoricalBlockFacilityImpl
2025-11-03 19:19:37.834+0000 INFO    [org.hiero.block.node.app.BlockNodeApp shutdown] Stopping plugin: BlockFileRecentPlugin
2025-11-03 19:19:37.834+0000 INFO    [org.hiero.block.node.app.BlockNodeApp shutdown] Stopping plugin: BlockFileHistoricPlugin
2025-11-03 19:19:37.835+0000 INFO    [org.hiero.block.node.app.BlockNodeApp shutdown] Stopping plugin: S3ArchivePlugin
2025-11-03 19:19:37.835+0000 INFO    [org.hiero.block.node.app.BlockNodeApp shutdown] Stopping plugin: SubscriberServicePlugin
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "org.hiero.block.node.stream.subscriber.SubscriberServicePlugin$SubscribeBlockStreamHandler.stop()" because "this.clientHandler" is null
        at [email protected]/org.hiero.block.node.stream.subscriber.SubscriberServicePlugin.stop(SubscriberServicePlugin.java:74)
        at [email protected]/org.hiero.block.node.app.BlockNodeApp.shutdown(BlockNodeApp.java:298)
        at [email protected]/org.hiero.block.node.blocks.files.historic.ZipBlockArchive.minStoredBlockNumber(ZipBlockArchive.java:175)
        at [email protected]/org.hiero.block.node.blocks.files.historic.BlockFileHistoricPlugin.init(BlockFileHistoricPlugin.java:108)
        at [email protected]/org.hiero.block.node.app.BlockNodeApp.<init>(BlockNodeApp.java:178)
        at [email protected]/org.hiero.block.node.app.BlockNodeApp.main(BlockNodeApp.java:314)

Metadata

Metadata

Assignees

Labels

Block NodeIssues/PR related to the Block Node.BugA error that causes the feature to behave differently than what was expected based on design docs

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions