Compare commits

..
Author SHA1 Message Date
MickLesk 7e6b9ebb71 update-apps: say what tar or zstd said when a backup fails
A failed backup showed vzdump's 600 character tar command and not the
line above it. 14 of 21 such runs last week were a full backup storage
(zstd error 70); the message now carries that line and the free space.
2026-11-26 14:20:05 +01:00
2 changed files with 22 additions and 14 deletions

No files matched your search

+9 -12
View File
@@ -124,18 +124,15 @@ msg_ok "Built SQLite Extensions"
if [[ "$(arch_resolve)" == "amd64" ]]; then
msg_info "Building Intel Media Driver (Patience)"
if download_gpg_key "https://repositories.intel.com/gpu/intel-graphics.key" "/usr/share/keyrings/intel-graphics.gpg" "dearmor"; then
sed -i '/intel-graphics.key/d' /opt/frigate/docker/main/build_intel_media_driver.sh
$STD bash /opt/frigate/docker/main/build_intel_media_driver.sh
cp -a /rootfs/. /
rm -rf /rootfs
rm -f /etc/apt/sources.list.d/intel-gpu-jammy.list /usr/share/keyrings/intel-graphics.gpg
apt_update_safe
ldconfig
msg_ok "Built Intel Media Driver"
else
msg_warn "Intel's package repository cannot be reached from this network; Frigate is installed without the Intel media driver"
fi
download_gpg_key "https://repositories.intel.com/gpu/intel-graphics.key" "/usr/share/keyrings/intel-graphics.gpg" "dearmor"
sed -i '/intel-graphics.key/d' /opt/frigate/docker/main/build_intel_media_driver.sh
$STD bash /opt/frigate/docker/main/build_intel_media_driver.sh
cp -a /rootfs/. /
rm -rf /rootfs
rm -f /etc/apt/sources.list.d/intel-gpu-jammy.list /usr/share/keyrings/intel-graphics.gpg
apt_update_safe
ldconfig
msg_ok "Built Intel Media Driver"
fi
fetch_and_deploy_gh_release "go2rtc" "AlexxIT/go2rtc" "singlefile" "v1.9.14" "/usr/local/go2rtc/bin" "go2rtc_linux_$(arch_resolve)"
+13 -2
View File
@@ -273,10 +273,15 @@ function dry_run_container() {
# The line of vzdump or pct restore output that says why it failed.
function failure_reason() {
local reason
local reason tool q="'"
reason=$(grep -m1 '^ERROR:' <<<"$1" | sed 's/^ERROR: //')
# A rejected option ends in the usage line, the option's error is above it.
[[ -n "$reason" ]] || reason=$(grep -v -e '^[[:space:]]*$' -e '\[OPTIONS\]$' <<<"$1" | tail -n1)
# vzdump quotes its whole tar pipeline there; what tar or zstd said is above it.
if [[ "$reason" == *" failed - command '"* ]]; then
tool=$(sed '/^ERROR:/q' <<<"$1" | grep -E '^INFO: (tar|zstd|gzip|lzop|rsync|proxmox-backup-client|lxc-usernsexec|Error)[: ]' | tail -n1 | sed 's/^INFO: //; s/[[:space:]]*$//')
reason="${reason%% - command ${q}*} (${reason##*failed: })${tool:+: $tool}"
fi
printf '%s' "$reason"
}
@@ -292,7 +297,13 @@ function backup_container() {
msg_error "Backup of container $1 was interrupted (Ctrl+C or the task was stopped)"
exit 130
fi
msg_error "Backup failed for container $1: $(failure_reason "$output")"
local reason
reason=$(failure_reason "$output")
# zstd writes the archive itself, so its "No space left" is the backup storage.
if [[ "$reason" == *"zstd:"*"No space left on device"* ]]; then
reason+=" - storage '$STORAGE_CHOICE' has $(pvesm status --storage "$STORAGE_CHOICE" 2>/dev/null | awk 'NR==2 {printf "%.1f", $6 / 1048576}') GiB free"
fi
msg_error "Backup failed for container $1: $reason"
exit 235
fi
}