prometheus/node_exporter · error

couldn't get ce_count for controller/csrow/channel

Error message

couldn't get ce_count for controller/csrow/channel %s/%s/%s: %w

What it means

The EDAC collector globs <csrow>/ch*_ce_count files for per-channel correctable-error counts; when reading one of these files fails, it returns this error naming controller, csrow, and channel. Like the csrow counters, this aborts the collector's Update and the scrape reports failed.

Solutions

  1. Check the specific file: `cat /sys/devices/system/edac/mc/mc0/csrow0/ch0_ce_count`.
  2. Fix read permissions / MAC (SELinux/AppArmor) policy on sysfs EDAC attributes.
  3. Reload the EDAC module and re-check that all ch*_ce_count files are fully populated.
  4. Upgrade kernel/driver if your memory controller lacks complete channel counter support.
Defensive patterns

Strategy: validation

Validate before calling

const fs = require('fs');
const glob = (dir) => fs.readdirSync(dir).filter(f => /^ch\d+_ce_count$/.test(f));
const csrowDir = '/sys/devices/system/edac/mc/mc0/csrow0';
if (fs.existsSync(csrowDir)) {
  for (const f of glob(csrowDir)) {
    const v = fs.readFileSync(`${csrowDir}/${f}`, 'utf8').trim();
    if (isNaN(parseInt(v, 10))) console.warn(`non-numeric channel counter: ${csrowDir}/${f}`);
  }
}

Try / catch

try {
  await scrapeNodeExporter();
} catch (e) {
  if (String(e).includes('controller/csrow/channel')) {
    console.warn('EDAC channel counter read failed; check driver completeness or disable --collector.edac');
  } else throw e;
}

Prevention

When it happens

Trigger: readUintFromFile(chFile) fails for a file matched by filepath.Glob(csrow + "/ch*_ce_count") during Update.

Common situations: Channel files present but unreadable due to permissions; driver exposing chX_ue_count only (no _ce variant matched path stays fine but content unreadable); sysfs churn while the EDAC module reloads; kernel drivers with partial channel support.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


AI-assisted analysis of prometheus/node_exporter@17ddd77c59 (2026-09-07). Data as JSON: /api/errors/33cab931904acf09. Report an issue: GitHub.

Appendix: source

Thrown at collector/edac_linux.go:180

			}
			ch <- prometheus.MustNewConstMetric(
				edacCsRowUECount, prometheus.CounterValue, float64(value), controllerNumber, csrowNumber)

			channelFiles, err := filepath.Glob(csrow + "/ch*_ce_count")
			if err != nil {
				return err
			}
			for _, chFile := range channelFiles {
				match := edacMemChannelRE.FindStringSubmatch(filepath.Base(chFile))
				if match == nil {
					continue
				}
				channelNumber := match[1]
				label := edacDimmLabel(csrow, channelNumber)

				value, err = readUintFromFile(chFile)
				if err != nil {
					return fmt.Errorf("couldn't get ce_count for controller/csrow/channel %s/%s/%s: %w", controllerNumber, csrowNumber, channelNumber, err)
				}
				ch <- prometheus.MustNewConstMetric(
					edacChannelCECount,
					prometheus.CounterValue,
					float64(value),
					controllerNumber,
					csrowNumber,
					channelNumber,
					label,
				)

				value, err = readUintFromFile(filepath.Join(csrow, "ch"+channelNumber+"_ue_count"))
				if err == nil {
					ch <- prometheus.MustNewConstMetric(
						edacChannelUECount,
						prometheus.CounterValue,
						float64(value),
						controllerNumber,

View on GitHub (pinned to 17ddd77c59)