quickwit-oss/quickwit · error

no server currently available

Error message

no server currently available

What it means

Emitted by generated code (quickwit-codegen) in the `check_connectivity` method of the gRPC client adapter. The adapter tracks connected server addresses in `connection_addrs_rx`; when that list is empty there is no gRPC server to route requests to, so the adapter refuses calls with this error instead of failing at channel establishment time.

Source

Thrown at quickwit/quickwit-codegen/src/codegen.rs:1252

        };
        methods.extend(method);
    }
    (bounds, methods)
}

fn generate_grpc_client_adapter(context: &CodegenContext) -> TokenStream {
    let service_name = &context.service_name;
    let service_name_string = service_name.to_string();
    let grpc_client_package_name = &context.grpc_client_package_name;
    let grpc_client_package_name_string = &context.package_name.to_string();
    let grpc_client_name = &context.grpc_client_name;
    let grpc_client_adapter_name = &context.grpc_client_adapter_name;
    let grpc_server_adapter_methods = generate_grpc_client_adapter_methods(context);
    let extra_grpc_server_adapter_methods = if context.generate_extra_service_methods {
        quote! {
            async fn check_connectivity(&self) -> anyhow::Result<()> {
                if self.connection_addrs_rx.borrow().is_empty() {
                    anyhow::bail!("no server currently available")
                }
                Ok(())
            }

            fn endpoints(&self) -> Vec<quickwit_common::uri::Uri> {
                self.connection_addrs_rx
                    .borrow()
                    .iter()
                    .flat_map(|addr| quickwit_common::uri::Uri::from_str(&format!("grpc://{addr}/{}.{}", #grpc_client_package_name_string, #service_name_string)))
                    .collect()
            }
        }
    } else {
        TokenStream::new()
    };

    quote! {
        #[derive(Debug, Clone)]

View on GitHub (pinned to a39730c5cd)

Solutions

  1. Verify the target Quickwit service is running and its gRPC port is reachable (`grpc_listen_addr`), then wait for the client to observe it.
  2. Check the node's cluster configuration/seed addresses so the client discovers at least one server; fix peer/advertise settings if peers never join.
  3. Retry with backoff — transient during startup until `connection_addrs_rx` is populated.
  4. If the client is constructed manually, ensure the connection watcher/`connection_addrs_rx` is fed with server addresses.

Example fix

// before: calling immediately after client creation, before any server is known
let result = search_service.root_search(...).await; // may fail: no server currently available
// after: wait for at least one server before calling
while client.check_connectivity().await.is_err() {
    tokio::time::sleep(Duration::from_millis(250)).await;
}
let result = search_service.root_search(...).await;
Defensive patterns

Strategy: retry

Validate before calling

// Check server availability before the request
if client.check_connectivity().await.is_err() {
    tokio::time::sleep(Duration::from_millis(500)).await; // wait for discovery
}

Try / catch

let mut attempts = 0;
loop {
    match client.check_connectivity().await {
        Ok(()) => break,
        Err(e) if e.to_string().contains("no server currently available") && attempts < 10 => {
            attempts += 1;
            tokio::time::sleep(Duration::from_millis(500 * attempts)).await;
        }
        Err(e) => return Err(e),
    }
}

Prevention

When it happens

Trigger: Calling `check_connectivity()` or any service method on a generated gRPC client (e.g. GrpcSearchServiceAdapter) when no server address has ever been registered or all registered servers have disconnected (the watcher drained `connection_addrs_rx`).

Common situations: Quickwit started as a searcher-only node with no local gRPC services, the target server process is down or still booting, cluster topology changed and the client's server watch observed all peers leaving, or misconfigured chitchat/gRPC ports.

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 quickwit-oss/quickwit@a39730c5cd (2026-09-08). Data as JSON: /api/errors/bbed5b6ae1d27b73. Report an issue: GitHub.