smartcontracts / simple-optimism-node

The easiest way to run an Optimism node
MIT License
318 stars 105 forks source link

bedrock init error 66 : Decompression error : ERROR_contentChecksum_invalid #118

Closed BoogalooLi closed 5 months ago

BoogalooLi commented 5 months ago

I want to run a fullnode by docker, but the logs in bedrock-init shows snapshot checksum invalid.

simple-optimism-node-bedrock-init-1 | gid |stat|avg speed |path/URI simple-optimism-node-bedrock-init-1 | ======+====+===========+======================================================= simple-optimism-node-bedrock-init-1 | dfae37|OK | 106MiB/s|//downloads/bedrock.tar.lz4 simple-optimism-node-bedrock-init-1 | simple-optimism-node-bedrock-init-1 | Status Legend: simple-optimism-node-bedrock-init-1 | (OK):download completed. simple-optimism-node-bedrock-init-1 | Extracting bedrock.tar... simple-optimism-node-bedrock-init-1 | Error 66 : Decompression error : ERROR_contentChecksum_invalid simple-optimism-node-bedrock-init-1 | tar: Child returned status 66 simple-optimism-node-bedrock-init-1 | tar: Error is not recoverable: exiting now

Chomtana commented 5 months ago

This is a bug in lz4 that's installed by apt. Will try to fix it

https://github.com/pierrec/lz4/issues/27

Apt installed a 2020 version

LZ4 command line interface 64-bits v1.9.3, by Yann Collet

BoogalooLi commented 5 months ago

This is a bug in lz4 that's installed by apt. Will try to fix it

pierrec/lz4#27

Can I fix it manually? Thank you

Chomtana commented 5 months ago

You can manually stop docker compose (docker compose down), extract bedrock.tar.lz4 in the docker volume folder and then start docker again (docker compose up -d)

cd to docker volume directory as root

cd /var/lib/docker/volumes/simple-optimism-node_torrent_downloads/_data

(Path may differ if not using Ubuntu)

And extract bedrock.tar.lz4 to /var/lib/docker/volumes/simple-optimism-node_op_geth/_data (Different volume)

BoogalooLi commented 5 months ago

You can manually stop docker compose (docker compose down), extract bedrock.tar.lz4 in the docker volume folder and then start docker again (docker compose up -d)

cd to docker volume directory as root

cd /var/lib/docker/volumes/simple-optimism-node_torrent_downloads/_data

(Path may differ if not using Ubuntu)

And extract bedrock.tar.lz4 to /var/lib/docker/volumes/simple-optimism-node_op_geth/_data (Different volume)

After extracting the data and rerun the docker containers, bedrock-init download the file again.

0xpanoramix commented 5 months ago

I assume it tries to download again because the bedrock-init checks for the existence of a /shared/initialized.txt file which is only created after the script has completed.

The check is made here while the file is created here.

Because you're extracting manually without creating the flag file, it'll try to download again on the next startup.

So maybe try to create a /shared/initialized.txt file in the volume and run again?

cc @BoogalooLi @Chomtana

Chomtana commented 5 months ago

Yes as @0xpanoramix said create an initialized.txt file in /var/lib/docker/volumes/simple-optimism-node_shared/_data.

touch /var/lib/docker/volumes/simple-optimism-node_shared/_data/initialized.txt
BoogalooLi commented 5 months ago

Thanks a lot. I'll try it. Thanks.