linera-io/linera-protocol · error · anyhow

preflight failed for {}: {:?}

Error message

preflight failed for {}: {:?}

What it means

Before measuring, the validator benchmark runs a preflight against the candidate node (connectivity/version probes). If the preflight report's status is `PreflightStatus::Fail` and `--abort-on-preflight-fail` is enabled, the run aborts and embeds the preflight error list, so you can fix the node before wasting a benchmark. The successful version_info from preflight is also recorded in the report metadata.

Source

Thrown at linera-service/src/cli/validator_benchmark/mod.rs:87

                    ended_at: None,
                    duration_secs: None,
                },
                config: serde_json::to_value(self)?,
                chains_tested: self.chain.iter().map(|c| c.to_string()).collect(),
                complete: false,
            },
            layers: Layers::default(),
        };

        // L1 preflight also yields version/network info for the report metadata.
        // When skipped, fetch those two cheap fields best-effort anyway.
        if !self.skip_preflight {
            let outcome = preflight::run(&node, rpc_timeout, &progress).await;
            if self.abort_on_preflight_fail
                && outcome.report.status == report::PreflightStatus::Fail
            {
                progress.clear();
                anyhow::bail!(
                    "preflight failed for {}: {:?}",
                    self.address,
                    outcome.report.errors
                );
            }
            report.metadata.candidate.version_info = outcome.version_info;
            report.metadata.candidate.network_description = outcome.network_description;
            report.layers.preflight = Some(outcome.report);
        } else {
            report.metadata.candidate.version_info =
                rpc::timed(rpc_timeout, node.get_version_info())
                    .await
                    .ok()
                    .map(|v| format!("{v:?}"));
            report.metadata.candidate.network_description =
                rpc::timed(rpc_timeout, node.get_network_description())
                    .await
                    .ok()

View on GitHub (pinned to 6c226ddcb3)

Solutions

  1. Read the errors inside the bail message — they come from the preflight report and name the failing checks
  2. Fix the candidate node (correct address, healthy gRPC, compatible version) and re-run
  3. Pass --skip-preflight to bypass the checks entirely for exploratory runs
  4. If you intentionally benchmark a degraded node, disable --abort-on-preflight-fail so the run continues

Example fix

# before
linera validator benchmark 127.0.0.1:9100 --chain <id> --abort-on-preflight-fail

# after (skip the checks for an exploratory run)
linera validator benchmark 127.0.0.1:9100 --chain <id> --skip-preflight
Defensive patterns

Strategy: fallback

Try / catch

match benchmark::run(&opts).await {
    Err(e) if e.to_string().starts_with("preflight failed") => {
        // node is unhealthy; either fix it or re-run with --skip-preflight
        // when the measurement is still meaningful on a degraded node
        eprintln!("preflight failed; fix the node or pass --skip-preflight");
    }
    result => result?,
}

Prevention

When it happens

Trigger: Running `linera validator benchmark` against a node whose prelight checks fail — unreachable endpoints, version mismatch, failing probes — while `abort_on_preflight_fail` is set (and `skip_preflight` is not).

Common situations: Benchmarking a validator that is still starting up; pointing at the wrong port; version skew between the benchmarking client and the candidate node.

Related errors


AI-assisted analysis of linera-io/linera-protocol@6c226ddcb3 (2026-08-22). Data as JSON: /api/errors/a891ca9118f748d5. Report an issue: GitHub.