{"record":{"id":"6e5e6f29fdcfdc9a","repo":"prometheus/node_exporter","slug":"failed-to-retrieve-pressure-stats-w","errorCode":null,"errorMessage":"failed to retrieve pressure stats: %w","messagePattern":"failed to retrieve pressure stats: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"collector/pressure_linux.go","lineNumber":119,"sourceCode":"func (c *pressureStatsCollector) Update(ch chan<- prometheus.Metric) error {\n\tfoundResources := 0\n\tfor _, res := range psiResources {\n\t\tc.logger.Debug(\"collecting statistics for resource\", \"resource\", res)\n\t\tvals, err := c.fs.PSIStatsForResource(res)\n\t\tif err != nil {\n\t\t\tif errors.Is(err, os.ErrNotExist) && res != psiResourceIRQ {\n\t\t\t\tc.logger.Debug(\"pressure information is unavailable, you need a Linux kernel >= 4.20 and/or CONFIG_PSI enabled for your kernel\", \"resource\", res)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif errors.Is(err, os.ErrNotExist) && res == psiResourceIRQ {\n\t\t\t\tc.logger.Debug(\"IRQ pressure information is unavailable, you need a Linux kernel >= 6.1 and/or CONFIG_PSI enabled for your kernel\", \"resource\", res)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif errors.Is(err, syscall.ENOTSUP) {\n\t\t\t\tc.logger.Debug(\"pressure information is disabled, add psi=1 kernel command line to enable it\")\n\t\t\t\treturn ErrNoData\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"failed to retrieve pressure stats: %w\", err)\n\t\t}\n\t\t// IRQ pressure does not have 'some' data.\n\t\t// See https://github.com/torvalds/linux/blob/v6.9/include/linux/psi_types.h#L65\n\t\tif vals.Some == nil && res != psiResourceIRQ {\n\t\t\tc.logger.Debug(\"pressure information returned no 'some' data\")\n\t\t\treturn ErrNoData\n\t\t}\n\t\tif vals.Full == nil && res != psiResourceCPU {\n\t\t\tc.logger.Debug(\"pressure information returned no 'full' data\")\n\t\t\treturn ErrNoData\n\t\t}\n\t\tswitch res {\n\t\tcase psiResourceCPU:\n\t\t\tch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, float64(vals.Some.Total)/1000.0/1000.0)\n\t\tcase psiResourceIO:\n\t\t\tch <- prometheus.MustNewConstMetric(c.io, prometheus.CounterValue, float64(vals.Some.Total)/1000.0/1000.0)\n\t\t\tch <- prometheus.MustNewConstMetric(c.ioFull, prometheus.CounterValue, float64(vals.Full.Total)/1000.0/1000.0)\n\t\tcase psiResourceMemory:","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/prometheus/node_exporter/blob/17ddd77c59ba27e1508e9f7894b1e55b44d6aed3/collector/pressure_linux.go#L101-L137","documentation":"node_exporter's pressure (PSI) collector wraps any failure from reading /proc/pressure/* with this message. It is thrown by Update when fs.PSIStats() returns a non-nil error that is NOT syscall.ENOTSUP (ENOTSUP is special-cased to ErrNoData with a hint to add psi=1 to the kernel command line). Any other I/O or parse error while retrieving pressure stall information produces this wrapped error.","triggerScenarios":"The pressure collector's Update() calls procfs PSIStats for cpu/memory/io/irq resources; the read or parse of /proc/pressure/<resource> fails with an error other than ENOTSUP (e.g. /proc not mounted, permission issue, or unexpected file contents from an unusual kernel).","commonSituations":"Running in a container or sandbox where /proc/pressure is not exposed (masked by runtime); very old or vendor kernels that expose malformed PSI data; seccomp/AppArmor policies blocking reads; kernels built without CONFIG_PSI but where the read still fails instead of returning ENOTSUP.","solutions":["Verify /proc/pressure/cpu, /proc/pressure/memory and /proc/pressure/io exist and are readable from the exporter process (ls -l /proc/pressure; cat /proc/pressure/cpu).","If PSI is disabled, reboot with psi=1 on the kernel command line so the collector gets ENOTSUP -> ErrNoData instead of a hard failure.","If running in a container, ensure /proc is mounted and not masked for the path /proc/pressure (docker run without --read-only proc masking, or adjust the runtime spec).","Update the prometheus/procfs dependency and node_exporter to versions supporting your kernel's PSI output format.","If the collector is unusable in your environment, disable it (--collector.pressure) to silence scrape failures."],"exampleFix":"// before\nif err != nil {\n    if errors.Is(err, fs.ErrNotExist) {\n        return ErrNoData\n    }\n    return fmt.Errorf(\"failed to retrieve pressure stats: %w\", err)\n}\n// after\nif err != nil {\n    if errors.Is(err, fs.ErrNotExist) || errors.Is(err, syscall.ENOTSUP) {\n        return ErrNoData // PSI disabled or unavailable: emit nothing, don't fail the scrape\n    }\n    return fmt.Errorf(\"failed to retrieve pressure stats: %w\", err)\n}","handlingStrategy":"fallback","validationCode":"// before starting the collector / scraping\nfor _, r := range []string{\"cpu\", \"memory\", \"io\"} {\n    b, err := os.ReadFile(\"/proc/pressure/\" + r)\n    if err != nil {\n        if errors.Is(err, os.ErrNotExist) {\n            log.Printf(\"PSI unavailable for %s: enable with psi=1 kernel cmdline\", r)\n        }\n        // treat as no-data\n    }\n    _ = b\n}","typeGuard":null,"tryCatchPattern":"stats, err := fs.PSIStats(\"cpu\")\nif err != nil {\n    if errors.Is(err, syscall.ENOTSUP) || errors.Is(err, fs.ErrNotExist) {\n        return ErrNoData // PSI disabled: skip gracefully\n    }\n    return fmt.Errorf(\"failed to retrieve pressure stats: %w\", err)\n}","preventionTips":["Boot kernels with psi=1 (or CONFIG_PSI=y default-on kernels) before deploying the pressure collector.","Pre-flight check /proc/pressure readability in your deployment script.","Ensure container runtimes do not mask /proc/pressure.","Treat ErrNoData as an expected, non-alerting condition in dashboards."],"tags":["linux","procfs","psi","pressure-stall-information","node-exporter"],"backgroundTag":"operation-not-supported","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"}