electrs: Bug: OversizedVectorAllocation during initial synch (0.9.9)

Describe the bug Fresh Umbrel installation, fully synched Bitcoin Core, freshly installed Electrum fails and stops to synch:

Attaching to electrs_app_1, electrs_app_proxy_1, electrs_electrs_1, electrs_tor_1 electrs_1 | [2022-11-19T11:25:17.079Z INFO electrs::index] indexing 2000 blocks: [548741…550740] electrs_1 | thread ‘p2p_loop’ panicked at ‘invalid message: OversizedVectorAllocation { requested: 14330322073680149042, max: 4000000 }’, src/p2p.rs:250:70 electrs_1 | note: run with RUST_BACKTRACE=1 environment variable to display a backtrace electrs_1 | [2022-11-19T11:25:17.578Z INFO electrs::db] closing DB at /data/db/bitcoin electrs_1 | Error: electrs failed electrs_1 | electrs_1 | Caused by: electrs_1 | 0: sync failed electrs_1 | 1: failed to get block 0000000000000000000b187c3d983a2b73d33d873532d44f8c9081ec28d403b5 electrs_1 | 2: receiving on an empty and disconnected channel

I have tried this for the 3rd time now (un- and reinstalled Electrum, deleted all files in between, restarted synching). It seems it’s always giving me the same error and it always stops at the same block height or same synching percentage (72%).

Electrs version 0.9.9

To Reproduce Steps to reproduce the behavior:

  1. Configure and start Umbrel with BTC node, install Electrum after BTC is fully synched
  2. Install Electrum App and let it synch initially
  3. Wait
  4. See error

Expected behavior Electrum Server synchs to 100% and doesn’t stop in between, not being able to finish.

Configuration

  • Umbrel 0.5.3 on RasPi
  • Bitcoin Core 23.0
  • Electrum 0.9.9

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 26 (14 by maintainers)

Most upvoted comments

@amosgroth I am closing this issue for now, please reopen if the corruption reproduces.

Please upgrade to the latest release (0.9.10).

You can also check the version by running:

$ ./target/release/electrs --version
v0.9.10

Thanks so much for your support and time anyway! If you have more ideas to share, let me know! Otherwise I will be sitting in the library tomorrow, trying to resync. 😃

2022-11-19T20:37:20Z ERROR: ReadBlockFromDisk: Deserialize or I/O error - ReadCompactSize(): size too large: iostream error at FlatFilePos(nFile=1421, nPos=50038035)

is indeed the relevant issue - looks like the block is corrupted on disk 😦

Would there be the possibility to redownload and integrate the corrupted block with BTC Core in order to fix my problem with Electrum? (to prevent synching the whole blockchain from scratch)

Maybe you can try:

getblockfrompeer "blockhash" peer_id

Attempt to fetch block from a given peer.

We must have the header for this block, e.g. using submitheader.
Subsequent calls for the same block and a new peer will cause the response from the previous peer to be ignored.

Returns an empty JSON object if the request was successfully scheduled.

Arguments:
1. blockhash    (string, required) The block hash to try to fetch
2. peer_id      (numeric, required) The peer to fetch it from (see getpeerinfo for peer IDs)

Result:
{}    (empty JSON object)

Examples:
> bitcoin-cli getblockfrompeer "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" 0

No luck:

umbrel@umbrel:~ $ ./umbrel/scripts/app compose bitcoin exec bitcoind bitcoin-cli getblockfrompeer 0000000000000000000b187c3d983a2b73d33d873532d44f8c9081ec28d403b5 84
error code: -1
error message:
Block already downloaded