{"record":{"id":"cbb2fdbbb464d926","repo":"prometheus/node_exporter","slug":"couldn-t-get-snmp6-stats-w","errorCode":null,"errorMessage":"couldn't get SNMP6 stats: %w","messagePattern":"couldn't get SNMP6 stats: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"collector/netstat_linux.go","lineNumber":90,"sourceCode":"\treturn &netStatCollector{\n\t\tproc:         proc,\n\t\tfieldPattern: pattern,\n\t\tlogger:       logger,\n\t}, nil\n}\n\nfunc (c *netStatCollector) Update(ch chan<- prometheus.Metric) error {\n\tnetStats, err := c.proc.Netstat()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"couldn't get netstats: %w\", err)\n\t}\n\tsnmpStats, err := c.proc.Snmp()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"couldn't get SNMP stats: %w\", err)\n\t}\n\tsnmp6Stats, err := c.proc.Snmp6()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"couldn't get SNMP6 stats: %w\", err)\n\t}\n\n\tc.emitStruct(ch, netStats.TcpExt)\n\tc.emitStruct(ch, netStats.IpExt)\n\tc.emitStruct(ch, snmpStats.Ip)\n\tc.emitStruct(ch, snmpStats.Icmp)\n\tc.emitStruct(ch, snmpStats.IcmpMsg)\n\tc.emitStruct(ch, snmpStats.Tcp)\n\tc.emitStruct(ch, snmpStats.Udp)\n\tc.emitStruct(ch, snmpStats.UdpLite)\n\tc.emitStruct(ch, snmp6Stats.Ip6)\n\tc.emitStruct(ch, snmp6Stats.Icmp6)\n\tc.emitStruct(ch, snmp6Stats.Udp6)\n\tc.emitStruct(ch, snmp6Stats.UdpLite6)\n\n\treturn nil\n}\n","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/prometheus/node_exporter/blob/17ddd77c59ba27e1508e9f7894b1e55b44d6aed3/collector/netstat_linux.go#L72-L108","documentation":"The netstat collector's Update reads /proc/net/snmp6 via the procfs library (proc.Snmp6()) for IPv6 statistics. If reading or parsing that file fails, Update returns this wrapped error, failing the whole scrape even if only IPv6 data is unavailable.","triggerScenarios":"c.proc.Snmp6() errors when /proc/net/snmp6 is missing (very common on hosts with IPv6 disabled), unreadable, or unparseable by the procfs library.","commonSituations":"IPv6 disabled at boot (ipv6.disable=1) or no IPv6 support, so /proc/net/snmp6 doesn't exist; containers without IPv6; kernel/procfs version skew.","solutions":["Confirm whether IPv6 is enabled on the host (ls /proc/net/snmp6); if IPv6 is intentionally disabled, expect/ignore this error or upgrade node_exporter versions that handle it.","Enable IPv6 if those metrics are required (remove ipv6.disable=1, load ipv6 module).","Check /proc mount permissions and hidepid settings.","Update node_exporter/procfs; report persistent parse failures upstream with kernel details."],"exampleFix":"// before\nsnmp6Stats, err := c.proc.Snmp6()\nif err != nil {\n\treturn fmt.Errorf(\"couldn't get SNMP6 stats: %w\", err)\n}\n// after (tolerate missing IPv6 support)\nsnmp6Stats, err := c.proc.Snmp6()\nif err != nil {\n\tif os.IsNotExist(errors.Unwrap(err)) {\n\t\tc.logger.Info(\"IPv6 appears disabled; skipping SNMP6 metrics\")\n\t\tsnmp6Stats = nil\n\t} else {\n\t\treturn fmt.Errorf(\"couldn't get SNMP6 stats: %w\", err)\n\t}\n}","handlingStrategy":"fallback","validationCode":"import \"os\"\n// Detect IPv6-disabled hosts before enabling SNMP6 expectations:\nif _, err := os.Stat(\"/proc/net/snmp6\"); os.IsNotExist(err) {\n\t// IPv6 disabled; do not require snmp6 metrics\n}","typeGuard":"null","tryCatchPattern":"// Treat missing snmp6 as benign when IPv6 is off\nstats, err := proc.Snmp6()\nif err != nil {\n\tif os.IsNotExist(errors.Unwrap(err)) {\n\t\tlogger.Info(\"IPv6 disabled; skipping SNMP6 stats\")\n\t} else {\n\t\treturn fmt.Errorf(\"couldn't get SNMP6 stats: %w\", err)\n\t}\n}","preventionTips":["Document that SNMP6 metrics require IPv6 enabled on the host.","If hosts intentionally run ipv6.disable=1, ignore/silence this collector failure in alerting.","Verify /proc/net/snmp6 exists in your host image before deploying IPv6 dashboards.","Keep node_exporter current so upstream handling of missing snmp6 is picked up."],"tags":["linux","procfs","snmp6","ipv6","scrape"],"backgroundTag":"file-read-failed","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"}