{"record":{"id":"7ffff674f3e4511d","repo":"prometheus/node_exporter","slug":"failed-to-open-procfs-w-7ffff6","errorCode":null,"errorMessage":"failed to open procfs: %w","messagePattern":"failed to open procfs: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"collector/slabinfo_linux.go","lineNumber":47,"sourceCode":"\tslabNameExclude = kingpin.Flag(\"collector.slabinfo.slabs-exclude\", \"Regexp of slabs to exclude in slabinfo collector.\").Default(\"\").String()\n)\n\ntype slabinfoCollector struct {\n\tfs             procfs.FS\n\tlogger         *slog.Logger\n\tsubsystem      string\n\tlabels         []string\n\tslabNameFilter deviceFilter\n}\n\nfunc init() {\n\tregisterCollector(\"slabinfo\", defaultDisabled, NewSlabinfoCollector)\n}\n\nfunc NewSlabinfoCollector(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 &slabinfoCollector{logger: logger,\n\t\tfs:             fs,\n\t\tsubsystem:      \"slabinfo\",\n\t\tlabels:         []string{\"slab\"},\n\t\tslabNameFilter: newDeviceFilter(*slabNameExclude, *slabNameInclude),\n\t}, nil\n}\n\nfunc (c *slabinfoCollector) Update(ch chan<- prometheus.Metric) error {\n\tslabinfo, err := c.fs.SlabInfo()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"couldn't get %s: %w\", c.subsystem, err)\n\t}\n\n\tfor _, slab := range slabinfo.Slabs {\n\t\tif c.slabNameFilter.ignored(slab.Name) {","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/prometheus/node_exporter/blob/17ddd77c59ba27e1508e9f7894b1e55b44d6aed3/collector/slabinfo_linux.go#L29-L65","documentation":"NewSlabinfoCollector wraps the error from procfs.NewFS(*procPath) with 'failed to open procfs': the configured proc path could not be opened when constructing the slabinfo collector, so it never registers.","triggerScenarios":"Enabling the slabinfo collector with --path.procfs set to a missing or invalid directory; procfs.NewFS validation fails during NewSlabinfoCollector.","commonSituations":"Container images without /proc mounted at the expected path; incomplete custom procfs snapshot directories; typo in --path.procfs.","solutions":["Point --path.procfs at a valid procfs mount (default /proc)","Mount /proc into the container","Check the path manually (ls /proc/slabinfo) before starting"],"exampleFix":"// before\nnode_exporter --path.procfs=/var/empty --collector.slabinfo\n// after\nnode_exporter --path.procfs=/proc --collector.slabinfo","handlingStrategy":"validation","validationCode":"func ensureProcfs(path string) error {\n\tif _, err := os.Stat(filepath.Join(path, \"slabinfo\")); err != nil {\n\t\treturn fmt.Errorf(\"%q lacks slabinfo; not a usable procfs for this collector\", path)\n\t}\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":"c, err := NewSlabinfoCollector(logger)\nif err != nil {\n\tlogger.Error(\"slabinfo collector not registered\", \"err\", err)\n}","preventionTips":["Mount /proc in containers that enable the slabinfo collector","Point --path.procfs at a real procfs mount, not an empty snapshot dir","Remember slabinfo is disabled by default; enable it only where /proc/slabinfo is readable"],"tags":["procfs","startup","linux","slabinfo"],"backgroundTag":"file-open-failed","analyzedSha":"17ddd77c59ba27e1508e9f7894b1e55b44d6aed3","analyzedAt":"2026-09-07T17:54:06.211Z","contentChangedAt":"2026-09-07T17:54:06.211Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}