<!-- Describe the issue -->
I recently had a corrupt bitcoin database. I've been trying to re-index the blockchain as I have a full node and the entire blockchain downloaded to my volume.
I'm seeing errors in the debug.log that I'm assuming are corrupt blocks. LoadExternalBlockFile: Deserialize or I/O error
LoadExternalBlockFile: Deserialize or I/O error - CBufferedFile::Fill: end of file: unspecified iostream_category error
LoadExternalBlockFile: Deserialize or I/O error - non-canonical ReadCompactSize(): unspecified iostream_category error
When the re-index reaches one of those blocks, it stops trying to re-index the blockchain and begins to sync over the network. It doesn't always stop immediately after finding the error. Sometimes it will continue to re-index, but when looking for the best tip, it will begin syncing with the network after getting to that block.
I'll delete the corrupt block, restart Bitcoin to re-index, hoping it will download the missing block and continue to re-index from my drive. I haven't seen that happen.
<!--- What behavior did you expect? -->
When finding a corrupt or missing block, replace that one block and continue re-indexing from the volume. Take priority for using blocks already on the volume rather than syncing over the network.
<!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->
0.20
<!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->
2010 Mac 5,1 10.13.6 os 2.8 GHz Quad-Core Intel Xeon 24 GB 1066 MHz DDR3 ATI Radeon HD 5870 1024 MB blockchain stored on an attached DroboPro with 5 TB free storage. The Drobo had a drive failure, I can lose another 2 drives before data loss. Drobo is rebuilding.
<!-- Any extra information that might be useful in the debugging process. -->
To test, delete an early block and start Bitcoin.
<!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->
2020-06-14T12:50:20Z Reindexing block file blk00163.dat... 2020-06-14T12:51:03Z Loaded 518 blocks from external file in 42614ms 2020-06-14T12:51:03Z Reindexing block file blk00164.dat... 2020-06-14T12:51:26Z Loaded 606 blocks from external file in 22425ms 2020-06-14T12:51:26Z Reindexing block file blk00165.dat... 2020-06-14T12:52:04Z Loaded 492 blocks from external file in 38732ms 2020-06-14T12:52:04Z Reindexing block file blk00166.dat... 2020-06-14T12:52:29Z Loaded 518 blocks from external file in 24488ms 2020-06-14T12:52:29Z Reindexing block file blk00167.dat... 2020-06-14T12:53:10Z Loaded 595 blocks from external file in 41404ms 2020-06-14T12:53:10Z Reindexing block file blk00168.dat... 2020-06-14T12:53:32Z Loaded 573 blocks from external file in 22214ms 2020-06-14T12:53:32Z Reindexing block file blk00169.dat... 2020-06-14T12:53:37Z LoadExternalBlockFile: Deserialize or I/O error - CBufferedFile::Fill: end of file: unspecified iostream_category error 2020-06-14T12:53:37Z Loaded 42 blocks from external file in 5048ms 2020-06-14T12:53:37Z Reindexing block file blk00170.dat... 2020-06-14T12:53:49Z Reindexing block file blk00171.dat... 2020-06-14T12:54:05Z Reindexing block file blk00172.dat... 2020-06-14T12:54:17Z Reindexing block file blk00173.dat... 2020-06-14T12:54:29Z Reindexing block file blk00174.dat... 2020-06-14T12:54:45Z Reindexing block file blk00175.dat... 2020-06-14T12:54:57Z Reindexing block file blk00176.dat... 2020-06-14T12:55:10Z Reindexing block file blk00177.dat... 2020-06-14T12:55:25Z Reindexing block file blk00178.dat... 2020-06-14T12:55:37Z Reindexing block file blk00179.dat... 2020-06-14T12:55:54Z Reindexing block file blk00180.dat... 2020-06-14T12:56:13Z Reindexing block file blk00181.dat... 2020-06-14T12:56:31Z Reindexing block file blk00182.dat... 2020-06-14T12:56:47Z Reindexing block file blk00183.dat... 2020-06-14T12:57:01Z Reindexing block file blk00184.dat... 2020-06-14T12:57:15Z Reindexing block file blk00185.dat... 2020-06-14T12:57:32Z Reindexing block file blk00186.dat... 2020-06-14T12:57:46Z Reindexing block file blk00187.dat...