{"record":{"id":"b489f89cbc5dd4aa","repo":"risingwavelabs/risingwave","slug":"empty-meta-addresses","errorCode":null,"errorMessage":"empty meta addresses","messagePattern":"empty meta addresses","errorType":"validation","errorClass":"MetaAddressStrategyParseError","httpStatus":null,"severity":"error","filePath":"src/common/src/util/meta_addr.rs","lineNumber":34,"sourceCode":"use std::str::FromStr;\n\nuse itertools::Itertools;\n\nconst META_ADDRESS_LOAD_BALANCE_MODE_PREFIX: &str = \"load-balance+\";\n\n/// The strategy for meta client to connect to meta node.\n///\n/// Used in the command line argument `--meta-address`.\n#[derive(Debug, Eq, PartialEq, Clone)]\npub enum MetaAddressStrategy {\n    LoadBalance(http::Uri),\n    List(Vec<http::Uri>),\n}\n\n/// Error type for parsing meta address strategy.\n#[derive(thiserror::Error, Debug, thiserror_ext::ContextInto)]\npub enum MetaAddressStrategyParseError {\n    #[error(\"empty meta addresses\")]\n    Empty,\n    #[error(\"there should be only one load balance address\")]\n    MultipleLoadBalance,\n    #[error(\"failed to parse meta address `{1}`: {0}\")]\n    UrlParse(#[source] http::uri::InvalidUri, String),\n}\n\nimpl FromStr for MetaAddressStrategy {\n    type Err = MetaAddressStrategyParseError;\n\n    fn from_str(meta_addr: &str) -> Result<Self, Self::Err> {\n        if let Some(addr) = meta_addr.strip_prefix(META_ADDRESS_LOAD_BALANCE_MODE_PREFIX) {\n            // UFCS pins this to `itertools::Itertools::exactly_one`; a future\n            // stabilization of `Iterator::exactly_one` (rust#48919) would otherwise\n            // make the bare method call ambiguous / silently rebind.\n            let addr = Itertools::exactly_one(addr.split(','))\n                .map_err(|_| MetaAddressStrategyParseError::MultipleLoadBalance)?;\n","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/common/src/util/meta_addr.rs#L16-L52","documentation":"`MetaAddressStrategy::from_str` in RisingWave's util crate parses a meta-node address list (comma-separated URLs from config/CLI) into an addressing strategy. `MetaAddressStrategyParseError::Empty` is returned when the supplied list contains no addresses at all (empty or blank string, or nothing left after splitting). The meta client cannot start without at least one meta node address.","triggerScenarios":"Setting `--meta-address` (or the `META_ADDRESS` env var / config field) to an empty string, a string of only whitespace/commas (e.g. \",,\", \" \"), or passing an empty vector-equivalent on the meta client builder.","commonSituations":"Misconfigured Kubernetes/launcher env where the meta service DNS list resolves to empty, a truncated YAML/CLI flag (`--meta-address \"\"`), or scripts that interpolate an unset variable into the flag value.","solutions":["Provide at least one valid meta node URL, e.g. `--meta-address http://127.0.0.1:5690`","If using an env var or template, ensure the variable is set before interpolation (e.g. `${META_NODES:-http://meta:5690}`)","Strip stray commas/whitespace from the address list before passing it","If only one load-balanced address is intended, make sure it is a real URL, not an empty placeholder"],"exampleFix":"// before\n./risingwave meta-node --meta-address \"\"\n// after\n./risingwave meta-node --meta-address http://127.0.0.1:5690","handlingStrategy":"validation","validationCode":"// before parsing the meta address list\nlet raw = std::env::var(\"META_ADDRESS\").unwrap_or_default();\nlet addrs: Vec<&str> = raw.split(',').map(str::trim).filter(|s| !s.is_empty()).collect();\nif addrs.is_empty() {\n    return Err(\"META_ADDRESS must contain at least one http://host:port entry\");\n}\n","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass at least one explicit `http://host:port` meta address at startup","Default unset env vars to a known-good meta endpoint in deployment templates","Trim whitespace and empty entries from comma-separated lists before use","Validate config in CI/helm templates so empty META_ADDRESS fails before rollout"],"tags":["risingwave","config","meta-node","empty-address-list"],"backgroundTag":"empty-required-field","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}