{"record":{"id":"c1eae6e44c2ceb94","repo":"netdata/netdata","slug":"enrichment-network-sources-source-name-url-must","errorCode":null,"errorMessage":"enrichment.network_sources.{source_name}.url must be non-empty","messagePattern":"enrichment\\.network_sources\\.(.+?)\\.url must be non-empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/crates/netflow-plugin/src/plugin_config/validation/enrichment.rs","lineNumber":16,"sourceCode":"use crate::network_sources::compile_jaq_filter;\nuse crate::plugin_config::{NetworkAttributesValue, PluginConfig, RemoteNetworkSourceTlsConfig};\nuse anyhow::{Context, Result};\nuse std::net::SocketAddr;\nuse 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    }","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/netdata/netdata/blob/4864de85e26f6734d92cfc27ccbeff5921f49938/src/crates/netflow-plugin/src/plugin_config/validation/enrichment.rs#L1-L34","documentation":"Each entry under enrichment.network_sources must declare a non-empty url after trimming. An entry with a missing, blank, or whitespace-only url fails validation at startup. The error names the offending source via the {source_name} interpolation so multi-source configs point at the right block.","triggerScenarios":"Declaring enrichment.network_sources.myname with method/interval but no url; url: \"\" or url: \"   \"; YAML key typo like uri: that silently leaves url unset while the struct default is empty.","commonSituations":"Copy-pasted source block missing the url line; key renamed by a config refactor; template placeholder never filled in (url: \"\").","solutions":["Set a complete url including scheme, host, and path, e.g., https://api.example.net/v1/prefixes","Verify the key is exactly 'url' — a typo'd key is silently ignored and leaves url empty","Remove the whole source block if the source is not meant to be configured","Check rendered config if generated by templates — the placeholder may not have been substituted"],"exampleFix":"# before\nenrichment:\n  network_sources:\n    peers:\n      method: GET\n      interval: 1h\n\n# after\nenrichment:\n  network_sources:\n    peers:\n      url: https://api.example.net/v1/peers\n      method: GET\n      interval: 1h","handlingStrategy":"validation","validationCode":"fn network_source_urls_ok(cfg: &PluginConfig) -> Result<()> {\n    for (name, s) in &cfg.enrichment.network_sources {\n        anyhow::ensure!(!s.url.trim().is_empty(), \"source '{name}' needs a non-empty url\");\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Key name must be exactly 'url' — typo'd keys silently default to empty","Require a url line in every network_sources block in config templates"],"tags":["netflow-plugin","config","validation","network-sources","enrichment"],"backgroundTag":null,"analyzedSha":"4864de85e26f6734d92cfc27ccbeff5921f49938","analyzedAt":"2026-08-15T09:12:38.226Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}