prometheus/node_exporter · error
couldn't get SNMP6 stats
Error message
couldn't get SNMP6 stats: %w
What it means
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.
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.
Example fix
// before
snmp6Stats, err := c.proc.Snmp6()
if err != nil {
return fmt.Errorf("couldn't get SNMP6 stats: %w", err)
}
// after (tolerate missing IPv6 support)
snmp6Stats, err := c.proc.Snmp6()
if err != nil {
if os.IsNotExist(errors.Unwrap(err)) {
c.logger.Info("IPv6 appears disabled; skipping SNMP6 metrics")
snmp6Stats = nil
} else {
return fmt.Errorf("couldn't get SNMP6 stats: %w", err)
}
} Defensive patterns
Strategy: fallback
Validate before calling
import "os"
// Detect IPv6-disabled hosts before enabling SNMP6 expectations:
if _, err := os.Stat("/proc/net/snmp6"); os.IsNotExist(err) {
// IPv6 disabled; do not require snmp6 metrics
} Type guard
null
Try / catch
// Treat missing snmp6 as benign when IPv6 is off
stats, err := proc.Snmp6()
if err != nil {
if os.IsNotExist(errors.Unwrap(err)) {
logger.Info("IPv6 disabled; skipping SNMP6 stats")
} else {
return fmt.Errorf("couldn't get SNMP6 stats: %w", err)
}
} Prevention
- 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.
When it happens
Trigger: c.proc.Snmp6() errors when /proc/net/snmp6 is missing (very common on hosts with IPv6 disabled), unreadable, or unparseable by the procfs library.
Common situations: 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.
Understand the failure class
Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.
Related errors
- couldn't get buddyinfo
- failed to get memory info
- couldn't get netstats
- couldn't get SNMP stats
- unable to retrieve number of allocated threads
AI-assisted analysis of prometheus/node_exporter@17ddd77c59 (2026-09-07).
Data as JSON: /api/errors/cbb2fdbbb464d926.
Report an issue: GitHub.
Appendix: source
Thrown at collector/netstat_linux.go:90
return &netStatCollector{
proc: proc,
fieldPattern: pattern,
logger: logger,
}, nil
}
func (c *netStatCollector) Update(ch chan<- prometheus.Metric) error {
netStats, err := c.proc.Netstat()
if err != nil {
return fmt.Errorf("couldn't get netstats: %w", err)
}
snmpStats, err := c.proc.Snmp()
if err != nil {
return fmt.Errorf("couldn't get SNMP stats: %w", err)
}
snmp6Stats, err := c.proc.Snmp6()
if err != nil {
return fmt.Errorf("couldn't get SNMP6 stats: %w", err)
}
c.emitStruct(ch, netStats.TcpExt)
c.emitStruct(ch, netStats.IpExt)
c.emitStruct(ch, snmpStats.Ip)
c.emitStruct(ch, snmpStats.Icmp)
c.emitStruct(ch, snmpStats.IcmpMsg)
c.emitStruct(ch, snmpStats.Tcp)
c.emitStruct(ch, snmpStats.Udp)
c.emitStruct(ch, snmpStats.UdpLite)
c.emitStruct(ch, snmp6Stats.Ip6)
c.emitStruct(ch, snmp6Stats.Icmp6)
c.emitStruct(ch, snmp6Stats.Udp6)
c.emitStruct(ch, snmp6Stats.UdpLite6)
return nil
}
View on GitHub (pinned to 17ddd77c59)