From 9a9fca331483b1956a8b015dbd51824df3bb4389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Furkan=20Akdo=C4=9Fan?= <70746444+furkan3152@users.noreply.github.com> Date: Mon, 2 Nov 2026 16:31:01 +0000 Subject: [PATCH 1/2] fix(init-bedrock): overwrite a leftover snapshot archive on retry When bedrock-init fails after the archive is on disk (checksum mismatch, interrupted extraction), the snapshot_downloads volume keeps /downloads/snapshot.tar.zst. On the next run aria2c's default auto-file-renaming saves the new download as snapshot.tar.1.zst, and the script then verifies and extracts the stale snapshot.tar.zst instead. Once a newer daily snapshot is published the retry can never pass the checksum, and each attempt leaves another full-size archive behind. Let aria2c overwrite the target file. Downloads that still have their .aria2 control file are resumed as before. --- scripts/utils.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/utils.sh b/scripts/utils.sh index fa5293c..eb2e1bf 100755 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -31,13 +31,21 @@ function extractlz4() { # Arguments: # url: URL of the file to download. # out: Location to download the file to. +# +# A file left at `out` by an earlier failed run (for example after a checksum +# mismatch or an interrupted extraction) must be replaced, not kept: by default +# aria2c saves the new download as ".1." and the caller would go on +# to verify and extract the stale file. An unfinished download that still has +# its .aria2 control file is resumed as before. function download() { local out_dir out_name out_dir="$(dirname "$2")" out_name="$(basename "$2")" mkdir -p "$out_dir" - aria2c --max-tries=0 -x 16 -s 16 -k100M --dir="$out_dir" --out="$out_name" "$1" + aria2c --max-tries=0 -x 16 -s 16 -k100M \ + --allow-overwrite=true --auto-file-renaming=false \ + --dir="$out_dir" --out="$out_name" "$1" } # verify_sha256_checksum: Verifies a downloaded file against a checksum file. From e6f95c548756433065686c85b94d59b90929b86f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Furkan=20Akdo=C4=9Fan?= <70746444+furkan3152@users.noreply.github.com> Date: Mon, 2 Nov 2026 16:46:21 +0000 Subject: [PATCH 2/2] docs: describe snapshot retry after a checksum failure --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d36b421..4d57a22 100644 --- a/README.md +++ b/README.md @@ -371,8 +371,10 @@ If image pulls or snapshot downloads fail, make sure the host can reach: If `bedrock-init` exits with `Unexpected checksum file format`, `Checksum file does not match downloaded archive`, or `SHA256 verification -failed`, do not reuse that download. Retry later or verify the checksum -yourself before attempting another restore. +failed`, retry later: the next run downloads the snapshot again and replaces +the failed archive. Archives named like `snapshot.tar.1.zst`, left by runs +before this behaviour, stay in the `snapshot_downloads` volume until you remove +them (for example with `docker compose down -v`). ### Snapshot sources