Compare commits

...

13 Commits

Author SHA1 Message Date
Michel Roegl-Brunner f6900c5c0c Enhance upgrade prompt with warning message
Added a warning message to inform users about the implications of running the host upgrade.
2026-04-23 20:41:38 +02:00
CanbiZ (MickLesk) 2e97eb8aae fix(lxc-stack): use host upgrade instead of dist-upgrade in recovery flow 2026-04-23 17:00:07 +02:00
CanbiZ (MickLesk) f51b3ae221 Update build.func 2026-04-23 16:54:36 +02:00
CanbiZ (MickLesk) 2fcbc6b754 chore(lxc-stack-prompt): clarify host dist-upgrade action in option 1 2026-04-23 15:58:39 +02:00
CanbiZ (MickLesk) b49b3f31d7 fix(lxc-stack): use dist-upgrade and improve recovery prompt
When the host LXC stack is too old for a template, upgrading only
pve-container/lxc-pve can leave the Proxmox stack in an inconsistent state.
Use a full dist-upgrade instead.

Also refine the recovery prompt:
- [1] Upgrade LXC stack now
- [2] Older template fallback only when actually available
- [3] Ignore
- [4] Cancel

Do not auto-fallback to an older template after ignore/failure; honor the
user's explicit choice and stop with a clear error instead.
2026-04-23 15:56:26 +02:00
community-scripts-pr-app[bot] 01bbacec22 Update CHANGELOG.md (#13965)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-04-23 13:31:16 +00:00
community-scripts-pr-app[bot] 116253df1a Update CHANGELOG.md (#13964)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-04-23 13:30:51 +00:00
CanbiZ (MickLesk) 8706cd3783 Revert "core: Add PHS_VERBOSE env var to skip verbose mode prompts (#13797)" (#13963)
This reverts commit 518b6778e2.
2026-04-23 15:30:38 +02:00
CanbiZ (MickLesk) 874d8f300c Revert "Prefer silent mode on PHS env conflict (#13951)" (#13962)
This reverts commit a37b36520c.
2026-04-23 15:30:19 +02:00
community-scripts-pr-app[bot] aa54abcf50 Update CHANGELOG.md (#13953)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-04-23 07:34:09 +00:00
CanbiZ (MickLesk) a37b36520c Prefer silent mode on PHS env conflict (#13951)
When PHS_SILENT and PHS_VERBOSE are both set, stop falling back to interactive mode. Changes prefer silent mode to keep automation safe and avoid blocking unattended/non-TTY updates. Only show a whiptail warning when both stdin/stdout are TTYs and whiptail is present, and ignore any whiptail errors. Added a brief comment and adjusted the fallback message accordingly.
2026-04-23 09:33:40 +02:00
community-scripts-pr-app[bot] 22d9eece6f Update CHANGELOG.md (#13941)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-04-22 12:48:13 +00:00
John Gorman 518b6778e2 core: Add PHS_VERBOSE env var to skip verbose mode prompts (#13797) 2026-04-22 14:47:44 +02:00
2 changed files with 128 additions and 38 deletions
+17
View File
@@ -445,6 +445,17 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
</details> </details>
## 2026-04-23
### 💾 Core
- Revert "core: Add PHS_VERBOSE env var to skip verbose mode prompts" [@MickLesk](https://github.com/MickLesk) ([#13963](https://github.com/community-scripts/ProxmoxVE/pull/13963))
- Revert "core: hotfix - prefer silent mode on PHS env conflict" [@MickLesk](https://github.com/MickLesk) ([#13962](https://github.com/community-scripts/ProxmoxVE/pull/13962))
- #### 🐞 Bug Fixes
- core: hotfix - prefer silent mode on PHS env conflict [@MickLesk](https://github.com/MickLesk) ([#13951](https://github.com/community-scripts/ProxmoxVE/pull/13951))
## 2026-04-22 ## 2026-04-22
### 🆕 New Scripts ### 🆕 New Scripts
@@ -460,6 +471,12 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
- add --clear to uv venv in update_script() to prevent interactive prompt [@MickLesk](https://github.com/MickLesk) ([#13926](https://github.com/community-scripts/ProxmoxVE/pull/13926)) - add --clear to uv venv in update_script() to prevent interactive prompt [@MickLesk](https://github.com/MickLesk) ([#13926](https://github.com/community-scripts/ProxmoxVE/pull/13926))
### 💾 Core
- #### ✨ New Features
- core: Add PHS_VERBOSE env var to skip verbose mode prompts [@gormanity](https://github.com/gormanity) ([#13797](https://github.com/community-scripts/ProxmoxVE/pull/13797))
## 2026-04-21 ## 2026-04-21
### 🆕 New Scripts ### 🆕 New Scripts
+102 -29
View File
@@ -5376,13 +5376,59 @@ create_lxc_container() {
# Offer upgrade for pve-container/lxc-pve if candidate > installed; optional auto-retry pct create # Offer upgrade for pve-container/lxc-pve if candidate > installed; optional auto-retry pct create
# Returns: # Returns:
# 0 = no upgrade needed / container created after upgrade or fallback # 0 = no upgrade needed / container created after upgrade or explicit fallback
# 1 = upgraded (and if do_retry=yes and retry succeeded, creation done) # 1 = upgraded (and if do_retry=yes and retry succeeded, creation done)
# 2 = user declined # 2 = user chose ignore
# 3 = upgrade attempted but failed OR retry failed # 3 = upgrade attempted but failed OR retry failed
# 4 = user cancelled
offer_lxc_stack_upgrade_and_maybe_retry() { offer_lxc_stack_upgrade_and_maybe_retry() {
local do_retry="${1:-no}" # yes|no local do_retry="${1:-no}" # yes|no
local _pvec_i _pvec_c _lxcp_i _lxcp_c need=0 local _pvec_i _pvec_c _lxcp_i _lxcp_c need=0
local _ans
has_previous_os_version_template() {
local os_type="${PCT_OSTYPE:-}"
local current_ver="${PCT_OSVERSION:-}"
local tpl_pattern="${TEMPLATE_PATTERN:-${TEMPLATE:-}}"
local -a all_versions=()
[[ -n "$os_type" && -n "$current_ver" ]] || return 1
mapfile -t _local_vers < <(
pveam list "$TEMPLATE_STORAGE" 2>/dev/null |
awk '{print $1}' |
sed 's|.*/||' |
grep -E "^${os_type}-[0-9]" |
{ [[ -n "$tpl_pattern" ]] && grep "$tpl_pattern" || cat; } |
sed -E "s/^${os_type}-([0-9]+(\.[0-9]+)?).*/\1/" |
sort -u -V
)
all_versions+=("${_local_vers[@]}")
if command -v timeout &>/dev/null; then
timeout 30 pveam update >/dev/null 2>&1 || true
else
pveam update >/dev/null 2>&1 || true
fi
mapfile -t _online_vers < <(
pveam available -section system 2>/dev/null |
awk '{print $2}' |
grep -E "^${os_type}-[0-9]" |
{ [[ -n "$tpl_pattern" ]] && grep "$tpl_pattern" || cat; } |
sed -E "s/^${os_type}-([0-9]+(\.[0-9]+)?).*/\1/" |
sort -u -V 2>/dev/null || true
)
all_versions+=("${_online_vers[@]}")
printf '%s\n' "${all_versions[@]}" | sort -u -V | awk -v cur="$current_ver" '
{
split($0, a, ".")
split(cur, b, ".")
if (a[1]+0 < b[1]+0) found=1
}
END { exit found ? 0 : 1 }
'
}
_pvec_i="$(pkg_ver pve-container)" _pvec_i="$(pkg_ver pve-container)"
_lxcp_i="$(pkg_ver lxc-pve)" _lxcp_i="$(pkg_ver lxc-pve)"
@@ -5403,19 +5449,25 @@ create_lxc_container() {
msg_warn "An update for the Proxmox LXC stack is available" msg_warn "An update for the Proxmox LXC stack is available"
echo " pve-container: installed=${_pvec_i:-n/a} candidate=${_pvec_c:-n/a}" echo " pve-container: installed=${_pvec_i:-n/a} candidate=${_pvec_c:-n/a}"
echo " lxc-pve : installed=${_lxcp_i:-n/a} candidate=${_lxcp_c:-n/a}" echo " lxc-pve : installed=${_lxcp_i:-n/a} candidate=${_lxcp_c:-n/a}"
echo " note : option 1 runs host apt update + apt upgrade"
echo echo
# Offer older OS version fallback when template version might be too new for LXC stack # Offer older OS version fallback when template version might be too new for LXC stack
local _has_fallback_option=false local _has_fallback_option=false
if [[ -n "${PCT_OSTYPE:-}" && -n "${PCT_OSVERSION:-}" ]]; then if [[ "$do_retry" == "yes" ]] && has_previous_os_version_template; then
_has_fallback_option=true _has_fallback_option=true
echo " [1] Upgrade LXC stack now (recommended)" echo " [1] Run host upgrade now (recommended). WARNING: this runs apt upgrade and updates all Packeages on your host!"
echo " [2] Use an older ${PCT_OSTYPE} template instead (may not work with all scripts)" echo " [2] Use an older ${PCT_OSTYPE} template instead (may not work with all scripts)"
echo " [3] Ignore"
echo " [4] Cancel"
echo
read -rp "Select option [1/2/3/4]: " _ans </dev/tty
else
echo " [1] Run host upgrade now (recommended). WARNING: this runs apt upgrade and updates all Packeages on your host!"
echo " [2] Ignore"
echo " [3] Cancel" echo " [3] Cancel"
echo echo
read -rp "Select option [1/2/3]: " _ans </dev/tty read -rp "Select option [1/2/3]: " _ans </dev/tty
else
read -rp "Do you want to upgrade now? [y/N] " _ans </dev/tty
fi fi
if [[ "$_has_fallback_option" == true ]]; then if [[ "$_has_fallback_option" == true ]]; then
@@ -5424,35 +5476,48 @@ create_lxc_container() {
_ans="y" _ans="y"
;; ;;
2) 2)
if [[ "$do_retry" == "yes" ]]; then
if fallback_to_previous_os_version; then if fallback_to_previous_os_version; then
return 0 return 0
else else
return 3 return 3
fi fi
else ;;
msg_custom "️" "${YW}" "OS version fallback is only available during container creation." 3)
return 2 return 2
fi ;;
4)
return 4
;; ;;
*) *)
return 4
;;
esac
else
case "$_ans" in
1)
_ans="y"
;;
2)
return 2 return 2
;; ;;
*)
return 4
;;
esac esac
fi fi
case "${_ans,,}" in case "${_ans,,}" in
y | yes) y | yes)
msg_info "Upgrading Proxmox LXC stack (pve-container, lxc-pve)" msg_info "Running host upgrade for LXC stack compatibility"
apt_update_safe apt_update_safe
if $STD apt-get install -y --only-upgrade pve-container lxc-pve; then if $STD apt-get upgrade -y; then
msg_ok "LXC stack upgraded." msg_ok "LXC stack upgraded."
# Verify pct binary still works after upgrade (partial upgrades can break Perl modules) # Verify pct binary still works after upgrade (partial upgrades can break Perl modules)
if ! pct list &>/dev/null; then if ! pct list &>/dev/null; then
msg_error "LXC stack upgrade caused PVE tool breakage (likely Perl module incompatibility)." msg_error "LXC stack upgrade caused PVE tool breakage (likely Perl module incompatibility)."
msg_custom "⚠️" "${YW}" "A partial package upgrade has left the PVE stack in an inconsistent state." msg_custom "⚠️" "${YW}" "A partial package upgrade has left the PVE stack in an inconsistent state."
msg_custom "🔧" "${YW}" "Please run the following on the Proxmox host, then retry:" msg_custom "🔧" "${YW}" "Please run the following on the Proxmox host, then retry:"
echo -e "${TAB} apt update && apt dist-upgrade -y" echo -e "${TAB} apt update && apt upgrade -y"
echo -e "${TAB} reboot" echo -e "${TAB} reboot"
return 3 return 3
fi fi
@@ -6061,16 +6126,20 @@ create_lxc_container() {
rc=$? rc=$?
case $rc in case $rc in
0) : ;; # success - container created, continue 0) : ;; # success - container created, continue
2 | 3) 2)
# Upgrade declined or failed — try older OS version as last resort msg_error "LXC stack upgrade ignored. Please inspect: $LOGFILE"
msg_warn "Attempting older ${PCT_OSTYPE:-} version as last resort" _flush_pct_log
if fallback_to_previous_os_version; then exit 231
: # success ;;
else 3)
msg_error "All recovery options exhausted. Please inspect: $LOGFILE" msg_error "LXC stack upgrade failed. Please inspect: $LOGFILE"
_flush_pct_log
exit 231
;;
4)
msg_error "Cancelled by user."
_flush_pct_log _flush_pct_log
exit 231 exit 231
fi
;; ;;
esac esac
else else
@@ -6094,16 +6163,20 @@ create_lxc_container() {
rc=$? rc=$?
case $rc in case $rc in
0) : ;; # success - container created, continue 0) : ;; # success - container created, continue
2 | 3) 2)
# Upgrade declined or failed — try older OS version as last resort msg_error "LXC stack upgrade ignored. Please inspect: $LOGFILE"
msg_warn "Attempting older ${PCT_OSTYPE:-} version as last resort" _flush_pct_log
if fallback_to_previous_os_version; then exit 231
: # success ;;
else 3)
msg_error "All recovery options exhausted. Please inspect: $LOGFILE" msg_error "LXC stack upgrade failed. Please inspect: $LOGFILE"
_flush_pct_log
exit 231
;;
4)
msg_error "Cancelled by user."
_flush_pct_log _flush_pct_log
exit 231 exit 231
fi
;; ;;
esac esac
else else