diff --git a/bible-local/06-parsers.md b/bible-local/06-parsers.md index 40513f6..0f4c587 100644 --- a/bible-local/06-parsers.md +++ b/bible-local/06-parsers.md @@ -59,7 +59,7 @@ serial from its socket, model, board serial, or another component; reject source | Vendor ID | Input family | Notes | |-----------|--------------|-------| | `dell` | TSR ZIP archives | Broad hardware, firmware, sensors, lifecycle events | -| `easy_bee` | `bee-support-*.tar.gz` | Imports the embedded hardware snapshot and static DIMM/storage/NVIDIA evidence used to build `topology.json` | +| `easy_bee` | `bee-support-*.tar.gz` | Imports the embedded hardware snapshot and static DIMM/storage/NVIDIA evidence used to build `topology.json`; without `bee-audit.json` (audit unfinished at capture) falls back to the bundled `nvidia-bug-report.txt` (ADL-076) | | `h3c_g5` | H3C SDS G5 bundles | INI/XML/CSV-driven hardware and event parsing | | `h3c_g6` | H3C SDS G6 bundles | Similar flow with G6-specific files | | `hpe_ilo_ahs` | HPE iLO Active Health System (`.ahs`) | Proprietary `ABJR` container with gzip-compressed `zbb` members; parser combines SMBIOS-style inventory strings and embedded Redfish storage JSON | diff --git a/bible-local/10-decisions.md b/bible-local/10-decisions.md index 2efa183..c818229 100644 --- a/bible-local/10-decisions.md +++ b/bible-local/10-decisions.md @@ -2208,3 +2208,28 @@ inventory paths. HGX path grammar alone must not activate the Supermicro vendor exact product suffix. - Offline replay remains deterministic and resolves vendor identity from `Systems/Self`; the walker changes acquisition breadth without removing normalized inventory inputs. + +--- + +## ADL-076 — Easy-bee bundle without bee-audit.json falls back to the bundled NVIDIA bug report + +**Date:** 2026-09-30 +**Context:** Ten BEE-SP v14.08 bundles from Dell PowerEdge R7715 failed with +"easy-bee snapshot not found". The inspected one (3VVFYL4) was captured while `bee-audit.service` +was still `activating`: the audit had finished PSU collection and was blocked in `ipmitool sensor`, so +`bee-audit.json` was never written. The bundle still contains `export/gpu/nvidia-bug-report.txt` +with dmidecode, lspci and nvidia-smi output for the whole host. + +**Decision:** When no snapshot is present, `easy_bee` parses the bundled `nvidia-bug-report*` +with the `nvidia_bug_report` parser and overlays bundle context: manifest host, manifest +`generated_at_utc` only if the report has no date, topology evidence, chassis part number and +board FRU. It adds one Warning event `Incomplete Audit` with no timestamp (ADL-070) stating the +`bee-audit.service` state from `tasks/_services/bee-audit.service.status.txt`. Without a bug +report the parse still fails, but the error names the audit service state instead of the generic +message. + +**Consequences:** +- Such bundles import board identity, CPU, populated DIMMs, GPU and Mellanox NICs; storage, PSU, + sensors and firmware are absent because they exist only in the audit snapshot. +- The root cause is on the collection side: bee-support should wait for `bee-audit.service` + (or mark the bundle as incomplete), and the R7715 `ipmitool sensor` stall needs a timeout. diff --git a/internal/parser/vendors/easy_bee/fallback.go b/internal/parser/vendors/easy_bee/fallback.go new file mode 100644 index 0000000..f5fd97c --- /dev/null +++ b/internal/parser/vendors/easy_bee/fallback.go @@ -0,0 +1,98 @@ +package easy_bee + +import ( + "fmt" + "strings" + + "git.mchus.pro/mchus/logpile/internal/models" + "git.mchus.pro/mchus/logpile/internal/parser" + "git.mchus.pro/mchus/logpile/internal/parser/vendors/nvidia_bug_report" +) + +// parseWithoutSnapshot handles bundles captured before bee-audit finished +// writing bee-audit.json. The NVIDIA bug report bundled under export/gpu/ +// carries dmidecode, lspci and nvidia-smi output for the whole host, so it +// is used to rebuild a reduced inventory instead of failing the import. +func parseWithoutSnapshot(files []parser.ExtractedFile, manifest manifestMetadata) (*models.AnalysisResult, error) { + auditState := beeAuditServiceState(files) + + report := findNvidiaBugReport(files) + if report == nil { + return nil, fmt.Errorf("easy-bee snapshot not found: %s", describeMissingSnapshot(auditState)) + } + + result, err := (&nvidia_bug_report.Parser{}).Parse([]parser.ExtractedFile{*report}) + if err != nil { + return nil, fmt.Errorf("easy-bee snapshot not found, fallback to %s failed: %w", report.Path, err) + } + if result.Hardware == nil || (result.Hardware.BoardInfo.SerialNumber == "" && + len(result.Hardware.CPUs) == 0 && + len(result.Hardware.Memory) == 0 && + len(result.Hardware.GPUs) == 0) { + return nil, fmt.Errorf("easy-bee snapshot not found: %s; %s has no inventory", describeMissingSnapshot(auditState), report.Path) + } + + result.TargetHost = firstNonEmpty(result.TargetHost, manifest.Host) + if result.CollectedAt.IsZero() && !manifest.GeneratedAtUTC.IsZero() { + result.CollectedAt = manifest.GeneratedAtUTC.UTC() + } + result.TopologyEvidence = collectTopologyEvidence(files) + + if pn := chassisProductPartNumber(files, result.Hardware.BoardInfo.ProductName); pn != "" { + result.Hardware.BoardInfo.PartNumber = pn + } + if len(result.FRU) == 0 { + if boardFRU, ok := buildBoardFRU(result.Hardware.BoardInfo); ok { + result.FRU = append(result.FRU, boardFRU) + } + } + + result.Events = append(result.Events, models.Event{ + Source: "Bee Audit", + EventType: "Incomplete Audit", + Severity: models.SeverityWarning, + Description: fmt.Sprintf("%s; inventory reconstructed from %s (storage, PSU and sensors unavailable)", describeMissingSnapshot(auditState), pathBase(report.Path)), + }) + + return result, nil +} + +func findNvidiaBugReport(files []parser.ExtractedFile) *parser.ExtractedFile { + for i := range files { + name := strings.ToLower(pathBase(files[i].Path)) + if strings.HasPrefix(name, "nvidia-bug-report") && + (strings.HasSuffix(name, ".txt") || strings.HasSuffix(name, ".log")) && + len(files[i].Content) > 0 { + return &files[i] + } + } + return nil +} + +// beeAuditServiceState returns the systemd "Active:" line of bee-audit.service +// captured in the bundle, e.g. "activating (start) since ... ; 2min 22s ago". +func beeAuditServiceState(files []parser.ExtractedFile) string { + for _, f := range files { + if !strings.EqualFold(pathBase(f.Path), "bee-audit.service.status.txt") { + continue + } + for _, line := range strings.Split(string(f.Content), "\n") { + line = strings.TrimSpace(line) + if state, ok := strings.CutPrefix(line, "Active:"); ok { + return strings.TrimSpace(state) + } + } + } + return "" +} + +func describeMissingSnapshot(auditState string) string { + switch { + case auditState == "": + return "bee-audit.json is missing from the bundle" + case strings.HasPrefix(auditState, "activating"): + return "bee-audit.json is missing: bee-audit.service had not finished when the bundle was captured (" + auditState + ")" + default: + return "bee-audit.json is missing (bee-audit.service: " + auditState + ")" + } +} diff --git a/internal/parser/vendors/easy_bee/fallback_test.go b/internal/parser/vendors/easy_bee/fallback_test.go new file mode 100644 index 0000000..4d6c0ec --- /dev/null +++ b/internal/parser/vendors/easy_bee/fallback_test.go @@ -0,0 +1,110 @@ +package easy_bee + +import ( + "strings" + "testing" + + "git.mchus.pro/mchus/logpile/internal/models" + "git.mchus.pro/mchus/logpile/internal/parser" +) + +const incompleteAuditPrefix = "bee-support-stage-easy-bee-nvidia-v14-08-20260917-211720" + +func incompleteAuditFiles(withReport bool) []parser.ExtractedFile { + files := []parser.ExtractedFile{ + { + Path: incompleteAuditPrefix + "/manifest.txt", + Content: []byte("bee_version=14.08\nhost=easy-bee-nvidia-v14-08\ngenerated_at_utc=2026-09-17T21:17:37Z\nexport_dir=/appdata/bee/export\n"), + }, + { + Path: incompleteAuditPrefix + "/status/runtime-health.json", + Content: []byte(`{"status":"OK"}`), + }, + { + Path: incompleteAuditPrefix + "/tasks/_services/bee-audit.service.status.txt", + Content: []byte("● bee-audit.service - Bee: hardware audit\n" + + " Loaded: loaded (/etc/systemd/system/bee-audit.service; enabled; preset: enabled)\n" + + " Active: activating (start) since Thu 2026-09-17 21:14:58 UTC; 2min 22s ago\n"), + }, + } + if withReport { + files = append(files, parser.ExtractedFile{ + Path: incompleteAuditPrefix + "/export/gpu/nvidia-bug-report.txt", + Content: []byte(`NVIDIA bug report log file +nvidia-bug-report.sh Version: 1 +Date: Thu Sep 17 21:17:21 UTC 2026 +System Information + Manufacturer: Dell Inc. + Product Name: PowerEdge R7715 + Serial Number: 3VVFYL4 + +Processor Information + Version: AMD EPYC 9255 24-Core Processor + Core Count: 24 + Thread Count: 48 + Status: Populated, Enabled + +Memory Device + Size: 32 GB + Locator: A1 + Type: DDR5 + Manufacturer: Samsung + Serial Number: 01C12D98 + Part Number: M321R4GA3EB2-CCPKF +`), + }) + } + return files +} + +// Bundles captured while bee-audit.service was still running have no +// bee-audit.json; inventory is rebuilt from the bundled NVIDIA bug report. +func TestParseFallsBackToNvidiaBugReportWhenAuditIncomplete(t *testing.T) { + p := &Parser{} + files := incompleteAuditFiles(true) + if got := p.Detect(files); got < 50 { + t.Fatalf("expected easy-bee detection without snapshot, got %d", got) + } + + result, err := p.Parse(files) + if err != nil { + t.Fatalf("parse: %v", err) + } + if result.Hardware.BoardInfo.SerialNumber != "3VVFYL4" || result.Hardware.BoardInfo.ProductName != "PowerEdge R7715" { + t.Fatalf("unexpected board: %+v", result.Hardware.BoardInfo) + } + if len(result.Hardware.CPUs) != 1 || len(result.Hardware.Memory) != 1 { + t.Fatalf("expected 1 CPU and 1 DIMM, got %d/%d", len(result.Hardware.CPUs), len(result.Hardware.Memory)) + } + if result.TargetHost != "easy-bee-nvidia-v14-08" { + t.Fatalf("unexpected target host %q", result.TargetHost) + } + if got := result.CollectedAt.Format("2006-01-02T15:04:05Z"); got != "2026-09-17T21:17:21Z" { + t.Fatalf("unexpected collected_at %s", got) + } + + var notice *models.Event + for i := range result.Events { + if result.Events[i].EventType == "Incomplete Audit" { + notice = &result.Events[i] + } + } + if notice == nil { + t.Fatalf("expected incomplete audit event, got %+v", result.Events) + } + if !notice.Timestamp.IsZero() || notice.Severity != models.SeverityWarning || + !strings.Contains(notice.Description, "had not finished") { + t.Fatalf("unexpected incomplete audit event: %+v", notice) + } +} + +func TestParseWithoutSnapshotOrFallbackExplainsAuditState(t *testing.T) { + _, err := (&Parser{}).Parse(incompleteAuditFiles(false)) + if err == nil { + t.Fatal("expected error") + } + if msg := err.Error(); !strings.Contains(msg, "bee-audit.service had not finished") || + !strings.Contains(msg, "activating (start)") { + t.Fatalf("unexpected error: %v", err) + } +} diff --git a/internal/parser/vendors/easy_bee/parser.go b/internal/parser/vendors/easy_bee/parser.go index 953edc7..6c02e6b 100644 --- a/internal/parser/vendors/easy_bee/parser.go +++ b/internal/parser/vendors/easy_bee/parser.go @@ -11,7 +11,7 @@ import ( "git.mchus.pro/mchus/logpile/internal/parser" ) -const parserVersion = "1.1" +const parserVersion = "1.2" func init() { parser.Register(&Parser{}) @@ -90,7 +90,7 @@ func (p *Parser) Detect(files []parser.ExtractedFile) int { func (p *Parser) Parse(files []parser.ExtractedFile) (*models.AnalysisResult, error) { snapshotFile := findSnapshotFile(files) if snapshotFile == nil { - return nil, fmt.Errorf("easy-bee snapshot not found") + return parseWithoutSnapshot(files, parseManifest(files)) } var snapshot beeSnapshot