{"record":{"id":"5dab37a8361ac3bd","repo":"netdata/netdata","slug":"enrichment-network-sources-source-name-timeout-m","errorCode":null,"errorMessage":"enrichment.network_sources.{source_name}.timeout must be > 0","messagePattern":"enrichment\\.network_sources\\.(.+?)\\.timeout must be > 0","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/crates/netflow-plugin/src/plugin_config/validation/enrichment.rs","lineNumber":23,"sourceCode":"use std::time::Duration;\n\npub(super) fn validate_enrichment(cfg: &PluginConfig) -> Result<()> {\n    validate_dynamic_routing(cfg)?;\n\n    if cfg.enrichment.classifier_cache_duration < Duration::from_secs(1) {\n        anyhow::bail!(\"enrichment.classifier_cache_duration must be >= 1s\");\n    }\n\n    for (source_name, source_cfg) in &cfg.enrichment.network_sources {\n        if source_cfg.url.trim().is_empty() {\n            anyhow::bail!(\"enrichment.network_sources.{source_name}.url must be non-empty\");\n        }\n        let method = source_cfg.method.trim().to_ascii_uppercase();\n        if method != \"GET\" && method != \"POST\" {\n            anyhow::bail!(\"enrichment.network_sources.{source_name}.method must be GET or POST\");\n        }\n        if source_cfg.timeout.is_zero() {\n            anyhow::bail!(\"enrichment.network_sources.{source_name}.timeout must be > 0\");\n        }\n        if source_cfg.interval.is_zero() {\n            anyhow::bail!(\"enrichment.network_sources.{source_name}.interval must be > 0\");\n        }\n        validate_network_source_tls(source_name, &source_cfg.tls)?;\n        validate_network_source_transform(source_name, &source_cfg.transform)?;\n    }\n\n    for (prefix, value) in &cfg.enrichment.networks {\n        validate_static_network_attributes(prefix, value)?;\n    }\n\n    Ok(())\n}\n\nfn validate_static_network_attributes(prefix: &str, value: &NetworkAttributesValue) -> Result<()> {\n    let NetworkAttributesValue::Attributes(attrs) = value else {\n        return Ok(());","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/netdata/netdata/blob/4864de85e26f6734d92cfc27ccbeff5921f49938/src/crates/netflow-plugin/src/plugin_config/validation/enrichment.rs#L5-L41","documentation":"Each network source's per-request timeout must be strictly positive. A timeout of 0s (or a zero Duration in code-built configs) is rejected at validation because a zero timeout would make every request fail immediately rather than give the endpoint a chance to answer. The {source_name} placeholder identifies which block is at fault.","triggerScenarios":"enrichment.network_sources.<name>.timeout: 0s in config; timeout key present but the YAML duration parser reads it as zero (e.g., a bare '0'); constructing the config struct in Rust with Duration::ZERO.","commonSituations":"Attempting to express 'no timeout' with 0 (use a large value instead); typo like timeout: 0 meaning seconds; duration unit mistakes where the intended value rounds to zero.","solutions":["Set a positive timeout sized to the endpoint's real latency, e.g., 30s","For 'wait as long as needed', set a deliberately large value (e.g., 300s) — zero is not a valid 'unlimited'","In code, ensure Duration::from_secs(n) with n >= 1"],"exampleFix":"# before\nenrichment:\n  network_sources:\n    peers:\n      timeout: 0s\n\n# after\nenrichment:\n  network_sources:\n    peers:\n      timeout: 30s","handlingStrategy":"validation","validationCode":"fn timeouts_ok(cfg: &PluginConfig) -> Result<()> {\n    for (name, s) in &cfg.enrichment.network_sources {\n        anyhow::ensure!(!s.timeout.is_zero(), \"source '{name}' timeout must be > 0\");\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Zero never means 'unlimited' here — use a large positive duration for slow endpoints","Size timeout from measured endpoint latency plus margin"],"tags":["netflow-plugin","config","validation","timeout","network-sources"],"backgroundTag":null,"analyzedSha":"4864de85e26f6734d92cfc27ccbeff5921f49938","analyzedAt":"2026-08-15T09:12:38.226Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}