I'm running a Geth mainnet node. As the size of chaindata is rapidly rising, I moved ancient to an auxiliary HDD plugged in to the same system. Some time afterwards (not sure when, maybe days?) I found my node was dead, and giving me the error:

Fatal: Error starting protocol stack: gap in the chain between ancients and leveldb

Looking at the Geth blog announcement of Freezer and the ancient store, it looks like if ancient is corrupted, everything is toast. Is there any way to salvage anything before having to wipe everything and start from scratch? In a similar question I see that's what the OP did, but I'd like to see if there's any possible salvage or troubleshooting to be done.

It would seem to me from the blog post that I should be able to at least try to delete the chaindata but not ancient. That way, if the issue is in chaindata, ancient should rebuild at least some of the history, and spare me that much resync. As per the Geth blog:

If, however, the state database is the one delete, Geth will reconstruct all its indices based on the frozen data; and then do a fast sync on top to back-fill the missing state.


1 Answer 1


As you say, upon issuing the "geth removedb" command, choose only to delete the leveldB and not the ancient dB.

Then restart geth. If the ancient dB is not corrupted it will indeed rebuild the leveldB again and catchup with what it needs to do in the ancient dB.

  • I'd forgotten about this question! Thanks for answering - first things first, is there a chance that it isn't corrupted if I'm getting an error like this? Feb 1, 2021 at 8:24
  • Unlikely with that message ... by keeping the ancient dB you will save a lot of time in the sync process anyway Feb 1, 2021 at 13:22
  • Your answer did not fix instead deleted dB for nothing
    – alper
    Mar 7, 2021 at 11:03
  • @alper you have not submitted your issue. Removing just the leveldB and rebuilding it from the ancient dB does not take that long. If your chaindata was corrupt then you have no choice but to delete both ancient and level dB's Mar 8, 2021 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.