Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update DietPi from v9.4.2 to v9.8.0 fails #7257

Open
1 task done
klankschap opened this issue Oct 24, 2024 · 31 comments
Open
1 task done

update DietPi from v9.4.2 to v9.8.0 fails #7257

klankschap opened this issue Oct 24, 2024 · 31 comments

Comments

@klankschap
Copy link

klankschap commented Oct 24, 2024

Creating a bug report/issue

  • I have searched the existing open and closed issues

Required Information

  • DietPi version | cat /boot/dietpi/.version

G_DIETPI_VERSION_CORE=9
G_DIETPI_VERSION_SUB=4
G_DIETPI_VERSION_RC=2
G_GITBRANCH='master'
G_GITOWNER='MichaIng'
G_LIVE_PATCH_STATUS[0]='not applicable'

  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN

bookworm

  • Kernel version | uname -a

Linux npi 6.6.30-current-sunxi64 #1 SMP Thu May 2 14:32:50 UTC 2024 aarch64 GNU/Linux

  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)

NanoPi NEO Plus2 (aarch64)

  • Power supply used | (EG: 5V 1A RAVpower)

5V

  • SD card used | (EG: SanDisk ultra)

SanDisk ultra

Additional Information (if applicable)

  • Software title | (EG: Nextcloud)

  • Was the software title installed freshly or updated/migrated?
    both

  • Can this issue be replicated on a fresh installation of DietPi?
    yes

  • Bug report ID | echo $G_HW_UUID

e8265b8a-e9fa-40c7-8de2-dae518b5667a

Steps to reproduce

  1. sudo dietpi-update
    or sudo apt update

  2. ...

Expected behaviour

  • it should update to v9.8

Actual behaviour

  • it keeps trying to download th epackages, but ends up failing with connection timeouts.

Extra details

$ sudo apt update
Hit:1 https://dietpi.com/apt bookworm InRelease                          
Hit:2 https://dietpi.com/apt all InRelease                               
Get:3 https://deb.debian.org/debian bookworm InRelease [151 kB]
Get:4 https://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Get:5 https://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Get:6 https://deb.debian.org/debian bookworm-backports InRelease [59.0 kB]
Get:7 https://deb.debian.org/debian bookworm/main arm64 Packages [8689 kB]
Ign:7 https://deb.debian.org/debian bookworm/main arm64 Packages                                                                                                                                   
Get:8 https://deb.debian.org/debian bookworm-backports/main arm64 Packages.diff/Index [63.3 kB]
Get:8 https://deb.debian.org/debian bookworm-backports/main arm64 Packages.diff/Index [63.3 kB]
Get:10 https://deb.debian.org/debian bookworm-backports/non-free arm64 Packages T-2024-10-24-0205.40-F-2024-10-24-0205.40.pdiff [5372 B]                                                           
Get:10 https://deb.debian.org/debian bookworm-backports/non-free arm64 Packages T-2024-10-24-0205.40-F-2024-10-24-0205.40.pdiff [5372 B]                                                           
Get:11 https://deb.debian.org/debian bookworm-backports/main arm64 Packages T-2024-10-24-1404.10-F-2024-10-24-1404.10.pdiff [2534 B]                                                               
Get:11 https://deb.debian.org/debian bookworm-backports/main arm64 Packages T-2024-10-24-1404.10-F-2024-10-24-1404.10.pdiff [2534 B]                                                               
Get:12 https://deb.debian.org/debian bookworm/non-free arm64 Packages [75.8 kB]                                                                                                                    
Get:13 https://deb.debian.org/debian bookworm/non-free-firmware arm64 Packages [5832 B]                                                                                                            
Get:14 https://deb.debian.org/debian bookworm/contrib arm64 Packages [45.7 kB]                                                                                                                     
Get:7 https://deb.debian.org/debian bookworm/main arm64 Packages [8689 kB]                                                                                                                         
Ign:7 https://deb.debian.org/debian bookworm/main arm64 Packages                                                                                                                                   
Get:7 https://deb.debian.org/debian bookworm/main arm64 Packages [8689 kB]                                                                                                                         
Ign:7 https://deb.debian.org/debian bookworm/main arm64 Packages                                                                                                                                   
Get:7 https://deb.debian.org/debian bookworm/main arm64 Packages [8689 kB]                                                                                                                         
Ign:7 https://deb.debian.org/debian bookworm/main arm64 Packages                                                                                                                                   
Get:7 https://deb.debian.org/debian bookworm/main arm64 Packages [8689 kB]
Err:7 https://deb.debian.org/debian bookworm/main arm64 Packages                                                                                                                                   
  Connection timed out [IP: 151.101.38.132 443]
Get:7 https://deb.debian.org/debian bookworm/main arm64 Packages [11.9 MB]                                                                                                                         
Ign:7 https://deb.debian.org/debian bookworm/main arm64 Packages                                                                                                                                   
Get:7 https://deb.debian.org/debian bookworm/main arm64 Packages [11.9 MB]
Err:7 https://deb.debian.org/debian bookworm/main arm64 Packages                                                                                                                                   
  Connection timed out [IP: 2a04:4e42:9::644 443]
Ign:7 https://deb.debian.org/debian bookworm/main arm64 Packages
Err:7 https://deb.debian.org/debian bookworm/main arm64 Packages
  Connection timed out [IP: 2a04:4e42:9::644 443]
Fetched 55.5 kB in 19min 17s (47 B/s)
Reading package lists... Done
N: Repository 'https://deb.debian.org/debian bookworm InRelease' changed its 'Version' value from '12.5' to '12.7'
E: Failed to fetch https://deb.debian.org/debian/dists/bookworm/main/binary-arm64/Packages  Connection timed out [IP: 2a04:4e42:9::644 443]
E: Some index files failed to download. They have been ignored, or old ones used instead.
$ ping -6 2a04:4e42:9::644
PING 2a04:4e42:9::644(2a04:4e42:9::644) 56 data bytes
64 bytes from 2a04:4e42:9::644: icmp_seq=1 ttl=59 time=6.66 ms
64 bytes from 2a04:4e42:9::644: icmp_seq=2 ttl=59 time=4.52 ms
64 bytes from 2a04:4e42:9::644: icmp_seq=3 ttl=59 time=6.66 ms
64 bytes from 2a04:4e42:9::644: icmp_seq=4 ttl=59 time=3.90 ms
64 bytes from 2a04:4e42:9::644: icmp_seq=5 ttl=59 time=2.66 ms
64 bytes from 2a04:4e42:9::644: icmp_seq=6 ttl=59 time=4.00 ms
$ ping 151.101.38.132
PING 151.101.38.132 (151.101.38.132) 56(84) bytes of data.
64 bytes from 151.101.38.132: icmp_seq=1 ttl=58 time=6.40 ms
64 bytes from 151.101.38.132: icmp_seq=2 ttl=58 time=4.26 ms
64 bytes from 151.101.38.132: icmp_seq=3 ttl=58 time=3.50 ms
64 bytes from 151.101.38.132: icmp_seq=4 ttl=58 time=4.63 ms
^C
--- 151.101.38.132 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3010ms

also from fresh image:

 DietPi-Update
─────────────────────────────────────────────────────
 Phase: Checking for available DietPi update

[  OK  ] DietPi-Update | Checking IPv4 network connectivity
[  OK  ] DietPi-Update | Checking IPv6 network connectivity
[  OK  ] DietPi-Update | Checking DNS resolver
[  OK  ] DietPi-TimeSync | systemctl stop systemd-timesyncd
[  OK  ] DietPi-TimeSync | mkdir -p /run/systemd/timesync
[ INFO ] DietPi-Update | Getting latest version from: https://raw.githubusercontent.com/MichaIng/DietPi/master/.update/version
[  OK  ] DietPi-Update | Got valid latest version: 9.8.0
[  OK  ] DietPi-Update | Update available:
[ INFO ] DietPi-Update | Current version : v9.7.1
[ INFO ] DietPi-Update | Latest version  : v9.8.0

...
Err:21 https://deb.debian.org/debian bookworm/main arm64 Packages
  Connection timed out [IP: 151.101.38.132 443]
Ign:21 https://deb.debian.org/debian bookworm/main arm64 Packages
Err:21 https://deb.debian.org/debian bookworm/main arm64 Packages
  Connection timed out [IP: 151.101.38.132 443]
Fetched 525 kB in 28min 29s (307 B/s)
Reading package lists...
E: Failed to fetch https://deb.debian.org/debian/dists/bookworm/main/binary-arm64/Packages  Connection timed out [IP: 151.101.38.132 443]
E: Some index files failed to download. They have been ignored, or old ones used instead.
[FAILED] DietPi-Update | APT update
 - Command: apt-get -y -eany update
[FAILED] DietPi-Update | Unable to continue, DietPi-Update will now terminate.
@Joulinar
Copy link
Collaborator

Do you have a special network security device that could close connections for some reason? This looks pretty strange. At first it works for the first 5-6 connections, but shortly after that it times out 🤔

@klankschap
Copy link
Author

nope

@MichaIng
Copy link
Owner

Does it work doing just a "Retry" from the error handler menu?

Else, can you enter a subshell and check network details:

ip a
ip r

@klankschap
Copy link
Author

klankschap commented Oct 26, 2024

a retry did not make any difference after a dietpi-update fail
neither did apt update

# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 02:01:e2:89:bf:fa brd ff:ff:ff:ff:ff:ff
    altname end0
    inet 192.168.178.46/24 brd 192.168.178.255 scope global dynamic eth0
       valid_lft 719992sec preferred_lft 719992sec
    inet6 2a10:3781:4b93:1:1:e2ff:fe89:bffa/64 scope global dynamic mngtmpaddr 
       valid_lft 7052sec preferred_lft 3452sec
    inet6 fe80::1:e2ff:fe89:bffa/64 scope link 
       valid_lft forever preferred_lft forever
# ip r
default via 192.168.178.1 dev eth0 
192.168.178.0/24 dev eth0 proto kernel scope link src 192.168.178.46 

@klankschap
Copy link
Author

Would it be a work around to download the files using a different machine, then place them onto the SD card in a /tmp folder, then point apt to that folder?
How would that work in practice?

@MichaIng
Copy link
Owner

Does it work to download the list manually?

cd /tmp
wget https://deb.debian.org/debian/dists/bookworm/main/binary-arm64/Packages

If it is the list only, and we name and place it correctly, it could even work. But I fear that downloading the packages results in the same connection timeout.

Seems to be some issue between you and the Debian mirror the CDN is choosing or you. Not sure which one it is, as there is no reverse DNS record given. Does the browser change to a different URL when opening this link, or show the mirror near the bottom of the page? https://deb.debian.org/debian/

However, easiest should be when you switch to a different mirror. Can be done from the error handler. dietpi-config > Network Options: Misc > APT mirror.

@klankschap
Copy link
Author

changing to a different mirror (de / uk) did not make a difference.
i can get the Packages.gz using a different machine in the network
wget https://deb.debian.org/debian/dists/bookworm/main/binary-arm64/Packages.gz

but as the dietpi hasn't made it through its first initial setup, there is no way to get it there via scp, or is there?

@MichaIng
Copy link
Owner

The file alone does not help anyway, as the individual packages would likely fail the same way. So manually downloading via wget or curl does not work either? I mean you can just test to download a package:

cd /tmp
wget https://deb.debian.org/debian/pool/main/d/dash/dash_0.5.12-9_amd64.deb

or a different package from our server:

wget https://dietpi.com/downloads/binaries/sprd-bluetooth.deb

Maybe there is a general network issue. @StephanStS you have a NanoPi NEO Plus2 as well right? Does it still work well for you with APT updates etc with recent kernel?

I'll also update all our images now, maybe the newer kernel helps.

@klankschap
Copy link
Author

cd /tmp
wget https://deb.debian.org/debian/pool/main/d/dash/dash_0.5.12-9_amd64.deb
or a different package from our server:
wget https://dietpi.com/downloads/binaries/sprd-bluetooth.deb

this works without issues.

# ls -l
total 156
-rw-r--r-- 1 root root 93152 Jun  6 10:06 dash_0.5.12-9_amd64.deb
-rw-r--r-- 1 root root 64828 Oct 10 23:09 sprd-bluetooth.deb

Maybe there is a general network issue. @StephanStS you have a NanoPi NEO Plus2 as well right? Does it still work well for you with APT updates etc with recent kernel?

Yes, I have a NanoPi NEO Plus2. Updating from a previous version, or starting from a fresh download (which insists on updating) did not work, causing timeouts.

I'll also update all our images now, maybe the newer kernel helps.

OK, please let me know when it is ready to go.

@MichaIng
Copy link
Owner

MichaIng commented Oct 29, 2024

Hmm downloading the packages works, but the text file does still not?

cd /tmp
wget https://deb.debian.org/debian/dists/bookworm/main/binary-arm64/Packages

Weird 🤔.

Actually APT should download the xz archive:

cd /tmp
wget https://deb.debian.org/debian/dists/bookworm/main/binary-arm64/Packages.xz

@klankschap
Copy link
Author

wget https://deb.debian.org/debian/dists/bookworm/main/binary-arm64/Packages
--2024-10-29 15:11:15-- https://deb.debian.org/debian/dists/bookworm/main/binary-arm64/Packages
Resolving deb.debian.org (deb.debian.org)... 2a04:4e42:9::644, 151.101.38.132
Connecting to deb.debian.org (deb.debian.org)|2a04:4e42:9::644|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2024-10-29 15:11:16 ERROR 404: Not Found.

I guess the Packages file does not exist.
Is there an extension missing?
Packages.gz seems to take forever to download

# wget https://deb.debian.org/debian/dists/bookworm/main/binary-arm64/Packages.gz
--2024-10-29 15:14:20--  https://deb.debian.org/debian/dists/bookworm/main/binary-arm64/Packages.gz
Resolving deb.debian.org (deb.debian.org)... 2a04:4e42:9::644, 151.101.38.132
Connecting to deb.debian.org (deb.debian.org)|2a04:4e42:9::644|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11934473 (11M) [application/x-gzip]
Saving to: ‘Packages.gz’

Packages.gz            0%[                     ]  40.74K  --.-KB/s    eta 6h 54m

Weird 🤔.

Magic ;-)

@MichaIng
Copy link
Owner

Right, Debian provides the archived versions of this file only, as this is what APT downloads by default anyway, the xz archive, if available, with highest priority.

The output btw is confusing, not showing that fact:

root@NanoPiR5S:/tmp# apt update
Get:1 https://deb.debian.org/debian bookworm InRelease [151 kB]
Get:2 https://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Get:3 https://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Get:4 https://deb.debian.org/debian bookworm-backports InRelease [59.0 kB]
Get:5 https://dietpi.com/apt bookworm InRelease [3529 B]
Get:6 https://dietpi.com/apt all InRelease [26.2 kB]
Get:7 https://deb.debian.org/debian bookworm/non-free-firmware arm64 Packages [5832 B]
Get:8 https://deb.debian.org/debian bookworm/non-free arm64 Packages [75.8 kB]
Get:9 https://deb.debian.org/debian bookworm/contrib arm64 Packages [45.7 kB]
Get:10 https://deb.debian.org/debian bookworm/main arm64 Packages [8689 kB]
Get:11 https://deb.debian.org/debian bookworm-updates/contrib arm64 Packages [768 B]
Get:12 https://deb.debian.org/debian bookworm-updates/non-free-firmware arm64 Packages [616 B]
Get:13 https://deb.debian.org/debian bookworm-updates/non-free arm64 Packages [12.0 kB]
Get:14 https://deb.debian.org/debian bookworm-updates/main arm64 Packages [2468 B]
Get:15 https://deb.debian.org/debian-security bookworm-security/main arm64 Packages [187 kB]
Get:16 https://deb.debian.org/debian bookworm-backports/non-free-firmware arm64 Packages [3852 B]
Get:17 https://deb.debian.org/debian bookworm-backports/contrib arm64 Packages [4964 B]
Get:18 https://deb.debian.org/debian bookworm-backports/non-free arm64 Packages [10.1 kB]
Get:19 https://deb.debian.org/debian bookworm-backports/main arm64 Packages [250 kB]
Get:20 https://dietpi.com/apt bookworm/main arm64 Packages [2172 B]
Get:21 https://dietpi.com/apt all/nanopir5s arm64 Packages [2288 B]
Get:22 https://dietpi.com/apt all/nanopir5s all Packages [528 B]
Fetched 9637 kB in 4s (2520 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
root@NanoPiR5S:/tmp#

Also from the file size 8689 kB (matching your log) you can see that it is in fact the xz archive: https://deb.debian.org/debian/dists/bookworm/main/binary-arm64/
The gz archive would be 11 MiB already, the plain text file 49 MiB.

That it hangs seems to be the issue, probably the same with the xz archive. Just weird that this happens with different mirrors, while downloading a package from the same mirror works fine. Can you try a really different one from here? https://www.debian.org/mirror/list

@klankschap
Copy link
Author

klankschap commented Oct 29, 2024

Can you try a really different one from here? https://www.debian.org/mirror/list

i tried different mirrors without success.
then i connected the neopi to a different switch in the local network.
then there is a difference.
it will download the package lists and start an APT update, but it fails with an error.

 DietPi-Update
─────────────────────────────────────────────────────
 Phase: Upgrading APT packages

[ INFO ] DietPi-Update | APT update, please wait...
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
Hit:4 https://deb.debian.org/debian bookworm-backports InRelease
Hit:5 https://dietpi.com/apt bookworm InRelease
Hit:6 https://dietpi.com/apt all InRelease
Reading package lists...
[  OK  ] DietPi-Update | APT update
[ INFO ] DietPi-Update | APT upgrade, please wait...
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
The following packages will be upgraded:
  armbian-firmware linux-image-current-sunxi64
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
14 not fully installed or removed.
Need to get 123 MB of archives.
After this operation, 2234 kB of additional disk space will be used.
Get:1 https://dietpi.com/apt all/nanopineoplus2 all armbian-firmware all 24.11.0-trunk-dietpi1 [91.6 MB]
Get:2 https://dietpi.com/apt all/nanopineoplus2 arm64 linux-image-current-sunxi64 arm64 24.11.0-trunk-dietpi1 [31.3 MB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 123 MB in 15s (8208 kB/s)
(Reading database ... 16724 files and directories currently installed.)
Preparing to unpack .../armbian-firmware_24.11.0-trunk-dietpi1_all.deb ...
Unpacking armbian-firmware (24.11.0-trunk-dietpi1) over (24.8.0-trunk-dietpi2) ...
dpkg-deb (subprocess): decompressing archive '/var/cache/apt/archives/armbian-firmware_24.11.0-trunk-dietpi1_all.deb' (size=91604592) member 'data.tar': lzma error: compressed data is corrupt
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg: error processing archive /var/cache/apt/archives/armbian-firmware_24.11.0-trunk-dietpi1_all.deb (--unpack):
 cannot copy extracted data for './lib/firmware/ath12k/WCN7850/hw2.0/amss.bin' to '/lib/firmware/ath12k/WCN7850/hw2.0/amss.bin.dpkg-new': unexpected end of file or stream
Preparing to unpack .../linux-image-current-sunxi64_24.11.0-trunk-dietpi1_arm64.deb ...
Armbian 'linux-image-current-sunxi64' for '6.6.31-current-sunxi64': 'prerm' starting.
Armbian 'linux-image-current-sunxi64' for '6.6.31-current-sunxi64': 'prerm' finishing.
Armbian 'linux-image-current-sunxi64' for '6.6.44-current-sunxi64': 'preinst' starting.
Armbian 'linux-image-current-sunxi64' for '6.6.44-current-sunxi64': 'preinst' finishing.

Unpacking linux-image-current-sunxi64 (24.11.0-trunk-dietpi1) over (24.8.0-trunk-dietpi2) ...
dpkg-deb (subprocess): decompressing archive '/var/cache/apt/archives/linux-image-current-sunxi64_24.11.0-trunk-dietpi1_arm64.deb' (size=31346892) member 'data.tar': lzma error: compressed data is corrupt
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg: error processing archive /var/cache/apt/archives/linux-image-current-sunxi64_24.11.0-trunk-dietpi1_arm64.deb (--unpack):
 cannot copy extracted data for './lib/modules/6.6.44-current-sunxi64/kernel/drivers/media/common/cx2341x.ko' to '/lib/modules/6.6.44-current-sunxi64/kernel/drivers/media/common/cx2341x.ko.dpkg-new': unexpected end of file or stream
Armbian 'linux-image-current-sunxi64' for '6.6.44-current-sunxi64': 'postrm' starting.
Removing obsolete initramfs images
Armbian 'linux-image-current-sunxi64' for '6.6.44-current-sunxi64': 'postrm' finishing.
Armbian 'linux-image-current-sunxi64' for '6.6.31-current-sunxi64': 'postinst' starting.
Removing obsolete initramfs images
Armbian: update last-installed kernel symlink to 'Image'...
'/boot/Image' -> 'vmlinuz-6.6.31-current-sunxi64'
Armbian: Debian compat: linux-update-symlinks install 6.6.31-current-sunxi64 boot/vmlinuz-6.6.31-current-sunxi64
Armbian 'linux-image-current-sunxi64' for '6.6.31-current-sunxi64': 'postinst' finishing.
Errors were encountered while processing:
 /var/cache/apt/archives/armbian-firmware_24.11.0-trunk-dietpi1_all.deb
 /var/cache/apt/archives/linux-image-current-sunxi64_24.11.0-trunk-dietpi1_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
[FAILED] DietPi-Update | APT upgrade`

almost there ;-)

@klankschap
Copy link
Author

klankschap commented Oct 29, 2024

all execpt two packages did upgrade after an apt update command.

# apt upgrade
The following packages will be upgraded:
  armbian-firmware linux-image-current-sunxi64                                            2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
14 not fully installed or removed.                                                        Need to get 0 B/123 MB of archives.
After this operation, 2234 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 16724 files and directories currently installed.)
Preparing to unpack .../armbian-firmware_24.11.0-trunk-dietpi1_all.deb ...
Unpacking armbian-firmware (24.11.0-trunk-dietpi1) over (24.8.0-trunk-dietpi2) ...        dpkg-deb (subprocess): decompressing archive '/var/cache/apt/archives/armbian-firmware_24.11.0-trunk-dietpi1_all.deb' (size=91604592) member 'data.tar': lzma error: compressed data is corrupt
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg: error processing archive /var/cache/apt/archives/armbian-firmware_24.11.0-trunk-dietpi1_all.deb (--unpack):
 cannot copy extracted data for './lib/firmware/brcm/brcmfmac4356-sdio-nanopi-m4v2.bin' to '/lib/firmware/brcm/brcmfmac4356-sdio-nanopi-m4v2.bin.dpkg-new': unexpected end of file or stream                                              Preparing to unpack .../linux-image-current-sunxi64_24.11.0-trunk-dietpi1_arm64.deb ...
Armbian 'linux-image-current-sunxi64' for '6.6.31-current-sunxi64': 'prerm' starting.
Armbian 'linux-image-current-sunxi64' for '6.6.31-current-sunxi64': 'prerm' finishing.
Armbian 'linux-image-current-sunxi64' for '6.6.44-current-sunxi64': 'preinst' starting.   Armbian 'linux-image-current-sunxi64' for '6.6.44-current-sunxi64': 'preinst' finishing.
Unpacking linux-image-current-sunxi64 (24.11.0-trunk-dietpi1) over (24.8.0-trunk-dietpi2) ...
dpkg-deb (subprocess): decompressing archive '/var/cache/apt/archives/linux-image-current-sunxi64_24.11.0-trunk-dietpi1_arm64.deb' (size=31346892) member 'data.tar': lzma error: compressed data is corrupt
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg: error processing archive /var/cache/apt/archives/linux-image-current-sunxi64_24.11.0-trunk-dietpi1_arm64.deb (--unpack):
 cannot copy extracted data for './boot/vmlinuz-6.6.44-current-sunxi64' to '/boot/vmlinuz-6.6.44-current-sunxi64.dpkg-new': unexpected end of file or stream
Armbian 'linux-image-current-sunxi64' for '6.6.44-current-sunxi64': 'postrm' starting.
Removing obsolete initramfs images
Armbian 'linux-image-current-sunxi64' for '6.6.44-current-sunxi64': 'postrm' finishing.
Armbian 'linux-image-current-sunxi64' for '6.6.31-current-sunxi64': 'postinst' starting.
Removing obsolete initramfs images
Armbian: update last-installed kernel symlink to 'Image'...
'/boot/Image' -> 'vmlinuz-6.6.31-current-sunxi64'
Armbian: Debian compat: linux-update-symlinks install 6.6.31-current-sunxi64 boot/vmlinuz-6.6.31-current-sunxi64
Armbian 'linux-image-current-sunxi64' for '6.6.31-current-sunxi64': 'postinst' finishing.
Errors were encountered while processing:
 /var/cache/apt/archives/armbian-firmware_24.11.0-trunk-dietpi1_all.deb
 /var/cache/apt/archives/linux-image-current-sunxi64_24.11.0-trunk-dietpi1_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)


@klankschap
Copy link
Author

klankschap commented Oct 29, 2024 via email

@MichaIng
Copy link
Owner

Weirdly this looks now very different to this report here: #7261
However, you are using a different SBC with different kernel, and I just successfully tested the very same kernel and firmware upgrade (also some previous versions of both packages) on my Odroid N2+. So for now I would say coincidence.

But can you check for kernel errors?

dmesg -l 0,1,2,3

@klankschap
Copy link
Author

klankschap commented Oct 29, 2024 via email

@klankschap
Copy link
Author

klankschap commented Oct 29, 2024

starting with a fresh installer download, unmodified, it passes the initial setup, almost.

i remove the two packages that fail

/var/cache/apt/archives/armbian-firmware_24.11.0-trunk-dietpi1_all.deb
/var/cache/apt/archives/linux-image-current-sunxi64_24.11.0-trunk-dietpi1_arm64.deb

then relauch the upgrade

root@DietPi:~# rm /var/cache/apt/archives/armbian-firmware_24.11.0-trunk-dietpi1_all.deb

root@DietPi:~# apt-get -y --with-new-pkgs upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  armbian-firmware
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
15 not fully installed or removed.
Need to get 91.6 MB of archives.
After this operation, 820 kB of additional disk space will be used.
Get:1 https://dietpi.com/apt all/nanopineoplus2 all armbian-firmware all 24.11.0-trunk-dietpi1 [91.6 MB]
Fetched 91.6 MB in 7s (12.3 MB/s)                                                                       
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 16735 files and directories currently installed.)
Preparing to unpack .../armbian-firmware_24.11.0-trunk-dietpi1_all.deb ...
Unpacking armbian-firmware (24.11.0-trunk-dietpi1) over (24.8.0-trunk-dietpi2) ...
dpkg-deb: error: <decompress> subprocess was killed by signal (Segmentation fault)
dpkg: error processing archive /var/cache/apt/archives/armbian-firmware_24.11.0-trunk-dietpi1_all.deb (--unpack):
 cannot copy extracted data for './lib/firmware/ath12k/WCN7850/hw2.0/amss.bin' to '/lib/firmware/ath12k/WCN7850/hw2.0/amss.bin.dpkg-new': unexpected end of file or stream
Errors were encountered while processing:
 /var/cache/apt/archives/armbian-firmware_24.11.0-trunk-dietpi1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@DietPi:~# 
root@DietPi:~# 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
Hit:4 https://deb.debian.org/debian bookworm-backports InRelease
Hit:5 https://dietpi.com/apt bookworm InRelease
Hit:6 https://dietpi.com/apt all InRelease     
Reading package lists... Done                  
Building dependency tree... Done
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
root@DietPi:~# apt list --upgradable
Listing... Done
armbian-firmware/all 24.11.0-trunk-dietpi1 all [upgradable from: 24.8.0-trunk-dietpi2]
N: There are 3 additional versions. Please use the '-a' switch to see them.
root@DietPi:~# apt list --upgradable -a
Listing... Done
armbian-firmware/all 24.11.0-trunk-dietpi1 all [upgradable from: 24.8.0-trunk-dietpi2]
armbian-firmware/all,now 24.8.0-trunk-dietpi2 all [installed,upgradable to: 24.11.0-trunk-dietpi1]
armbian-firmware/all 24.8.0-trunk-dietpi1 all
armbian-firmware/all 24.5.0-trunk all
 Linux version 6.6.31-current-sunxi64 (armbian@next) (aarch64-linux-gnu-gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #1 SMP Fri May 17 10:02:40 UTC 2024

magic for sure...

@MichaIng
Copy link
Owner

Is it the same for you when you try to manually download and install that package:

cd /tmp
wget https://dietpi.com/apt/dists/all/nanopineoplus2/binary-all/armbian-firmware_24.11.0-trunk-dietpi1.deb
sha256sum armbian-firmware_24.11.0-trunk-dietpi1.deb
dpkg -i armbian-firmware_24.11.0-trunk-dietpi1.deb

The sha256sum should return 5ef8c82df7222b2a792f5f366f2d2dfda7b047c868b101a60334da4f8fd00531.

@klankschap
Copy link
Author

klankschap commented Oct 29, 2024

5ef8c82df7222b2a792f5f366f2d2dfda7b047c868b101a60334da4f8fd00531 armbian-firmware_24.11.0-trunk-dietpi1.deb

/tmp# dpkg -i armbian-firmware_24.11.0-trunk-dietpi1.deb
(Reading database ... 16735 files and directories currently installed.)
Preparing to unpack armbian-firmware_24.11.0-trunk-dietpi1.deb ...
Unpacking armbian-firmware (24.11.0-trunk-dietpi1) over (24.8.0-trunk-dietpi2) ...
dpkg-deb (subprocess): decompressing archive 'armbian-firmware_24.11.0-trunk-dietpi1.deb' (size=91604592) member 'data.tar': lzma error: compressed data is corrupt
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg: error processing archive armbian-firmware_24.11.0-trunk-dietpi1.deb (--install):
 cannot copy extracted data for './lib/firmware/qcom/sm8550/ayn/odin2/adsp.mbn' to '/lib/firmware/qcom/sm8550/ayn/odin2/adsp.mbn.dpkg-new': unexpected end of file or stream
Errors were encountered while processing:
 armbian-firmware_24.11.0-trunk-dietpi1.deb

@klankschap
Copy link
Author

what is the difference between
eg updating dietpi1 over dietpi22 ?

(24.11.0-trunk-dietpi1) over (24.8.0-trunk-dietpi2)

@MichaIng
Copy link
Owner

MichaIng commented Oct 31, 2024

So it is definitely something wrong with the dpkg extractor, and I guess it is the same with the other issue I linked above.

what is the difference between
eg updating dietpi1 over dietpi22 ?

(24.11.0-trunk-dietpi1) over (24.8.0-trunk-dietpi2)

24.11.0 is the Armbian build system version. We append an on suffix for every rebuild, usually implying a newer kernel version or updated firmware like in this case.

@MichaIng
Copy link
Owner

Tested it on the Orange Pi Zero 3, which uses the same kernel, and the initial update from our image works well. If you have a spare SD card, could you check whether a current fresh DietPi image does the initial update fine for you?

And anther thing, does reinstalling other packages work, like dpkg itself?

apt install --reinstall dpkg

@klankschap
Copy link
Author

klankschap commented Oct 31, 2024 via email

@MichaIng
Copy link
Owner

And does reinstalling a larger package work?

apt install --reinstall armbian-firmware

@klankschap
Copy link
Author

klankschap commented Oct 31, 2024 via email

@MichaIng
Copy link
Owner

MichaIng commented Nov 2, 2024

Still no kernel errors?

dmesg -l 0,1,2,3

Does the same work on SD card?

And can you try it with a smaller recent package from our APT server:

cd /tmp
wget https://dietpi.com/apt/dists/all/orangepizero3/binary-arm64/sprd-bluetooth_0.0.1_arm64.deb
dpkg -i sprd-bluetooth_0.0.1_arm64.deb

Just maybe there is some issue with the way those packages are packed on the Ubuntu runner here on GitHub, an issue which shows up only in some rare circumstances, for whatever reason.
Remove the package again afterwards:

dpkg -P sprd-bluetooth

@klankschap
Copy link
Author

klankschap commented Nov 3, 2024 via email

@MichaIng
Copy link
Owner

MichaIng commented Nov 3, 2024

Okay, then I suspect the large size of the linux image and firmware packages to be related to the issue. Do larger packages from Debian fail as well?

apt install openjdk-17-jre-headless

There seem to be an issue with the USB device, but should not be related to installing a package on the eMMC. But to rule it out, if you detach (in case unmount) that USB device, does it make a difference?

The issue originally appeared when booting from SD card, and now also when booting from eMMC, so that does not seem to make a difference, right?

@klankschap
Copy link
Author

klankschap commented Nov 3, 2024 via email

@MichaIng
Copy link
Owner

Sorry for the late reply. So installing large packages in general is not/does not trigger the issue.

not sure wha5t you mean.

What I mean is that the kernel reports errors from a USB device or host. So if you have any USB devices attached to that SBC, it might be worth it to try unplugging it, and rerun the update attempt.

The initial issue was likely related to the switch in the LAN causing
timeouts in the downloading. I don't know if in the mean time the
content of the online images have changed.

At present the unit is working as intended

Ah right, so the "unexpected end of stream" error appeared on the eMMC booted system. The update does still not work, failing on the same armbian-firmware package, right?

The other issue with same error on an Odroid C4 has been btw solved by an older PCB revision of that board. The newer revision seems to have some issues, though no idea how these can result in these particular errors for only these particular package upgrades.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants