prometheus/node_exporter · error

couldn't get udp queued bytes

Error message

couldn't get udp queued bytes: %w

What it means

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.

Solutions

  1. Check /proc/net/udp is readable by the exporter process.
  2. Inspect the wrapped inner error to distinguish parse vs permission failures.
  3. Update node_exporter/procfs if the kernel emits an unexpected /proc/net/udp format.
  4. Remember os.ErrNotExist is expected on some kernels and is not this error.
Defensive patterns

Strategy: try-catch

Validate before calling

if _, err := os.Stat("/proc/net/udp"); err != nil {
    if errors.Is(err, os.ErrNotExist) {
        // expected on some kernels; udp queues metrics will be absent
    }
}

Try / catch

if err := c.Update(ch); err != nil {
    if errors.Is(err, ErrNoData) { return }
    if strings.Contains(err.Error(), "couldn't get udp queued bytes") {
        logger.Warn("udp v4 queue metrics unavailable", "err", err)
        return
    }
    return err
}

Prevention

When it happens

Trigger: udpQueuesCollector.Update when NetUDP4Summary() returns a non-ErrNotExist error — malformed /proc/net/udp contents, permission problems, or procfs parse failures.

Common situations: 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.

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


AI-assisted analysis of prometheus/node_exporter@17ddd77c59 (2026-09-07). Data as JSON: /api/errors/6ab6de9ce6911cca. Report an issue: GitHub.

Appendix: source

Thrown at collector/udp_queues_linux.go:67

			prometheus.BuildFQName(namespace, "udp", "queues"),
			"Number of allocated memory in the kernel for UDP datagrams in bytes.",
			[]string{"queue", "ip"}, nil,
		),
		logger: logger,
	}, nil
}

func (c *udpQueuesCollector) Update(ch chan<- prometheus.Metric) error {

	s4, errIPv4 := c.fs.NetUDPSummary()
	if errIPv4 == nil {
		ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(s4.TxQueueLength), "tx", "v4")
		ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(s4.RxQueueLength), "rx", "v4")
	} else {
		if errors.Is(errIPv4, os.ErrNotExist) {
			c.logger.Debug("not collecting ipv4 based metrics")
		} else {
			return fmt.Errorf("couldn't get udp queued bytes: %w", errIPv4)
		}
	}

	s6, errIPv6 := c.fs.NetUDP6Summary()
	if errIPv6 == nil {
		ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(s6.TxQueueLength), "tx", "v6")
		ch <- prometheus.MustNewConstMetric(c.desc, prometheus.GaugeValue, float64(s6.RxQueueLength), "rx", "v6")
	} else {
		if errors.Is(errIPv6, os.ErrNotExist) {
			c.logger.Debug("not collecting ipv6 based metrics")
		} else {
			return fmt.Errorf("couldn't get udp6 queued bytes: %w", errIPv6)
		}
	}

	if errors.Is(errIPv4, os.ErrNotExist) && errors.Is(errIPv6, os.ErrNotExist) {
		return ErrNoData
	}

View on GitHub (pinned to 17ddd77c59)