{"record":{"id":"b5fc44f5ae340d6d","repo":"prometheus/node_exporter","slug":"failed-to-parse-proc-net-dev-w","errorCode":null,"errorMessage":"failed to parse /proc/net/dev: %w","messagePattern":"failed to parse /proc/net/dev: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"collector/netdev_linux.go","lineNumber":154,"sourceCode":"\t\t\t\"transmit_compressed\": stats.TXCompressed,\n\t\t\t\"receive_nohandler\":   stats.RXNoHandler,\n\t\t}\n\t}\n\n\treturn metrics\n}\n\nfunc procNetDevStats(filter *deviceFilter, logger *slog.Logger) (netDevStats, error) {\n\tmetrics := netDevStats{}\n\n\tfs, err := procfs.NewFS(*procPath)\n\tif err != nil {\n\t\treturn metrics, fmt.Errorf(\"failed to open procfs: %w\", err)\n\t}\n\n\tnetDev, err := fs.NetDev()\n\tif err != nil {\n\t\treturn metrics, fmt.Errorf(\"failed to parse /proc/net/dev: %w\", err)\n\t}\n\n\tfor _, stats := range netDev {\n\t\tname := stats.Name\n\n\t\tif filter.ignored(name) {\n\t\t\tlogger.Debug(\"Ignoring device\", \"device\", name)\n\t\t\tcontinue\n\t\t}\n\n\t\tmetrics[name] = map[string]uint64{\n\t\t\t\"receive_bytes\":       stats.RxBytes,\n\t\t\t\"receive_packets\":     stats.RxPackets,\n\t\t\t\"receive_errors\":      stats.RxErrors,\n\t\t\t\"receive_dropped\":     stats.RxDropped,\n\t\t\t\"receive_fifo\":        stats.RxFIFO,\n\t\t\t\"receive_frame\":       stats.RxFrame,\n\t\t\t\"receive_compressed\":  stats.RxCompressed,","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/prometheus/node_exporter/blob/17ddd77c59ba27e1508e9f7894b1e55b44d6aed3/collector/netdev_linux.go#L136-L172","documentation":"After opening procfs, procNetDevStats calls fs.NetDev() to parse /proc/net/dev. If parsing fails (unexpected file content or format), the error is wrapped as 'failed to parse /proc/net/dev'. procfs expects the kernel's documented net/dev format, so a parse failure signals either a non-standard kernel or that the path points at something that is not a real /proc/net/dev.","triggerScenarios":"fs.NetDev() errors while scanning/parsing /proc/net/dev: file missing under the mounted procfs, malformed lines (custom kernels, virtualized /proc shims), or read errors mid-parse.","commonSituations":"--path.procfs pointing at a fake/overlay directory that contains a partial /proc copy; LXC/gVisor environments presenting unusual /proc/net/dev contents; procfs library version incompatibility with unusual kernel output.","solutions":["Verify cat /host/proc/net/dev (or your configured path) shows the standard two-header-line format with rx/tx columns.","Confirm the mount is genuine host procfs, not a copied/overlay directory.","Upgrade node_exporter/procfs library, then retry — parser tolerance changes between releases.","Inspect the wrapped inner error to see the line or field that failed to parse.","If running under gVisor/LXC, test the same collector on plain Linux to confirm the environment is the cause."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// preflight: file must look like kernel /proc/net/dev\nb, err := os.ReadFile(filepath.Join(*procPath, \"net\", \"dev\"))\nif err != nil { return err }\nlines := strings.Split(string(b), \"\\n\")\nif len(lines) < 3 || !strings.Contains(lines[0], \"bytes\") || !strings.Contains(lines[1], \"packets\") {\n\treturn fmt.Errorf(\"%s/net/dev has unexpected format\", *procPath)\n}","typeGuard":null,"tryCatchPattern":"err := collector.Update(ch)\nif err != nil && strings.Contains(err.Error(), \"failed to parse /proc/net/dev\") {\n\tlogger.Error(\"procfs parse failed; environment likely non-standard (gVisor/LXC?)\", \"err\", err)\n\treturn nil\n}","preventionTips":["Mount genuine host procfs, not copied directories","Check /proc/net/dev contents manually when using gVisor/LXC/firecracker","Upgrade the procfs dependency in the exporter for parser fixes","Diff actual file headers against the canonical kernel format"],"tags":["linux","procfs","parsing"],"backgroundTag":"invalid-argument-format","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"}