glanceapp/glance · warning
invalid first day of week
Error message
invalid first day of week
What it means
The System widget config lets you pin the CPU temperature to a specific sensor key (cpu-temp-sensor in widget options). Glance enumerates sensors via gopsutil's SensorsTemperatures() and matches each reading's SensorKey against the configured name; if nothing matches, it records 'CPU temperature sensor %s not found' and leaves TemperatureIsAvailable false.
Source
Thrown at internal/glance/widget-calendar.go:34
"thursday": time.Thursday,
"friday": time.Friday,
"saturday": time.Saturday,
}
type calendarWidget struct {
widgetBase `yaml:",inline"`
FirstDayOfWeek string `yaml:"first-day-of-week"`
FirstDay int `yaml:"-"`
cachedHTML template.HTML `yaml:"-"`
}
func (widget *calendarWidget) initialize() error {
widget.withTitle("Calendar").withError(nil)
if widget.FirstDayOfWeek == "" {
widget.FirstDayOfWeek = "monday"
} else if _, ok := calendarWeekdaysToInt[widget.FirstDayOfWeek]; !ok {
return errors.New("invalid first day of week")
}
widget.FirstDay = int(calendarWeekdaysToInt[widget.FirstDayOfWeek])
widget.cachedHTML = widget.renderTemplate(widget, calendarWidgetTemplate)
return nil
}
func (widget *calendarWidget) Render() template.HTML {
return widget.cachedHTML
}
View on GitHub (pinned to 91324e8de7)
Solutions
- On the host, run: cat /sys/class/hwmon/hwmon*/name and ls /sys/class/hwmon/hwmon*/temp*_label to list real sensor keys
- Correct or remove the cpu-temp-sensor field in the System widget config so Glance falls back to inferCPUTempSensor() auto-detection
- After kernel updates, re-check the sensor key since hwmon numbering can change across boots
- On a VM, confirm a virtual thermal sensor is exposed at all; many hypervisors expose none
Example fix
// before (glance.yml) - type: system cpu-temp-sensor: coretemp_packageid_0 // after: let Glance infer the sensor - type: system # cpu-temp-sensor omitted, inferCPUTempSensor picks a sensible one
Defensive patterns
Strategy: validation
Validate before calling
readings, err := sensors.SensorsTemperatures()
if err == nil {
found := false
for _, r := range readings {
if r.SensorKey == configuredSensor { found = true; break }
}
if !found {
// list valid keys for the user
for _, r := range readings { fmt.Println("available:", r.SensorKey) }
}
} Prevention
- Prefer omitting cpu-temp-sensor so inferCPUTempSensor auto-detection applies
- Sensor keys are host-specific (k10temp_tctl, coretemp_packageid_0); never copy them between machines
- Re-verify the key after kernel updates — hwmon numbering can change
When it happens
Trigger: req.CPUTempSensor is set (e.g. cpu-temp-sensor: coretemp_packageid_0) but no returned reading has that exact SensorKey. Happens after a kernel/driver change renames hwmon entries, after adding/removing hardware, or simply from a typo.
Common situations: Copying a sensor name from another machine or blog post (keys are host-specific like k10temp_tctl or coretemp_packageid_0), upgrading the kernel so the hwmon device renumbers (hwmon2 -> hwmon3), or sensors being exposed under a different label on virtual machines.
Related errors
- usernames must be at least 3 characters
- hour-format must be either 12h or 24h
- invalid body type, must be either 'json' or 'string'
- missing timezone value
- template is required
AI-assisted analysis of glanceapp/glance@91324e8de7 (2026-08-15).
Data as JSON: /api/errors/f7ef0fb9230f126d.
Report an issue: GitHub.