{"record":{"id":"6ab6de9ce6911cca","repo":"prometheus/node_exporter","slug":"couldn-t-get-udp-queued-bytes-w","errorCode":null,"errorMessage":"couldn't get udp queued bytes: %w","messagePattern":"couldn't get udp queued bytes: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"collector/udp_queues_linux.go","lineNumber":67,"sourceCode":"\t\t\tprometheus.BuildFQName(namespace, \"udp\", \"queues\"),\n\t\t\t\"Number of allocated memory in the kernel for UDP datagrams in bytes.\",\n\t\t\t[]string{\"queue\", \"ip\"}, nil,\n\t\t),\n\t\tlogger: logger,\n\t}, nil\n}\n\nfunc (c *udpQueuesCollector) Update(ch chan<- prometheus.Metric) error {\n\n\ts4, errIPv4 := c.fs.NetUDPSummary()\n\tif errIPv4 == nil {\n\t\tch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(s4.TxQueueLength), \"tx\", \"v4\")\n\t\tch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(s4.RxQueueLength), \"rx\", \"v4\")\n\t} else {\n\t\tif errors.Is(errIPv4, os.ErrNotExist) {\n\t\t\tc.logger.Debug(\"not collecting ipv4 based metrics\")\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"couldn't get udp queued bytes: %w\", errIPv4)\n\t\t}\n\t}\n\n\ts6, errIPv6 := c.fs.NetUDP6Summary()\n\tif errIPv6 == nil {\n\t\tch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(s6.TxQueueLength), \"tx\", \"v6\")\n\t\tch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(s6.RxQueueLength), \"rx\", \"v6\")\n\t} else {\n\t\tif errors.Is(errIPv6, os.ErrNotExist) {\n\t\t\tc.logger.Debug(\"not collecting ipv6 based metrics\")\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"couldn't get udp6 queued bytes: %w\", errIPv6)\n\t\t}\n\t}\n\n\tif errors.Is(errIPv4, os.ErrNotExist) && errors.Is(errIPv6, os.ErrNotExist) {\n\t\treturn ErrNoData\n\t}","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/prometheus/node_exporter/blob/17ddd77c59ba27e1508e9f7894b1e55b44d6aed3/collector/udp_queues_linux.go#L49-L85","documentation":"During Update, the UDP queues collector reads /proc/net/udp summary data via fs.NetUDP4Summary(). Errors other than os.ErrNotExist are wrapped as 'couldn't get udp queued bytes: %w'; a missing file is silently skipped (debug log) because that kernel may lack the file. Any other read/parse error aborts the scrape with this message.","triggerScenarios":"udpQueuesCollector.Update when NetUDP4Summary() returns a non-ErrNotExist error — malformed /proc/net/udp contents, permission problems, or procfs parse failures.","commonSituations":"Kernel without /proc/net/udp (treated as no-data, not this error), LKMs or LSMs corrupting/limiting procfs reads, and unusual procfs content from hardened kernels tripping the parser.","solutions":["Check /proc/net/udp is readable by the exporter process.","Inspect the wrapped inner error to distinguish parse vs permission failures.","Update node_exporter/procfs if the kernel emits an unexpected /proc/net/udp format.","Remember os.ErrNotExist is expected on some kernels and is not this error."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if _, err := os.Stat(\"/proc/net/udp\"); err != nil {\n    if errors.Is(err, os.ErrNotExist) {\n        // expected on some kernels; udp queues metrics will be absent\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := c.Update(ch); err != nil {\n    if errors.Is(err, ErrNoData) { return }\n    if strings.Contains(err.Error(), \"couldn't get udp queued bytes\") {\n        logger.Warn(\"udp v4 queue metrics unavailable\", \"err\", err)\n        return\n    }\n    return err\n}","preventionTips":["Check /proc/net/udp readability before enabling udp_queues.","Treat ErrNotExist as expected on kernels without the file.","Update procfs library versions when kernels change /proc/net/udp formats.","Audit LSM/seccomp policies that could block procfs reads."],"tags":["linux","procfs","udp","network"],"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"}