risingwavelabs/risingwave · error · anyhow::Error

no meta server address provided

Error message

no meta server address provided

What it means

In the same endpoint-iteration loop, if the configured meta server address list is empty, MetaClient construction bails with 'no meta server address provided'. It is a configuration error: the client was asked to connect without any candidate endpoints.

Solutions

  1. Set the meta address env var (e.g. RW_META_NODE=... / `--meta-addr`) or config `meta_endpoints` to at least one valid address
  2. Check startup command/config file actually passes the address list to MetaClient::new
  3. In tests, ensure the embedded meta service is started and its address is passed in

Example fix

// before
MetaClient::new(None, Vec::new(), ...).await // -> no meta server address provided
// after
let addrs = std::env::var("RW_META_ADDR")?;
assert!(!addrs.is_empty(), "meta address required");
MetaClient::new(None, addrs.split(',').map(String::from).collect(), ...).await
Defensive patterns

Strategy: validation

Validate before calling

// Before constructing the client:
fn validate_meta_addrs(addrs: &[String]) -> Result<(), String> {
    if addrs.is_empty() { Err("at least one meta server address must be provided".into()) } else { Ok(()) }
}

Prevention

When it happens

Trigger: Constructing MetaClient with an empty `meta_addr` list — e.g. env var RW_META_ADDR/meta endpoints unset or empty, or programmatic construction passing `vec![]`.

Common situations: Missing RUST_LOG-style env config in deployments; config file omits `server.meta_endpoints`; tests forgetting to start an in-memory meta and pass no addresses; k8s service env vars not injected.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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

Appendix: source

Thrown at src/rpc_client/src/meta_client.rs:2657

                    return Ok((channel, addr));
                }
                Err(e) => {
                    tracing::warn!(
                        error = %e.as_report(),
                        "Failed to connect to meta server {}, trying again",
                        addr,
                    );
                    last_error = Some(e);
                }
            }
        }

        if let Some(last_error) = last_error {
            Err(anyhow::anyhow!(last_error)
                .context("failed to connect to all meta servers")
                .into())
        } else {
            bail!("no meta server address provided")
        }
    }

    async fn connect_to_endpoint(endpoint: Endpoint) -> Result<Channel> {
        let channel = endpoint
            .http2_keep_alive_interval(Duration::from_secs(Self::ENDPOINT_KEEP_ALIVE_INTERVAL_SEC))
            .keep_alive_timeout(Duration::from_secs(Self::ENDPOINT_KEEP_ALIVE_TIMEOUT_SEC))
            .connect_timeout(Duration::from_secs(5))
            .monitored_connect("grpc-meta-client", Default::default())
            .await?
            .wrapped();

        Ok(channel)
    }

    pub(crate) fn retry_strategy_to_bound(
        high_bound: Duration,
        exceed: bool,

View on GitHub (pinned to 6469eb736d)