From d74bbb9bd9d6e1771b25b4906faaf921933af744 Mon Sep 17 00:00:00 2001 From: RelaxJonh <92573950+RelaxJonh@users.noreply.github.com> Date: Mon, 24 Aug 2026 08:14:52 +0700 Subject: [PATCH] fix(cli): treat empty fleet probe as incomplete when gateways were restarted (#93406) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit collect_fleet_versions() swallows every probe exception via logger.debug() and returns whatever accumulated — which can be an empty list. print_fleet_version_matrix([]) returns False (no rows to report), so the update exits 0 with "success" even though no gateway was actually verified. After the restart phase touches live gateways (restarted_services or killed_pids is truthy), an empty fleet snapshot means verification failed, not that everything is healthy. Treat it as incomplete so the receipt records "partial" and the exit code is 1. Fixes #93406 --- hermes_cli/update_cmd.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hermes_cli/update_cmd.py b/hermes_cli/update_cmd.py index 600b934d29..9e890681f6 100644 --- a/hermes_cli/update_cmd.py +++ b/hermes_cli/update_cmd.py @@ -8317,6 +8317,19 @@ def _cmd_update_impl(args, gateway_mode: bool): ) if print_fleet_version_matrix(_fleet_snapshot): gateway_fleet_restart_incomplete = True + elif not _fleet_snapshot and (restarted_services or killed_pids): + # Fleet probe returned zero rows even though the restart + # phase touched live gateways. Every failure path inside + # collect_fleet_versions() is swallowed via logger.debug(), + # so an empty list is indistinguishable from a healthy fleet + # in the current output. Treat it as verification failure + # so the receipt records "partial" and the exit code is 1 + # (#93406). + print( + "\n⚠ Fleet version check returned no rows even though" + " gateways were restarted — verification incomplete." + ) + gateway_fleet_restart_incomplete = True except Exception as _fleet_exc: logger.debug("Fleet version verification failed: %s", _fleet_exc)