From a275bf59efa819f3ce67d81b3d2de94917309239 Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Fri, 23 Oct 2026 10:20:54 +0200 Subject: [PATCH] Skip the resource check when the container cannot read its RAM With a broken lxcfs mount on the host, free fails with 'Unable to create meminfo structure' and the check stopped the whole update (ProxmoxVE #18045). It now warns and lets the update run. --- ui/menu.func | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/menu.func b/ui/menu.func index 3bb32e4..36116ca 100644 --- a/ui/menu.func +++ b/ui/menu.func @@ -432,8 +432,13 @@ settings_menu() { # - Warns if under-provisioned and asks user to continue or abort # ------------------------------------------------------------------------------ check_container_resources() { - current_ram=$(free -m | awk 'NR==2{print $2}') - current_cpu=$(nproc) + current_ram=$(free -m 2>/dev/null | awk 'NR==2{print $2}' || true) + current_cpu=$(nproc 2>/dev/null || true) + # A broken lxcfs mount on the host leaves /proc/meminfo unreadable; that is no reason to stop the update + if [[ ! "$current_ram" =~ ^[0-9]+$ || ! "$current_cpu" =~ ^[0-9]+$ ]]; then + msg_warn "Could not read this container's RAM or CPU count, skipping the resource check" + return 0 + fi if [[ "$current_ram" -lt "$var_ram" ]] || [[ "$current_cpu" -lt "$var_cpu" ]]; then echo -e "\n${INFO}${HOLD} ${GN}Required: ${var_cpu} CPU, ${var_ram}MB RAM ${CL}| ${RD}Current: ${current_cpu} CPU, ${current_ram}MB RAM${CL}"