From d455b82b1a88fe916a8f5147d3d48d28b56b3c44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Sat, 2 May 2026 21:39:04 -0300 Subject: [PATCH] fix: silent failure with no site master attribute (#7537) * Fix silent failure when site.master is not set (#6157) Hardware control commands (rpower, rinv, etc.) silently return no output and exit 0 when site.master is empty. The original fix (#6074) was reverted (#6158) because it warned per-node with the wrong hostname. Check once in plugin_command before dispatching to plugins, so the error appears exactly once with the correct command name. * Also reject empty site.master, not only undef --- xCAT-server/sbin/xcatd | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 0d995fcf1..72a72eb08 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -1885,6 +1885,18 @@ sub plugin_command { } } } + my $sitemaster = xCAT::TableUtils->get_site_attribute('master'); + if ($req->{node} and not($sitemaster)) { + my $rsp = { error => ["site.master is not set, unable to dispatch '$req->{command}->[0]'"], errorcode => [1] }; + $rsp->{serverdone} = [undef]; + if ($sock) { + send_response($rsp, $sock); + } else { + $callback->($rsp); + } + return; + } + my %xcatresponses = (xcatresponse => []); $plugin_numchildren = 0; %plugin_children = ();