Electrs Keeps Resyncing from Block 0 After Reboots or Crashes

Hi,

I’m using Umbrel on a Raspberry Pi 5 (8GB RAM) with a Crucial P3 Plus NVMe SSD (ext4), and I’m having a problem with Electrs.

Every time the system crashes or loses power, Electrs resets and starts syncing again from block 0. It never finishes because any small interruption makes it start over.

I saw in the logs that auto_reindex: true is enabled, which I think is causing Electrs to delete its database and start over if anything goes wrong — even if Bitcoin Core is still fully synced.

This also happened a few times when Bitcoin Core dropped from 100% to 99% during the first couple of days, even without a full crash.

How can I stop this from happening?

Thanks a lot!

Based on the limited information you provide, here’s my advice.

You have an Umbrelos installation that has already suffered several “disasters” and is already experiencing several problems. The problems you’re detecting (I’m sure there are more and you haven’t noticed) already affect Electrs and Bitcoin-Core.

If you only have that installed (Electrs and Bitcoin-Core), I would start from scratch: a new Umbrelos installation, a new Bitcoin-Core installation, and a new Electrs installation. If anything else is installed, I would back up the important stuff.

This ensures you have a secure and reliable installation. The current one isn’t, and it’s cheaper in terms of time and effort to start from scratch than to try to fix it.

The order would be as follows:

  1. Install Umbrel.

  2. Install Bitcoin-Core and fully synchronize the blockchain.

  3. Install electrs (after step 2 has been completed) and give it time to fully index the blockchain. This will take a few hours depending on your hardware.

How can I stop this from happening (again)?

  • Add a good UPS. This will help prevent power outages and sudden shutdowns.

While you’re at it, be sure to read a short Good Practices manual. It’s still valid for the current version 1.4.