{"record":{"id":"ccc3049febf31cc8","repo":"slimtoolkit/slim","slug":"composite-monitor-failed-w","errorCode":null,"errorMessage":"composite monitor failed: %w","messagePattern":"composite monitor failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/app/sensor/controlled/controlled.go","lineNumber":245,"sourceCode":"\n\treturn s.processMonitoringResults(mon)\n}\n\nfunc (s *Sensor) processMonitoringResults(mon monitor.CompositeMonitor) error {\n\t// A bit of code duplication to avoid starting a goroutine\n\t// for error event handling - keeping the control flow\n\t// \"single-threaded\" keeps reasoning about the logic.\n\tfor _, err := range mon.DrainErrors() {\n\t\tlog.WithError(err).Warn(\"sensor: non-critical monitor error condition (drained)\")\n\t\ts.exe.PubEvent(event.Error, monitor.NonCriticalError(err).Error())\n\t}\n\n\tlog.Info(\"sensor: composite monitor is done, checking status...\")\n\n\treport, err := mon.Status()\n\tif err != nil {\n\t\tlog.WithError(err).Error(\"sensor: composite monitor failed\")\n\t\treturn fmt.Errorf(\"composite monitor failed: %w\", err)\n\t}\n\n\tif err := s.artifactor.Process(\n\t\tmon.StartCommand(),\n\t\ts.mountPoint,\n\t\treport.PeReport,\n\t\treport.FanReport,\n\t\treport.PtReport,\n\t); err != nil {\n\t\tlog.WithError(err).Error(\"sensor: artifact.Process() failed\")\n\t\treturn fmt.Errorf(\"saving reports failed: %w\", err)\n\t}\n\treturn nil // Clean exit\n}\n","sourceCodeStart":227,"sourceCodeEnd":260,"githubUrl":"https://github.com/slimtoolkit/slim/blob/81940d17fa112cc678e32209214bcb2355cb3004/pkg/app/sensor/controlled/controlled.go#L227-L260","documentation":"After the monitor completes, processMonitoringResults calls mon.Status() to collect the composite monitor report. If Status() returns an error, it is logged and wrapped with this message. This means the monitor could not produce a valid status/report.","triggerScenarios":"processMonitoringResults (called from runWithMonitor) invokes mon.Status() and the composite monitor reports failure — e.g. one of its sub-monitors errored or its internal state is invalid.","commonSituations":"Sub-monitor (PE/fan/Pt) crash mid-run, monitor timeout, corrupted monitor state after resource exhaustion.","solutions":["Inspect the wrapped error and individual sub-monitor states for the root cause","Check monitor logs for which sub-monitor failed","Ensure the monitor was started correctly and had sufficient resources (memory, file descriptors)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := sensor.Run(ctx)\nif err != nil && strings.Contains(err.Error(), \"composite monitor failed\") {\n\t// inspect sub-monitor states / logs before retry\n}","preventionTips":["Monitor sub-monitor health during runs","Ensure adequate memory/fd limits for monitors","Capture monitor logs to correlate with Status() failure"],"tags":["go","sensor","monitor","reporting"],"backgroundTag":"monitor-status-failed","analyzedSha":"81940d17fa112cc678e32209214bcb2355cb3004","analyzedAt":"2026-08-31T23:06:12.682Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}