From 34406828b9cdf41ca113d4c61f0748e808a39730 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 17:06:18 -0300 Subject: [PATCH 1/2] Pass through actual error instead of generic "plugin bug" message When a plugin dies during request processing, xcatd wrapped the error in a misleading "plugin bug" message that hid the real cause (e.g. "No space left on device"). Now passes through the actual error from the eval, making the output useful for any failure, not just disk full. Fixes #2719 --- xCAT-server/sbin/xcatd | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 5d8b6b6bc..e10faa926 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -2086,14 +2086,15 @@ sub plugin_command { $@ = ""; # sometimes a child 'eval' doesn't clean up $@, if we make it this far, no non-eval bug bombed out }; # REMOVEEVALFORDEBUG if ($sock or $shouldbealivepid != $$) { # We shouldn't still be alive, try to send as much detail to parent as possible as to why - my $error = "$modname plugin bug, pid $$, process description: '$$progname'"; + my $error; if ($@) { - $error .= " with error '$@'"; - } else { # Sys::Virt and perhaps Net::SNMP sometimes crashes in a way $@ won't catch.. - $error .= " with missing eval error, probably due to special manipulation of $@ or strange circumstances in an XS library, remove evals in xcatd marked 'REMOVEEVALFORDEBUG and run xcatd -f for more info"; + chomp(my $eval_err = $@); + $error = "$modname: $eval_err"; + } else { + $error = "$modname: unexpected error (pid $$, $$progname)"; } - if (scalar(@nodes)) { # Don't know which of the nodes, so one error message warning about the possibliity.. - $error .= " while trying to fulfill request for the following nodes: " . join(",", @nodes); + if (scalar(@nodes)) { + $error .= " [nodes: " . join(",", @nodes) . "]"; } xCAT::MsgUtils->message("S", "xcatd: $error"); $callback->({ error => [$error], errorcode => [1] }); From b10865c5d4167d2efaaa3ecd4af34428f756f266 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 17:09:54 -0300 Subject: [PATCH 2/2] Keep plugin bug label for XS crashes without $@ The else branch handles a rare case where XS libraries (Sys::Virt, Net::SNMP) crash without setting $@. This IS a plugin bug, so keep that label and the debug hint. Only the common case (die with $@) gets the clean passthrough. --- xCAT-server/sbin/xcatd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index e10faa926..0d995fcf1 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -2091,7 +2091,8 @@ sub plugin_command { chomp(my $eval_err = $@); $error = "$modname: $eval_err"; } else { - $error = "$modname: unexpected error (pid $$, $$progname)"; + # XS libraries (Sys::Virt, Net::SNMP) can crash without setting $@ + $error = "$modname plugin bug (pid $$): died without setting an error. Run xcatd -f to debug"; } if (scalar(@nodes)) { $error .= " [nodes: " . join(",", @nodes) . "]";