RPI 2: update DietPi from v9.7.1 to v9.8.0 -Expected file size failes-

Required Information

  • DietPi version | v.9.7.1
  • Distro version | bookworm 0
  • Kernel version | Linux rocketeer 6.1.21-v7+ #1642 SMP Mon Apr 3 17:20:52 BST 2023 armv7l GNU/Linux
  • Architecture | armhf
  • SBC model | RPI2
  • Power supply used | (EG: 5V 1A RAVpower)
  • SD card used | (EG: SanDisk ultra)

Additional Information (if applicable)

  • Software title | Docker, Vaultwarden (docker container), Argon2

Steps to reproduce

  1. $ apt update

Expected behaviour

Should update package repository

Actual behaviour

Expected file size failes

Extra details

E: Could not get https://dietpi.com/apt/dists/bookworm/main/binary-armhf/Packages.xz File has unexpected size (2232 != 2292). Mirror sync in progress? [IP: 188.114.96.0 443]
   Hashes of expected file:
    - Filesize:2292 [weak]
    - SHA256:df2870e384ee3eaa9249b1c1e9d401198e9ce9c0ed8aec5dba27086cb62fc799
   Release file created at: Wed, 20 Nov 2024 01:36:13 +0000

I can download the file within a browser without issue. As well xz package seems to be ok.
Can you retry?

333 / 5.000
It looks like the storage space on the SD card has not been increased.
I have a small script for this (expand_fs.sh):

expand filesystem and reboot:

sudo systemctl enable dietpi-fs_partition_resize && sudo reboot

after that it is best to run sudo dpkg --configure -a,
then sudo apt update && sudo apt full-upgrade -y

I have no problem downloading the file with eg. wget, but when I do a get update, the file has an unexpected size.
Maybe itā€™s af wrong SHA256 checksumā€¦?
I updated my RPI1, RPI3 and RPI4 without any errors

The storage space on the SD card has been increased. Thereā€™s a lot of free space left on th SD-card

I donā€™t think comment of @Ludger.Kuehm has any relation with the topic

Anyway, for me the file download is intact

root@DietPiProd:~# cd /tmp/
root@DietPiProd:/tmp# wget https://dietpi.com/apt/dists/bookworm/main/binary-armhf/Packages.xz
--2024-11-20 16:29:56--  https://dietpi.com/apt/dists/bookworm/main/binary-armhf/Packages.xz
Resolving dietpi.com (dietpi.com)... 188.114.96.3, 188.114.97.3, 2a06:98c1:3120::4, ...
Connecting to dietpi.com (dietpi.com)|188.114.96.3|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2292 (2.2K) [application/x-xz]
Saving to: ā€˜Packages.xzā€™

Packages.xz                                     100%[====================================================================================================>]   2.24K  4.45KB/s    in 0.5s

2024-11-20 16:29:57 (4.45 KB/s) - ā€˜Packages.xzā€™ saved [2292/2292]

You see >> Length: 2292 (2.2K) [application/x-xz] as expected and 2024-11-20 16:29:57 (4.45 KB/s) - ā€˜Packages.xzā€™ saved [2292/2292]

As well hash is ok

root@DietPiProd:/tmp# sha256sum Packages.xz
df2870e384ee3eaa9249b1c1e9d401198e9ce9c0ed8aec5dba27086cb62fc799  Packages.xz

I can extract the file without issue

root@DietPiProd:/tmp# ls -la | grep Packages
-rw-r--r--  1 root root  2292 Nov 20 02:36 Packages.xz
root@DietPiProd:/tmp# xz -d Packages.xz
root@DietPiProd:/tmp# ls -la | grep Packages
-rw-r--r--  1 root root 12815 Nov 20 02:36 Packages
root@DietPiProd:/tmp#

and finally, content is readable using cat Packages

@Joulinar
I thought that maybe the storage space on the SD card had not been increased.
But it seems to be a different problem.

I am having the same issue now for https://dietpi.com/apt/dists/bookworm/main/binary-amd64/Packages.xz.

Unexpected size (2492 != 2552) Mirror sync in progress? [IP: 188.114.97.0 443]
Release file created at: Thu, 21 Nov 2024 19:11:21 +0000

That is a very recent update. Could it indeed still be updating on all mirrors?

I saw the same issue being resolved in July as well:
https://dietpi.com/forum/t/rpi-4-unexpected-filesize-error-while-installing-progs-update/20716/4

for me the download is ok

root@DietPiProd:/tmp# wget https://dietpi.com/apt/dists/bookworm/main/binary-amd64/Packages.xz
--2024-11-21 23:32:03--  https://dietpi.com/apt/dists/bookworm/main/binary-amd64/Packages.xz
Resolving dietpi.com (dietpi.com)... 104.21.12.65, 172.67.193.183, 2a06:98c1:3120::3, ...
Connecting to dietpi.com (dietpi.com)|104.21.12.65|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2552 (2.5K) [application/x-xz]
Saving to: ā€˜Packages.xzā€™

Packages.xz                                     100%[====================================================================================================>]   2.49K  --.-KB/s    in 0s

2024-11-21 23:32:04 (20.6 MB/s) - ā€˜Packages.xzā€™ saved [2552/2552]

root@DietPiProd:/tmp#

Package size is ok ā€˜Packages.xzā€™ saved [2552/2552]

Maybe a temp issue with Cloudflare cache we use to hold some data. Can you check again pls.

Yay! :grinning:
That fixed it.
Thanks A LOT!

Thank U for all your help.

Hey, @Joulinar . Iā€™m still getting the same issue after 4h.

I know you mentioned it as a Cloudflare cache, but I see you getting the Packages.xz around 2.5k, Iā€™m only getting 2.2k of the file. Iā€™m able to get the package no problem using wget, so I donā€™t think itā€™s a network problem.

Thanks for the help!

root@DietPi:/tmp/DietPi-Software# apt update
Hit:1 https://deb.debian.org/debian bookworm InRelease
Hit:2 https://deb.debian.org/debian bookworm-updates InRelease
Hit:3 https://deb.debian.org/debian-security bookworm-security InRelease
Get:4 https://dietpi.com/apt bookworm InRelease [3529 B]
Hit:5 https://deb.debian.org/debian bookworm-backports InRelease
Hit:6 https://dietpi.com/apt all InRelease
Hit:7 https://archive.raspberrypi.com/debian bookworm InRelease
Get:8 https://dietpi.com/apt bookworm/main arm64 Packages [2172 B]
Err:8 https://dietpi.com/apt bookworm/main arm64 Packages
  File has unexpected size (2300 != 2172). Mirror sync in progress? [IP: 172.67.193.183 443]
  Hashes of expected file:
   - Filesize:2172 [weak]
   - SHA256:aa1df998374cafc8b442f90522c050764bf915a07bc3bb1f49e8063f3fbdd81a
  Release file created at: Sat, 12 Oct 2024 14:44:36 +0000
Get:9 https://dietpi.com/apt bookworm/rpi3 arm64 Packages [656 B]
Fetched 4185 B in 5s (922 B/s)
Reading package lists... Done
E: Failed to fetch https://dietpi.com/apt/dists/bookworm/main/binary-arm64/Packages.xz  File has unexpected size (2300 != 2172). Mirror sync in progress? [IP: 172.67.193.183 443]
   Hashes of expected file:
    - Filesize:2172 [weak]
    - SHA256:aa1df998374cafc8b442f90522c050764bf915a07bc3bb1f49e8063f3fbdd81a
   Release file created at: Sat, 12 Oct 2024 14:44:36 +0000
E: Some index files failed to download. They have been ignored, or old ones used instead.
root@DietPi:/tmp/DietPi-Software# wget https://dietpi.com/apt/dists/bookworm/main/binary-arm64/Packages.xz
--2024-11-22 02:40:25--  https://dietpi.com/apt/dists/bookworm/main/binary-arm64/Packages.xz
Resolving dietpi.com (dietpi.com)... 172.67.193.183, 104.21.12.65, 2606:4700:3035::6815:c41, ...
Connecting to dietpi.com (dietpi.com)|172.67.193.183|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2300 (2.2K) [application/x-xz]
Saving to: ā€˜Packages.xz.1ā€™

Packages.xz.1                                                         100%[=========================================================================================================================================================================>]   2.25K  --.-KB/s    in 0s

2024-11-22 02:40:25 (5.29 MB/s) - ā€˜Packages.xz.1ā€™ saved [2300/2300]

I have the same issue when fresh installing the RPI 2/3/4/Zero 2 img onto a raspberry pi zero 2w. The first boot fails when it tries to run ā€œapt-get -y -eany updateā€, and says unexpected file size 2300 != 2236

We would need to check with Cloudflare why these happen to Packages.xz files. It looks like cache is not correctly cleared, even if we trigger this actively. Could be a challenge with some edge locations. In worst case we might need to disable caching for these files.

ok now I know why wget download has been working while it fails on apt

Problem is the InRelease file being outdated and containing the wrong old size for Packages.xz. Therefore apt is complaining.

Release file created at: Sat, 12 Oct 2024

Also you see the very old date of the Release file from October, while it should be from yesterday.

We disabled the cache for the InRelease files now. In parallel we will check back with Cloudflare community, which reasons can be for cache entries to remain in some edge servers, despite ordering their removal via Cloudflare API.

1 Like

Itā€™s fixed on my end, thank you so much for the explanation!

1 Like

Details:

  • Date | 2024-12-18 15:02:20
  • Program name | DietPi-BugReport
  • Command | 7zr a -m0=lzma2 -mx=9 -spf -x!/var/log/journal/* .7z CMD_OUT.txt G_EXEC_ERROR_REPORT /var/log /boot/config.txt /boot/cmdline.txt /boot/boot.ini /boot/uenv.txt /boot/uEnv.txt /boot/armbianEnv.txt /boot/boot.cmd /boot/dietpi.txt /boot/dietpi /var/lib/dietpi /var/tmp/dietpi /run/dietpi /etc/bash.bashrc /etc/bashrc.d /root/.bashrc /etc/profile /etc/profile.d /root/.profile /etc/rc.local /etc/X11/xorg.conf /etc/X11/xorg.conf.d /etc/asound.conf /etc/network/interfaces /etc/network/interfaces.d /etc/wpa_supplicant/wpa_supplicant.conf /etc/fstab /etc/sysctl.conf /etc/sysctl.d /etc/init.d /etc/systemd/system /lib/systemd/system /usr/local/lib/systemd/system /etc/apt/sources.list /etc/apt/sources.list.d /etc/apt/preferences /etc/apt/preferences.d /etc/apt/apt.conf.d
  • Exit code | 127
  • DietPi version | v9.8.0 (MichaIng/master)
  • Distro version | (ID=)
  • Kernel version | Linux rk322x-box 6.1.50-current-rk322x #2 SMP PREEMPT Wed Aug 30 14:11:13 UTC 2023 armv7l GNU/Linux
  • Architecture | armhf
  • Hardware model | (ID=)
  • Power supply | (EG: RAVPower 5V 1A)
  • SD card | (EG: SanDisk Ultra 16 GB)

Steps to reproduce:

  1. ā€¦
  2. ā€¦

Expected behaviour:

  • ā€¦

Actual behaviour:

  • ā€¦

Extra details:

  • ā€¦

Additional logs:

/boot/dietpi/func/dietpi-globals: line 912: 7zr: command not found

Pls open a new topic it is different from the above

Iā€™m getting this same issue with a release file thatā€™s dated with Dec 11, 2024. Anything I can do on my side?

we disabled Cloudflare caching already. pls try again later. Maybe it will take a while for Cloudflare to clear cach on all edge location.

If it still happen again, share the whole error message.