{"record":{"id":"e24512c31c583572","repo":"prometheus/node_exporter","slug":"failed-to-open-procfs-w-e24512","errorCode":null,"errorMessage":"failed to open procfs: %w","messagePattern":"failed to open procfs: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"collector/pressure_linux.go","lineNumber":61,"sourceCode":"\tioFull  *prometheus.Desc\n\tmem     *prometheus.Desc\n\tmemFull *prometheus.Desc\n\tirqFull *prometheus.Desc\n\n\tfs procfs.FS\n\n\tlogger *slog.Logger\n}\n\nfunc init() {\n\tregisterCollector(\"pressure\", defaultEnabled, NewPressureStatsCollector)\n}\n\n// NewPressureStatsCollector returns a Collector exposing pressure stall information\nfunc NewPressureStatsCollector(logger *slog.Logger) (Collector, error) {\n\tfs, err := procfs.NewFS(*procPath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to open procfs: %w\", err)\n\t}\n\n\treturn &pressureStatsCollector{\n\t\tcpu: prometheus.NewDesc(\n\t\t\tprometheus.BuildFQName(namespace, \"pressure\", \"cpu_waiting_seconds_total\"),\n\t\t\t\"Total time in seconds that processes have waited for CPU time\",\n\t\t\tnil, nil,\n\t\t),\n\t\tio: prometheus.NewDesc(\n\t\t\tprometheus.BuildFQName(namespace, \"pressure\", \"io_waiting_seconds_total\"),\n\t\t\t\"Total time in seconds that processes have waited due to IO congestion\",\n\t\t\tnil, nil,\n\t\t),\n\t\tioFull: prometheus.NewDesc(\n\t\t\tprometheus.BuildFQName(namespace, \"pressure\", \"io_stalled_seconds_total\"),\n\t\t\t\"Total time in seconds no process could make progress due to IO congestion\",\n\t\t\tnil, nil,\n\t\t),","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/prometheus/node_exporter/blob/17ddd77c59ba27e1508e9f7894b1e55b44d6aed3/collector/pressure_linux.go#L43-L79","documentation":"NewPressureStatsCollector opens the procfs filesystem at the --path.procfs location before creating PSI (pressure stall information) collectors. If procfs.NewFS fails, the collector cannot be constructed and the error is wrapped as \"failed to open procfs\". NewFS validates that the given path looks like a proc filesystem, so this almost always means the path is wrong or not a real procfs mount.","triggerScenarios":"NewPressureStatsCollector -> procfs.NewFS(*procPath) returning an error because --path.procfs does not exist, is not a directory, or does not resemble a procfs mount (e.g. missing/invalid /proc/stat or /proc/meminfo sanity files).","commonSituations":"Containers where /proc is not mounted or is masked; a mistyped --path.procfs; running on systems where PSI is unavailable but /proc is also atypical; pointing --path.procfs at a host-mounted path lacking procfs structure.","solutions":["Verify --path.procfs points to a mounted proc filesystem (default /proc): check that $PROC/pressure exists and /proc/stat is readable.","In containers, mount host procfs read-only (-v /proc:/host/proc:ro) and pass --path.procfs=/host/proc.","If PSI is not needed, disable the pressure collector (--collector.pressure=false) so construction is skipped."],"exampleFix":"// before\nnode_exporter --path.procfs=/host/proc  # empty mount\n// after\ndocker run -v /proc:/host/proc:ro node-exporter --path.procfs=/host/proc","handlingStrategy":"validation","validationCode":"func procfsReady(path string) error {\n\tinfo, err := os.Stat(filepath.Join(path, \"stat\"))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"%s is not a procfs mount: %w\", path, err)\n\t}\n\tif info.IsDir() {\n\t\treturn fmt.Errorf(\"%s/stat is not a file\", path)\n\t}\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":"coll, err := NewPressureStatsCollector(logger)\nif err != nil {\n\tlogger.Warn(\"pressure collector unavailable\", \"err\", err)\n\tcoll = nil // continue without PSI metrics\n}","preventionTips":["Verify /proc (or --path.procfs) is a genuine procfs mount before starting the exporter.","In containers, mount host procfs read-only and pass the matching --path.procfs value.","Disable --collector.pressure where PSI metrics are not required."],"tags":["go","linux","procfs","psi","node-exporter"],"backgroundTag":"file-not-found","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"}