risingwavelabs/risingwave · error · MetaAddressStrategyParseError

failed to parse meta address `{1}`: {0}

Error message

failed to parse meta address `{1}`: {0}

What it means

RisingWave's meta address parser validates each entry in the comma-separated meta address list as an HTTP URL. `UrlParse(InvalidUri, String)` wraps the underlying `http::uri::InvalidUri` produced by the `http` crate together with the offending address string, so the message shows both the cause and which address failed.

Source

Thrown at src/common/src/util/meta_addr.rs:38

const META_ADDRESS_LOAD_BALANCE_MODE_PREFIX: &str = "load-balance+";

/// The strategy for meta client to connect to meta node.
///
/// Used in the command line argument `--meta-address`.
#[derive(Debug, Eq, PartialEq, Clone)]
pub enum MetaAddressStrategy {
    LoadBalance(http::Uri),
    List(Vec<http::Uri>),
}

/// Error type for parsing meta address strategy.
#[derive(thiserror::Error, Debug, thiserror_ext::ContextInto)]
pub enum MetaAddressStrategyParseError {
    #[error("empty meta addresses")]
    Empty,
    #[error("there should be only one load balance address")]
    MultipleLoadBalance,
    #[error("failed to parse meta address `{1}`: {0}")]
    UrlParse(#[source] http::uri::InvalidUri, String),
}

impl FromStr for MetaAddressStrategy {
    type Err = MetaAddressStrategyParseError;

    fn from_str(meta_addr: &str) -> Result<Self, Self::Err> {
        if let Some(addr) = meta_addr.strip_prefix(META_ADDRESS_LOAD_BALANCE_MODE_PREFIX) {
            // UFCS pins this to `itertools::Itertools::exactly_one`; a future
            // stabilization of `Iterator::exactly_one` (rust#48919) would otherwise
            // make the bare method call ambiguous / silently rebind.
            let addr = Itertools::exactly_one(addr.split(','))
                .map_err(|_| MetaAddressStrategyParseError::MultipleLoadBalance)?;

            let uri = addr.parse().into_url_parse(addr)?;

            Ok(Self::LoadBalance(uri))
        } else {

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Prefix the address with a valid scheme: `http://host:port` (or https if configured)
  2. Remove whitespace around addresses in the comma-separated list
  3. Fix malformed host/port/IPv6 syntax (bracket IPv6 literals: `http://[::1]:5690`)
  4. Check the inner `InvalidUri` message printed after the colon for the exact URL defect

Example fix

// before
--meta-address "meta-node-0:5690"
// after
--meta-address "http://meta-node-0:5690"
Defensive patterns

Strategy: validation

Validate before calling

// validate each address is a parseable absolute http URI before passing it on
for addr in raw.split(',').map(str::trim).filter(|s| !s.is_empty()) {
    if !(addr.starts_with("http://") || addr.starts_with("https://")) {
        return Err(format!("meta address `{addr}` needs an http:// or https:// scheme"));
    }
}

Prevention

When it happens

Trigger: Passing an address that is not a valid http URI, e.g. `meta:5690` missing the scheme, `http:/missing-slash`, `http://[bad-ipv6`, an address with stray spaces `http://node1 , http://node2`, or a hostname with illegal characters.

Common situations: Omitting the `http://` scheme when copying endpoints, hostnames containing underscores or ports with typos (`http://meta-node:569o`), environment templates that inject extra whitespace, IPv6 addresses not bracketed correctly.

Understand the failure class

Background: "Invalid URL" errors: why new URL(), URI.parse, and reqwest::Url reject your string — missing scheme, whitespace, and bad path format — this error's family across 39 libraries.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/f70d69b3e0fcf4e0. Report an issue: GitHub.