{"record":{"id":"f7ef0fb9230f126d","repo":"glanceapp/glance","slug":"invalid-first-day-of-week","errorCode":null,"errorMessage":"invalid first day of week","messagePattern":"invalid first day of week","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/glance/widget-calendar.go","lineNumber":34,"sourceCode":"\t\"thursday\":  time.Thursday,\n\t\"friday\":    time.Friday,\n\t\"saturday\":  time.Saturday,\n}\n\ntype calendarWidget struct {\n\twidgetBase     `yaml:\",inline\"`\n\tFirstDayOfWeek string        `yaml:\"first-day-of-week\"`\n\tFirstDay       int           `yaml:\"-\"`\n\tcachedHTML     template.HTML `yaml:\"-\"`\n}\n\nfunc (widget *calendarWidget) initialize() error {\n\twidget.withTitle(\"Calendar\").withError(nil)\n\n\tif widget.FirstDayOfWeek == \"\" {\n\t\twidget.FirstDayOfWeek = \"monday\"\n\t} else if _, ok := calendarWeekdaysToInt[widget.FirstDayOfWeek]; !ok {\n\t\treturn errors.New(\"invalid first day of week\")\n\t}\n\n\twidget.FirstDay = int(calendarWeekdaysToInt[widget.FirstDayOfWeek])\n\twidget.cachedHTML = widget.renderTemplate(widget, calendarWidgetTemplate)\n\n\treturn nil\n}\n\nfunc (widget *calendarWidget) Render() template.HTML {\n\treturn widget.cachedHTML\n}\n","sourceCodeStart":16,"sourceCodeEnd":46,"githubUrl":"https://github.com/glanceapp/glance/blob/91324e8de762702e97b0ac5c8e36271d644d8642/internal/glance/widget-calendar.go#L16-L46","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before (glance.yml)\n- type: system\n  cpu-temp-sensor: coretemp_packageid_0\n// after: let Glance infer the sensor\n- type: system\n  # cpu-temp-sensor omitted, inferCPUTempSensor picks a sensible one","handlingStrategy":"validation","validationCode":"readings, err := sensors.SensorsTemperatures()\nif err == nil {\n    found := false\n    for _, r := range readings {\n        if r.SensorKey == configuredSensor { found = true; break }\n    }\n    if !found {\n        // list valid keys for the user\n        for _, r := range readings { fmt.Println(\"available:\", r.SensorKey) }\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["go","system-info","sensors","hardware","config"],"backgroundTag":null,"analyzedSha":"91324e8de762702e97b0ac5c8e36271d644d8642","analyzedAt":"2026-08-15T14:12:54.279Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}