diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index 2c8908d0..0f2009d7 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh @@ -1405,11 +1405,16 @@ PYEOF fi # --- Atomic VERSION promotion (Fix B) --- -# The staged VERSION from Phase 3 lands only now, after full verification. -# On any prior failure, on_failure removes VERSION.pending and the live -# VERSION file remains at the pre-upgrade value — so upgrade-check.sh -# correctly reports "upgrade available" on the next check. -if [[ "$VERIFY_FAILED" != "true" ]] && [[ -f "$UPGRADE_DIR/VERSION.pending" ]]; then +# The staged VERSION from Phase 3 lands now that we've reached the end of +# Phase 7 without on_failure firing. Promote regardless of VERIFY_FAILED — +# that flag is a soft health-check warning (e.g. "admin slow to respond"), +# not an upgrade failure. The tarball is extracted, containers are up, and +# write_result below will record success=true. Gating promotion on +# VERIFY_FAILED previously caused a "stuck at old VERSION" bug where a +# transient admin healthcheck warning pinned the install back. +# Hard failures (SIGTERM, exit !=0) still prevent promotion via on_failure, +# which rm -f's VERSION.pending before it can be promoted. +if [[ -f "$UPGRADE_DIR/VERSION.pending" ]]; then mv "$UPGRADE_DIR/VERSION.pending" "$PROJECT_DIR/VERSION" success "VERSION promoted to $(head -1 "$PROJECT_DIR/VERSION" 2>/dev/null || echo "?")" fi