{"record":{"id":"f6134389cd3c8d5a","repo":"prometheus/node_exporter","slug":"couldn-t-get-ce-count-for-controller-s-w","errorCode":null,"errorMessage":"couldn't get ce_count for controller %s: %w","messagePattern":"couldn't get ce_count for controller (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"collector/edac_linux.go","lineNumber":114,"sourceCode":"\tlabel = strings.ReplaceAll(label, \"channel\", \"_channel\")\n\treturn label\n}\n\nfunc (c *edacCollector) Update(ch chan<- prometheus.Metric) error {\n\tmemControllers, err := filepath.Glob(sysFilePath(\"devices/system/edac/mc/mc[0-9]*\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, controller := range memControllers {\n\t\tcontrollerMatch := edacMemControllerRE.FindStringSubmatch(controller)\n\t\tif controllerMatch == nil {\n\t\t\treturn fmt.Errorf(\"controller string didn't match regexp: %s\", controller)\n\t\t}\n\t\tcontrollerNumber := controllerMatch[1]\n\n\t\tvalue, err := readUintFromFile(filepath.Join(controller, \"ce_count\"))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"couldn't get ce_count for controller %s: %w\", controllerNumber, err)\n\t\t}\n\t\tch <- prometheus.MustNewConstMetric(\n\t\t\tedacCeCount, prometheus.CounterValue, float64(value), controllerNumber)\n\n\t\tvalue, err = readUintFromFile(filepath.Join(controller, \"ce_noinfo_count\"))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"couldn't get ce_noinfo_count for controller %s: %w\", controllerNumber, err)\n\t\t}\n\t\tch <- prometheus.MustNewConstMetric(\n\t\t\tedacCsRowCECount, prometheus.CounterValue, float64(value), controllerNumber, \"unknown\")\n\n\t\tvalue, err = readUintFromFile(filepath.Join(controller, \"ue_count\"))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"couldn't get ue_count for controller %s: %w\", controllerNumber, err)\n\t\t}\n\t\tch <- prometheus.MustNewConstMetric(\n\t\t\tedacUeCount, prometheus.CounterValue, float64(value), controllerNumber)\n","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/prometheus/node_exporter/blob/17ddd77c59ba27e1508e9f7894b1e55b44d6aed3/collector/edac_linux.go#L96-L132","documentation":"After matching a controller directory, Update reads its ce_count attribute via readUintFromFile. Any failure (missing file, permission, non-numeric content) aborts the scrape wrapped with the controller number. This indicates the EDAC sysfs attributes for that controller are unreadable or absent.","triggerScenarios":"readUintFromFile(<controller>/ce_count) fails: the file does not exist for this EDAC driver, permissions deny read, or the content cannot be parsed as a uint.","commonSituations":"EDAC drivers that omit ce_count; running node_exporter without root when ce_count is root-only; kernels where the attribute was renamed/removed across versions.","solutions":["Check the file exists and is readable: cat /sys/devices/system/edac/memctlr/mc0/ce_count","Run node_exporter with enough privileges to read EDAC attributes","Check the wrapped (%w) cause to distinguish ENOENT from EACCES or parse errors","Verify the EDAC driver exposes correctable-error counters; if not, the collector cannot report them"],"exampleFix":"// before\nnode_exporter (unprivileged, EACCES on ce_count)\n// after\nsudo node_exporter  # or relax permissions on /sys/devices/system/edac/memctlr/*/ce_count","handlingStrategy":"validation","validationCode":"if _, err := os.ReadFile(\"/sys/devices/system/edac/memctlr/mc0/ce_count\"); err != nil {\n    // ce_count unreadable; run exporter as root or relax permissions\n}","typeGuard":null,"tryCatchPattern":"if err := c.Update(ch); err != nil {\n    if strings.Contains(err.Error(), \"couldn't get ce_count\") {\n        // inspect wrapped cause: ENOENT (driver lacks it) vs EACCES (permissions)\n    }\n}","preventionTips":["Run node_exporter with read access to /sys/devices/system/edac/**","Check attribute availability per driver before enabling the edac collector","Alert on scrape errors naming specific EDAC counters to catch driver/kernel changes"],"tags":["linux","edac","sysfs","file-read"],"backgroundTag":"file-read-failed","analyzedSha":"17ddd77c59ba27e1508e9f7894b1e55b44d6aed3","analyzedAt":"2026-09-07T17:54:06.211Z","contentChangedAt":"2026-09-07T17:54:06.211Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}