MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.9k stars 499 forks source link

Corrupted System Caused by Update Failure (dietpi-update): Run now to update DietPi from v9.6.1 to v9.7.1 #7220

Open SystemTheory opened 2 months ago

SystemTheory commented 2 months ago

Problem

After running dietpi-update as root the update failed as shown in the output below. I could not login via ssh or run commands as root. After powering off the system it rebooted as DietPi v9.6.1 again and I could login via ssh again.

Terminal Output Update Failure

DietPi v9.6.1 : Update available
 ─────────────────────────────────────────────────────
 - Device model : RPi 4 Model B (aarch64)
 - CPU temp : 45 °C / 113 °F : Optimal temperature
 - LAN IP : 192.168.1.6 (wlan0)
 - MOTD : DietPi v9.7 is here. Check out all changes:
          https://dietpi.com/docs/releases/v9_7/
 ─────────────────────────────────────────────────────

 DietPi Team     : https://github.com/MichaIng/DietPi#the-dietpi-project-team
 Patreon Legends : Chris Gelatt, ADSB.im
 Website         : https://dietpi.com/ | https://twitter.com/DietPi_
 Contribute      : https://dietpi.com/contribute.html
 Web Hosting by  : https://myvirtualserver.com

 dietpi-update   : Run now to update DietPi from v9.6.1 to v9.7.1

 dietpi-launcher : All the DietPi programs in one place
 dietpi-config   : Feature rich configuration tool for your device
 dietpi-software : Select optimised software for installation
 htop            : Resource monitor
 cpu             : Shows CPU information and stats

root@dpi4 /root
# dietpi-update

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

[  OK  ] DietPi-Update | Checking IPv4 network connectivity
[  OK  ] DietPi-Update | Checking DNS resolver
[ INFO ] DietPi-Update | Getting latest version from: https://raw.githubusercontent.com/MichaIng/DietPi/master/.update/version
[  OK  ] DietPi-Update | Got valid latest version: 9.7.1
[  OK  ] DietPi-Update | Update available:
[ INFO ] DietPi-Update | Current version : v9.6.1
[ INFO ] DietPi-Update | Latest version  : v9.7.1

 DietPi-Update
─────────────────────────────────────────────────────
 Phase: Checking for update pre-requirements

[  OK  ] DietPi-Update | DietPi-Userdata validation: /mnt/dietpi_userdata
[  OK  ] DietPi-Update | Free space check: path=/ | available=907957 MiB | required=100 MiB
[ SUB1 ] DietPi-Services > stop
[  OK  ] DietPi-Services | stop : cron

 DietPi-Update
─────────────────────────────────────────────────────
 Phase: Applying pre-patches

[  OK  ] DietPi-Update | Downloading pre-patches
[  OK  ] DietPi-Update | Applying execute permission
[  OK  ] DietPi-Update | Successfully applied pre-patches

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

[ INFO ] DietPi-Update | APT update, please wait...
Get:1 https://deb.debian.org/debian bullseye InRelease [116 kB]
Hit:2 https://dietpi.com/apt bullseye InRelease
Get:3 https://dietpi.com/apt all InRelease [25.3 kB]
Get:4 https://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
Get:5 https://deb.debian.org/debian-security bullseye-security InRelease [27.2 kB]
Get:6 https://deb.debian.org/debian bullseye-backports InRelease [49.0 kB]
Get:7 https://archive.raspberrypi.com/debian bullseye InRelease [39.0 kB]
Get:8 https://deb.debian.org/debian bullseye/main arm64 Packages [7955 kB]
Get:9 https://archive.raspberrypi.com/debian bullseye/main arm64 Packages [318 kB]
Get:10 https://deb.debian.org/debian bullseye-backports/main arm64 Packages.diff/Index [63.3 kB]
Get:11 https://deb.debian.org/debian bullseye/non-free arm64 Packages [72.4 kB]
Get:12 https://deb.debian.org/debian-security bullseye-security/main arm64 Packages [282 kB]
Get:13 https://deb.debian.org/debian bullseye-backports/main arm64 Packages T-2024-08-26-1406.01-F-2024-08-26-1406.01.pdiff [2617 B]
Get:13 https://deb.debian.org/debian bullseye-backports/main arm64 Packages T-2024-08-26-1406.01-F-2024-08-26-1406.01.pdiff [2617 B]
Fetched 8994 kB in 7s (1331 kB/s)
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:
  base-files curl git git-man libc-bin libc-dev-bin libc-l10n libc6 libc6-dev
  libcurl3-gnutls libcurl4 libgnutls-dane0 libgnutls-openssl27 libgnutls28-dev
  libgnutls30 libgnutlsxx28 libsystemd0 libudev1 libxml2 libxml2-dev locales
  systemd systemd-sysv systemd-timesyncd udev
25 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 29.9 MB of archives.
After this operation, 387 kB of additional disk space will be used.
Get:1 https://deb.debian.org/debian bullseye/main arm64 base-files arm64 11.1+deb11u11 [70.2 kB]
Get:2 https://deb.debian.org/debian-security bullseye-security/main arm64 libsystemd0 arm64 247.3-7+deb11u6 [355 kB]
Get:3 https://deb.debian.org/debian-security bullseye-security/main arm64 systemd-timesyncd arm64 247.3-7+deb11u6 [130 kB]
Get:4 https://deb.debian.org/debian-security bullseye-security/main arm64 systemd arm64 247.3-7+deb11u6 [4155 kB]
Get:5 https://archive.raspberrypi.com/debian bullseye/main arm64 libc6-dev arm64 2.31-13+rpt2+rpi1+deb11u11 [2031 kB]
Get:6 https://archive.raspberrypi.com/debian bullseye/main arm64 libc-dev-bin arm64 2.31-13+rpt2+rpi1+deb11u11 [273 kB]
Get:7 https://archive.raspberrypi.com/debian bullseye/main arm64 libc6 arm64 2.31-13+rpt2+rpi1+deb11u11 [2462 kB]
Get:8 https://archive.raspberrypi.com/debian bullseye/main arm64 libc-bin arm64 2.31-13+rpt2+rpi1+deb11u11 [742 kB]
Get:9 https://archive.raspberrypi.com/debian bullseye/main arm64 libc-l10n all 2.31-13+rpt2+rpi1+deb11u11 [865 kB]
Get:10 https://deb.debian.org/debian-security bullseye-security/main arm64 udev arm64 247.3-7+deb11u6 [1424 kB]
Get:11 https://archive.raspberrypi.com/debian bullseye/main arm64 locales all 2.31-13+rpt2+rpi1+deb11u11 [4085 kB]
Err:12 https://deb.debian.org/debian-security bullseye-security/main arm64 libudev1 arm64 247.3-7+deb11u6
  Could not open file /var/cache/apt/archives/partial/libudev1_247.3-7+deb11u6_arm64.deb - open (30: Read-only file system) [IP: 151.101.118.132 443]
Err:13 https://deb.debian.org/debian-security bullseye-security/main arm64 systemd-sysv arm64 247.3-7+deb11u6
  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
Err:14 https://deb.debian.org/debian-security bullseye-security/main arm64 libgnutls28-dev arm64 3.7.1-5+deb11u6
  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
Err:15 https://deb.debian.org/debian-security bullseye-security/main arm64 libgnutls-dane0 arm64 3.7.1-5+deb11u6
  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
Err:16 https://deb.debian.org/debian-security bullseye-security/main arm64 libgnutls-openssl27 arm64 3.7.1-5+deb11u6
  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
Err:17 https://deb.debian.org/debian-security bullseye-security/main arm64 libgnutlsxx28 arm64 3.7.1-5+deb11u6
  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
Err:18 https://deb.debian.org/debian-security bullseye-security/main arm64 libgnutls30 arm64 3.7.1-5+deb11u6
  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
Err:19 https://deb.debian.org/debian bullseye/main arm64 curl arm64 7.74.0-1.3+deb11u13
  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
Err:20 https://deb.debian.org/debian bullseye/main arm64 libcurl4 arm64 7.74.0-1.3+deb11u13
  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
Err:21 https://deb.debian.org/debian-security bullseye-security/main arm64 git-man all 1:2.30.2-1+deb11u3
  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
Err:22 https://deb.debian.org/debian bullseye/main arm64 libcurl3-gnutls arm64 7.74.0-1.3+deb11u13
  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
Err:23 https://deb.debian.org/debian-security bullseye-security/main arm64 git arm64 1:2.30.2-1+deb11u3
  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
Err:24 https://deb.debian.org/debian-security bullseye-security/main arm64 libxml2-dev arm64 2.9.10+dfsg-6.7+deb11u5
  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
Err:25 https://deb.debian.org/debian-security bullseye-security/main arm64 libxml2 arm64 2.9.10+dfsg-6.7+deb11u5
  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
Fetched 16.6 MB in 5s (3646 kB/s)
W: chmod 0644 of file /var/cache/apt/archives/partial/locales_2.31-13+rpt2+rpi1+deb11u11_all.deb failed - 201::URIDone (30: Read-only file system)
W: chmod 0644 of file /var/cache/apt/archives/partial/udev_247.3-7+deb11u6_arm64.deb failed - 201::URIDone (30: Read-only file system)
W: Problem unlinking the file /var/cache/apt/archives/partial/libudev1_247.3-7+deb11u6_arm64.deb - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/cache/apt/archives/partial/systemd-sysv_247.3-7+deb11u6_arm64.deb - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/cache/apt/archives/partial/libgnutls28-dev_3.7.1-5+deb11u6_arm64.deb - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/cache/apt/archives/partial/libgnutls-dane0_3.7.1-5+deb11u6_arm64.deb - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/cache/apt/archives/partial/libgnutls-openssl27_3.7.1-5+deb11u6_arm64.deb - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/cache/apt/archives/partial/libgnutlsxx28_3.7.1-5+deb11u6_arm64.deb - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/cache/apt/archives/partial/libgnutls30_3.7.1-5+deb11u6_arm64.deb - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/cache/apt/archives/partial/curl_7.74.0-1.3+deb11u13_arm64.deb - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/cache/apt/archives/partial/libcurl4_7.74.0-1.3+deb11u13_arm64.deb - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/cache/apt/archives/partial/git-man_1%3a2.30.2-1+deb11u3_all.deb - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/cache/apt/archives/partial/libcurl3-gnutls_7.74.0-1.3+deb11u13_arm64.deb - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/cache/apt/archives/partial/git_1%3a2.30.2-1+deb11u3_arm64.deb - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/cache/apt/archives/partial/libxml2-dev_2.9.10+dfsg-6.7+deb11u5_arm64.deb - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/cache/apt/archives/partial/libxml2_2.9.10+dfsg-6.7+deb11u5_arm64.deb - PrepareFiles (30: Read-only file system)
E: Failed to fetch https://deb.debian.org/debian-security/pool/updates/main/s/systemd/udev_247.3-7%2bdeb11u6_arm64.deb  rename failed, Read-only file system (/var/cache/apt/archives/partial/udev_247.3-7+deb11u6_arm64.deb -> /var/cache/apt/archives/udev_247.3-7+deb11u6_arm64.deb).
E: Failed to fetch https://deb.debian.org/debian-security/pool/updates/main/s/systemd/libudev1_247.3-7%2bdeb11u6_arm64.deb  Could not open file /var/cache/apt/archives/partial/libudev1_247.3-7+deb11u6_arm64.deb - open (30: Read-only file system) [IP: 151.101.118.132 443]
E: Failed to fetch https://deb.debian.org/debian-security/pool/updates/main/s/systemd/systemd-sysv_247.3-7%2bdeb11u6_arm64.deb  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
E: Failed to fetch https://deb.debian.org/debian-security/pool/updates/main/g/gnutls28/libgnutls28-dev_3.7.1-5%2bdeb11u6_arm64.deb  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
E: Failed to fetch https://deb.debian.org/debian-security/pool/updates/main/g/gnutls28/libgnutls-dane0_3.7.1-5%2bdeb11u6_arm64.deb  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
E: Failed to fetch https://deb.debian.org/debian-security/pool/updates/main/g/gnutls28/libgnutls-openssl27_3.7.1-5%2bdeb11u6_arm64.deb  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
E: Failed to fetch https://deb.debian.org/debian-security/pool/updates/main/g/gnutls28/libgnutlsxx28_3.7.1-5%2bdeb11u6_arm64.deb  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
E: Failed to fetch https://deb.debian.org/debian-security/pool/updates/main/g/gnutls28/libgnutls30_3.7.1-5%2bdeb11u6_arm64.deb  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
E: Failed to fetch https://archive.raspberrypi.com/debian/pool/main/g/glibc/locales_2.31-13%2brpt2%2brpi1%2bdeb11u11_all.deb  rename failed, Read-only file system (/var/cache/apt/archives/partial/locales_2.31-13+rpt2+rpi1+deb11u11_all.deb -> /var/cache/apt/archives/locales_2.31-13+rpt2+rpi1+deb11u11_all.deb).
E: Failed to fetch https://deb.debian.org/debian/pool/main/c/curl/curl_7.74.0-1.3%2bdeb11u13_arm64.deb  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
E: Failed to fetch https://deb.debian.org/debian/pool/main/c/curl/libcurl4_7.74.0-1.3%2bdeb11u13_arm64.deb  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
E: Failed to fetch https://deb.debian.org/debian-security/pool/updates/main/g/git/git-man_2.30.2-1%2bdeb11u3_all.deb  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
E: Failed to fetch https://deb.debian.org/debian/pool/main/c/curl/libcurl3-gnutls_7.74.0-1.3%2bdeb11u13_arm64.deb  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
E: Failed to fetch https://deb.debian.org/debian-security/pool/updates/main/g/git/git_2.30.2-1%2bdeb11u3_arm64.deb  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
E: Failed to fetch https://deb.debian.org/debian-security/pool/updates/main/libx/libxml2/libxml2-dev_2.9.10%2bdfsg-6.7%2bdeb11u5_arm64.deb  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
E: Failed to fetch https://deb.debian.org/debian-security/pool/updates/main/libx/libxml2/libxml2_2.9.10%2bdfsg-6.7%2bdeb11u5_arm64.deb  Could not resolve 'deb.debian.org' [IP: 151.101.118.132 443]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
[FAILED] DietPi-Update | APT upgrade
 - Command: apt-get -y --with-new-pkgs upgrade
/boot/dietpi/func/dietpi-globals: line 963: mawk: command not found
/boot/dietpi/func/dietpi-globals: line 1326: mawk: command not found
/boot/dietpi/func/dietpi-globals: line 1326: ip: command not found
/boot/dietpi/func/dietpi-globals: line 1327: ip: command not found
/boot/dietpi/func/dietpi-globals: line 1327: mawk: command not found
/boot/dietpi/func/dietpi-globals: line 1287: ip: command not found
/boot/dietpi/func/dietpi-globals: line 470: tput: command not found
/boot/dietpi/func/dietpi-globals: line 471: tput: command not found
/boot/dietpi/func/dietpi-globals: line 473: ((: <= 120 : syntax error: operand expected (error token is "<= 120 ")
/boot/dietpi/func/dietpi-globals: line 479: ((: >= 7 : syntax error: operand expected (error token is ">= 7 ")
/boot/dietpi/func/dietpi-globals: line 775: /usr/bin/rm: Input/output error
/boot/dietpi/func/dietpi-globals: line 1052: /usr/bin/rm: Input/output error
[FAILED] DietPi-Update | Unable to continue, DietPi-Update will now terminate.
/boot/dietpi/func/dietpi-globals: line 148: /usr/bin/rm: Input/output error
[FAILED] DietPi-Update | Failed to remove scripts working directory: /tmp/DietPi-Update
root@dpi4 /root
# cd opt
-bash: cd: opt: Input/output error

root@dpi4 /root
# tree -L 1
-bash: tree: command not found

root@dpi4 /root
# uptime
-bash: uptime: command not found

root@dpi4 /root
# ls
-bash: ls: command not found
Joulinar commented 2 months ago

Are you using an SD card by any chance? If so, it could be that the card is slowly giving up. We can try to see if the following helps to repair defective blocks.

> /forcefsck
reboot
# then after reboot
journalctl -t systemd-fsck
SystemTheory commented 2 months ago

I am using an external SSD as boot and data drive.

Joulinar commented 2 months ago

How is it powered? It is known that the RPi4 is not able to power HDD/SSD correctly when using the RPI usb ports to power the drive. Therefore, we strongly recommend using an external power supply for such drives.

SystemTheory commented 2 months ago

Thank you. I will consider options for disk power supply. The SSD is powered from USB port. The system has been stable for a couple of years while running 24/7. There was one update problem some time ago and the uptime gets disrupted at times but I think that is due to brown-out conditions in the local power grid.

MichaIng commented 1 month ago

Is this still an issue, or did a dedicates PSU for the SSD help?