henrygd/beszel · warning
temperature collection timed out
Error message
temperature collection timed out
What it means
errTemperatureFetchTimeout is a package-level sentinel error representing a timeout of the context used to collect sensor temperatures. updateTemperatures and getTempsWithTimeout return it when the sensors read does not complete before the configured deadline. It also relates to the panic-recovery wrapper for gopsutil sensors quirks (gopsutil#1832).
Source
Thrown at agent/sensors.go:22
"context"
"errors"
"fmt"
"log/slog"
"path"
"runtime"
"strconv"
"strings"
"time"
"unicode/utf8"
"github.com/henrygd/beszel/agent/utils"
"github.com/henrygd/beszel/internal/entities/system"
"github.com/shirou/gopsutil/v4/common"
"github.com/shirou/gopsutil/v4/sensors"
)
var errTemperatureFetchTimeout = errors.New("temperature collection timed out")
// Matches sensors.TemperaturesWithContext to allow for panic recovery (gopsutil/issues/1832)
type getTempsFn func(ctx context.Context) ([]sensors.TemperatureStat, error)
type SensorConfig struct {
context context.Context
sensors map[string]struct{}
primarySensor string
timeout time.Duration
isBlacklist bool
hasWildcards bool
skipCollection bool
firstRun bool
}
func (a *Agent) newSensorConfig() *SensorConfig {
primarySensor, _ := utils.GetEnv("PRIMARY_SENSOR")
sysSensors, _ := utils.GetEnv("SYS_SENSORS")View on GitHub (pinned to b38fb7dafa)
Solutions
- Increase the sensor collection timeout in SensorConfig if the host is merely slow rather than hung.
- Update gopsutil to v4 latest to benefit from the panic-recovery wrapper and sensor fixes.
- Verify sensor availability on the host (e.g. run `sensors` or list /sys/class/hwmon); treat absence as expected on VMs/containers.
- Ignore/handle the sentinel error gracefully — temperature data is optional and the agent continues without it.
Defensive patterns
Strategy: fallback
Validate before calling
if _, err := os.Stat("/sys/class/hwmon"); os.IsNotExist(err) {
log.Info("no hwmon sensors on this host; temperature collection will be skipped")
} Try / catch
temps, err := agent.GetTemps(ctx)
if errors.Is(err, agent.ErrTemperatureFetchTimeout) {
log.Warn("temperature collection timed out; continuing without sensor data")
temps = nil
} Prevention
- Size the sensor timeout to the slowest monitored host (VMs are slower).
- Keep gopsutil v4 current to avoid the sensors hang/panic bug (issue 1832).
- Treat temperature metrics as optional in dashboards and alerts.
- Skip sensor polling on hosts known to lack hwmon (containers, many VMs).
When it happens
Trigger: Calling updateTemperatures (or getTempsWithTimeout) when sensors.TemperaturesWithContext does not return before the context deadline expires — typically a hanging hwmon/sensors read on the host.
Common situations: Virtual machines or containers without usable sensor hardware; kernels where reading certain hwmon files blocks; overloaded hosts making the sensors syscall slow; gopsutil version with the sensors panic/hang bug (issue 1832).
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- panic: %v
- no sensors found (try running as admin with LHM=true)
- timeout creating session
- failed to create temp directory: %w
- timeout
AI-assisted analysis of henrygd/beszel@b38fb7dafa (2026-08-31).
Data as JSON: /api/errors/48e160fd993574b5.
Report an issue: GitHub.