databendlabs/databend · error

no metasrv running on

Error message

no metasrv running on: {}

What it means

Before exporting data over gRPC, export_from_grpc probes candidate addresses with is_service_running. If none of the provided endpoints have a running metasrv, get_available_socket_addr returns 'no metasrv running on: {endpoint}'.

Solutions

  1. Confirm metasrv is running: curl its /v1/health admin endpoint or check process status
  2. Pass the correct grpc_api_address (not the admin address) to metactl
  3. Check network connectivity and firewall rules between metactl and the meta nodes

Example fix

// before
metactl --grpc-api-address 127.0.0.1:9191 --export-from-running-node  # node not there
// after
metactl --grpc-api-address 127.0.0.1:9191  # ensure config grpc_api_address matches and node is up
Defensive patterns

Strategy: validation

Validate before calling

nc -z <host> <grpc-port> && echo 'grpc port open' || echo 'no metasrv listening'

Try / catch

match export_from_running_node(addr).await {
    Err(e) if e.to_string().contains("no metasrv running") => eprintln!("start metasrv or fix --grpc-api-address"),
    other => other,
}

Prevention

When it happens

Trigger: Running `metactl --export-from-running-node` (or grpc export) where every address in the configured grpc_api_address list fails the service-running check.

Common situations: Metasrv cluster is down or restarting; wrong gRPC API address/port passed to metactl; checking the admin address instead of the gRPC address; firewalls blocking the probe.

Understand the failure class

Background: ECONNREFUSED and "connection refused" / "could not connect to server" errors: what they mean and how to fix them — this error's family across 44 libraries.

Related errors


AI-assisted analysis of databendlabs/databend@288d84d76e (2026-09-11). Data as JSON: /api/errors/5a0574cd02c3cbf8. Report an issue: GitHub.

Appendix: source

Thrown at src/meta/control/src/export_from_grpc.rs:63

/// if port is open, service is running
async fn is_service_running(addr: SocketAddr) -> Result<bool, io::Error> {
    let socket = TcpSocket::new_v4()?;
    let stream = socket.connect(addr).await;

    Ok(stream.is_ok())
}

/// try to get available grpc api socket address
async fn get_available_socket_addr(endpoint: &str) -> Result<SocketAddr, anyhow::Error> {
    let addrs_iter = endpoint.to_socket_addrs()?;
    for addr in addrs_iter {
        if is_service_running(addr).await? {
            return Ok(addr);
        }
        eprintln!("WARN: {} is not available", addr);
    }
    Err(anyhow!("no metasrv running on: {}", endpoint))
}

pub async fn export_from_grpc(
    addr: &str,
    save: String,
    chunk_size: Option<u64>,
) -> anyhow::Result<()> {
    let client = MetaGrpcClient::<DatabendRuntime>::try_create_with_features(
        vec![addr.to_string()],
        "root",
        "xxx",
        None,
        None,
        None,
        DEFAULT_GRPC_MESSAGE_SIZE,
    )?;

    let mut grpc_client = client.make_established_client().await?;

View on GitHub (pinned to 288d84d76e)