netdata/netdata · error

listener.max_packet_size must be greater than 0

Error message

listener.max_packet_size must be greater than 0

What it means

The Netdata netflow plugin rejects its listener configuration when max_packet_size is 0. This check runs in validate_listener_and_protocols() before the plugin starts, because a zero-size receive buffer would make every UDP/TCP read a no-op. The value is expected to come from the plugin's YAML/JSON config as a positive byte count.

Source

Thrown at src/crates/netflow-plugin/src/plugin_config/validation/listener.rs:8

use crate::plugin_config::PluginConfig;
use anyhow::{Context, Result};
use std::collections::HashSet;
use std::net::SocketAddr;

pub(super) fn validate_listener_and_protocols(cfg: &PluginConfig) -> Result<()> {
    if cfg.listener.max_packet_size == 0 {
        anyhow::bail!("listener.max_packet_size must be greater than 0");
    }

    if cfg.listener.listen.is_empty() {
        anyhow::bail!("listener.listen must contain at least one address");
    }

    let mut seen = HashSet::new();
    for listen in &cfg.listener.listen {
        let addr = listen
            .parse::<SocketAddr>()
            .with_context(|| format!("invalid listener address: {}", listen))?;
        if !seen.insert(addr) {
            anyhow::bail!("listener.listen contains duplicate address: {}", addr);
        }
    }

    if !(cfg.protocols.v5
        || cfg.protocols.v7

View on GitHub (pinned to 4864de85e2)

Solutions

  1. Open the netflow plugin config and set listener.max_packet_size to a positive byte value (e.g. 16384 or larger for IPFIX v9 templates)
  2. If the field was omitted, add it explicitly under the 'listener:' section
  3. Check the stock config shipped with the plugin for the recommended default and mirror it
  4. Verify no environment variable or generator overrides the value back to 0

Example fix

# before
listener:
  max_packet_size: 0

# after
listener:
  max_packet_size: 65536
Defensive patterns

Strategy: validation

Validate before calling

// Before building/starting the plugin:
fn listener_precheck(cfg: &PluginConfig) -> Result<(), String> {
    if cfg.listener.max_packet_size == 0 {
        return Err("listener.max_packet_size must be > 0".into());
    }
    Ok(())
}

Try / catch

In Rust, treat the anyhow::Result from validate_listener_and_protocols() as fatal config error: log error.chain() and abort startup; do not retry — the config must change.

Prevention

When it happens

Trigger: Calling validate_listener_and_protocols(&PluginConfig) with cfg.listener.max_packet_size == 0. Happens when the user sets 'max_packet_size: 0' in the netflow plugin config file, or omits it and the deserializer defaults it to 0 (no serde default of a positive value).

Common situations: Copy-pasting a minimal example config that omits listener settings; explicitly setting 0 while trying to mean 'unlimited/default'; editing config after an upgrade that introduced the field without a default.

Related errors


AI-assisted analysis of netdata/netdata@4864de85e2 (2026-08-15). Data as JSON: /api/errors/0c757473e1d292f9. Report an issue: GitHub.