<p>Blocks are not stored in individual files, but flat bundles of a fixed size, so replacing one that is missing isn’t really possible. If a block can not be found on disk it has either keen deleted manually or by an errant process, or the disk is seriously corrupted. A re-index will fix this, but it’s an indicator of other possible issues related to hardware that this has happened. </p>

CC BY-SA 4.0
2018-11-02T13:16:56.090Z
Just to follow up on this, a reindex did work and took less time than I was expecting. Thank you!
Daniel McNally
CC BY-SA 4.0
2018-10-02T20:20:12.523Z
Thank you very much. So I take it that even though `reindex` says `Rebuild chain state and block index from the blk*.dat files on disk`, it will fetch the missing block(s) from peers when it comes across it? Is `-loadblock` potentially of any use here if I can get a blk00??.dat file with the missing block?
Daniel McNally
CC BY-SA 4.0
2018-10-03T01:13:52.170Z
This is correct.
Claris
CC BY-SA 4.0
2018-10-02T06:13:06.187Z
2018-10-02T06:13:06.187Z
Claris
<p>I have a full node with txindex enabled that I've been trying to use for an electrum server. However, whether I use ElectrumX or Electrs, I hit the same error on initial indexing of "Block not found on disk". With a bit of digging, I found out this error comes from the getblock rpc call, and the comment in the code for when this error is thrown is as follows:</p>

<blockquote>
  <p>Block not found on disk. This could be because we have the block
  header in our index but don't have the block (for example if a
  non-whitelisted node sends us an unrequested long chain of valid
  blocks, we add the headers to our index, but don't accept the
  block).</p>
</blockquote>

<p>I'm not sure how I got to this state. This is a node I initially spun up several years ago and reindexed to use txindex earlier this year, I've never had any issues with it for other purposes or any data loss/corruption issues that I can recall. If anyone has a theory/explanation, I'd be interested to hear it.</p>

<p>My question is: Can I fix this error without starting over from scratch? I'd like to avoid even a reindex if possible, although I'm not even sure if that would fix it because as I understand it reindex uses the blocks on disk and apparently I'm missing a block on disk. Is there a way to get only the block or file(s) that I need? I have a friend with a full node who would let me copy files if needed.</p>

<p>I don't know exactly which block is missing yet, although I could probably figure that out with some more digging if it would be helpful.</p>

<bitcoind><json-rpc><block><reindex>
Fixing "Block not found on disk" rpc error
Daniel McNally
# Fixing "Block not found on disk" rpc error

(Asked by: username_0 on 2018-10-02)

I have a full node with txindex enabled that I've been trying to use for an electrum server. However, whether I use ElectrumX or Electrs, I hit the same error on initial indexing of "Block not found on disk". With a bit of digging, I found out this error comes from the getblock rpc call, and the comment in the code for when this error is thrown is as follows:

> Block not found on disk. This could be because we have the block
> header in our index but don't have the block (for example if a
> non-whitelisted node sends us an unrequested long chain of valid
> blocks, we add the headers to our index, but don't accept the
> block).

I'm not sure how I got to this state. This is a node I initially spun up several years ago and reindexed to use txindex earlier this year, I've never had any issues with it for other purposes or any data loss/corruption issues that I can recall. If anyone has a theory/explanation, I'd be interested to hear it.

My question is: Can I fix this error without starting over from scratch? I'd like to avoid even a reindex if possible, although I'm not even sure if that would fix it because as I understand it reindex uses the blocks on disk and apparently I'm missing a block on disk. Is there a way to get only the block or file(s) that I need? I have a friend with a full node who would let me copy files if needed.

I don't know exactly which block is missing yet, although I could probably figure that out with some more digging if it would be helpful.

**Tags:** bitcoind, json-rpc, block, reindex


---

## 1 answers

### Answer by username_1 on 2018-10-02. Score: 2 | Accepted answer

Blocks are not stored in individual files, but flat bundles of a fixed size, so replacing one that is missing isn’t really possible. If a block can not be found on disk it has either keen deleted manually or by an errant process, or the disk is seriously corrupted. A re-index will fix this, but it’s an indicator of other possible issues related to hardware that this has happened.

> **Comments:**
> **username_0**: Thank you very much. So I take it that even though `reindex` says `Rebuild chain state and block index from the blk*.dat files on disk`, it will fetch the missing block(s) from peers when it comes across it? Is `-loadblock` potentially of any use here if I can get a blk00??.dat file with the missing block?  
> **username_1**: This is correct.  
> **username_0**: Just to follow up on this, a reindex did work and took less time than I was expecting. Thank you!  

---

