{"record":{"id":"0c757473e1d292f9","repo":"netdata/netdata","slug":"listener-max-packet-size-must-be-greater-than-0","errorCode":null,"errorMessage":"listener.max_packet_size must be greater than 0","messagePattern":"listener\\.max_packet_size must be greater than 0","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/crates/netflow-plugin/src/plugin_config/validation/listener.rs","lineNumber":8,"sourceCode":"use crate::plugin_config::PluginConfig;\nuse anyhow::{Context, Result};\nuse std::collections::HashSet;\nuse std::net::SocketAddr;\n\npub(super) fn validate_listener_and_protocols(cfg: &PluginConfig) -> Result<()> {\n    if cfg.listener.max_packet_size == 0 {\n        anyhow::bail!(\"listener.max_packet_size must be greater than 0\");\n    }\n\n    if cfg.listener.listen.is_empty() {\n        anyhow::bail!(\"listener.listen must contain at least one address\");\n    }\n\n    let mut seen = HashSet::new();\n    for listen in &cfg.listener.listen {\n        let addr = listen\n            .parse::<SocketAddr>()\n            .with_context(|| format!(\"invalid listener address: {}\", listen))?;\n        if !seen.insert(addr) {\n            anyhow::bail!(\"listener.listen contains duplicate address: {}\", addr);\n        }\n    }\n\n    if !(cfg.protocols.v5\n        || cfg.protocols.v7","sourceCodeStart":1,"sourceCodeEnd":26,"githubUrl":"https://github.com/netdata/netdata/blob/4864de85e26f6734d92cfc27ccbeff5921f49938/src/crates/netflow-plugin/src/plugin_config/validation/listener.rs#L1-L26","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["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)","If the field was omitted, add it explicitly under the 'listener:' section","Check the stock config shipped with the plugin for the recommended default and mirror it","Verify no environment variable or generator overrides the value back to 0"],"exampleFix":"# before\nlistener:\n  max_packet_size: 0\n\n# after\nlistener:\n  max_packet_size: 65536","handlingStrategy":"validation","validationCode":"// Before building/starting the plugin:\nfn listener_precheck(cfg: &PluginConfig) -> Result<(), String> {\n    if cfg.listener.max_packet_size == 0 {\n        return Err(\"listener.max_packet_size must be > 0\".into());\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"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.","preventionTips":["Keep a stock config as the base and only override values you understand","Add a CI config lint that rejects zero-valued listener.max_packet_size","Document that 0 never means 'unlimited' for this field"],"tags":["rust","netdata","netflow","config","validation"],"backgroundTag":null,"analyzedSha":"4864de85e26f6734d92cfc27ccbeff5921f49938","analyzedAt":"2026-08-15T09:12:38.226Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}