From 728270dc8e1866087b5efe00195c3c1408fe5160 Mon Sep 17 00:00:00 2001 From: Mikhail Chusavitin Date: Sat, 4 Apr 2026 15:18:43 +0300 Subject: [PATCH] Unblock bee-web startup and expand support bundle diagnostics --- audit/internal/app/app_test.go | 20 +++++ audit/internal/app/support_bundle.go | 79 +++++++++++++++++++ .../etc/systemd/system/bee-audit.service | 1 - .../etc/systemd/system/bee-web.service | 1 - 4 files changed, 99 insertions(+), 2 deletions(-) diff --git a/audit/internal/app/app_test.go b/audit/internal/app/app_test.go index cfd1260..9fa9bc3 100644 --- a/audit/internal/app/app_test.go +++ b/audit/internal/app/app_test.go @@ -754,6 +754,26 @@ func TestBuildSupportBundleIncludesExportDirContents(t *testing.T) { } } + for _, want := range []string{ + "/system/ip-link.txt", + "/system/ip-link-stats.txt", + "/system/ethtool-info.txt", + "/system/ethtool-link.txt", + "/system/ethtool-module.txt", + "/system/mstflint-query.txt", + } { + var found bool + for _, name := range names { + if contains(name, want) { + found = true + break + } + } + if !found { + t.Fatalf("support bundle missing %s, names=%v", want, names) + } + } + var foundRaw bool for _, name := range names { if contains(name, "/export/bee-sat/memory-run/verbose.log") { diff --git a/audit/internal/app/support_bundle.go b/audit/internal/app/support_bundle.go index f5564fd..57d7d36 100644 --- a/audit/internal/app/support_bundle.go +++ b/audit/internal/app/support_bundle.go @@ -32,6 +32,8 @@ var supportBundleCommands = []struct { {name: "system/lspci-nn.txt", cmd: []string{"lspci", "-nn"}}, {name: "system/lspci-vvv.txt", cmd: []string{"lspci", "-vvv"}}, {name: "system/ip-addr.txt", cmd: []string{"ip", "addr"}}, + {name: "system/ip-link.txt", cmd: []string{"ip", "-details", "link", "show"}}, + {name: "system/ip-link-stats.txt", cmd: []string{"ip", "-s", "link", "show"}}, {name: "system/ip-route.txt", cmd: []string{"ip", "route"}}, {name: "system/mount.txt", cmd: []string{"mount"}}, {name: "system/df-h.txt", cmd: []string{"df", "-h"}}, @@ -47,6 +49,83 @@ for d in /sys/bus/pci/devices/*/; do printf " %-22s %s\n" "$f" "$(cat "$d/$f" 2>/dev/null)" done done +`}}, + {name: "system/ethtool-info.txt", cmd: []string{"sh", "-c", ` +if ! command -v ethtool >/dev/null 2>&1; then + echo "ethtool not found" + exit 0 +fi +found=0 +for path in /sys/class/net/*; do + [ -e "$path" ] || continue + iface=$(basename "$path") + [ "$iface" = "lo" ] && continue + found=1 + echo "=== $iface ===" + ethtool -i "$iface" 2>&1 || true + echo +done +if [ "$found" -eq 0 ]; then + echo "no interfaces found" +fi +`}}, + {name: "system/ethtool-link.txt", cmd: []string{"sh", "-c", ` +if ! command -v ethtool >/dev/null 2>&1; then + echo "ethtool not found" + exit 0 +fi +found=0 +for path in /sys/class/net/*; do + [ -e "$path" ] || continue + iface=$(basename "$path") + [ "$iface" = "lo" ] && continue + found=1 + echo "=== $iface ===" + ethtool "$iface" 2>&1 || true + echo +done +if [ "$found" -eq 0 ]; then + echo "no interfaces found" +fi +`}}, + {name: "system/ethtool-module.txt", cmd: []string{"sh", "-c", ` +if ! command -v ethtool >/dev/null 2>&1; then + echo "ethtool not found" + exit 0 +fi +found=0 +for path in /sys/class/net/*; do + [ -e "$path" ] || continue + iface=$(basename "$path") + [ "$iface" = "lo" ] && continue + found=1 + echo "=== $iface ===" + ethtool -m "$iface" 2>&1 || true + echo +done +if [ "$found" -eq 0 ]; then + echo "no interfaces found" +fi +`}}, + {name: "system/mstflint-query.txt", cmd: []string{"sh", "-c", ` +if ! command -v mstflint >/dev/null 2>&1; then + echo "mstflint not found" + exit 0 +fi +found=0 +for path in /sys/bus/pci/devices/*; do + [ -e "$path/vendor" ] || continue + vendor=$(cat "$path/vendor" 2>/dev/null) + [ "$vendor" = "0x15b3" ] || continue + bdf=$(basename "$path") + found=1 + echo "=== $bdf ===" + mstflint -d "$bdf" q 2>&1 || true + echo +done +if [ "$found" -eq 0 ]; then + echo "no Mellanox/NVIDIA networking devices found" +fi `}}, } diff --git a/iso/overlay/etc/systemd/system/bee-audit.service b/iso/overlay/etc/systemd/system/bee-audit.service index 7bf8e5e..ec19395 100644 --- a/iso/overlay/etc/systemd/system/bee-audit.service +++ b/iso/overlay/etc/systemd/system/bee-audit.service @@ -1,7 +1,6 @@ [Unit] Description=Bee: hardware audit After=bee-preflight.service bee-network.service bee-nvidia.service -Before=bee-web.service [Service] Type=oneshot diff --git a/iso/overlay/etc/systemd/system/bee-web.service b/iso/overlay/etc/systemd/system/bee-web.service index 6c0bf1a..f07595d 100644 --- a/iso/overlay/etc/systemd/system/bee-web.service +++ b/iso/overlay/etc/systemd/system/bee-web.service @@ -1,6 +1,5 @@ [Unit] Description=Bee: hardware audit web viewer -After=bee-audit.service [Service] Type=simple