rust-lang/rust · error · anyhow::Error

Auto job `{job}` cannot have `continue_on_error: true`. If t

Error message

Auto job `{job}` cannot have `continue_on_error: true`. If the job should be optional, name it `optional-{job}`.

What it means

citool's validate_job_database enforces fail-fast on Auto CI: a non-optional Auto job must not set continue_on_error: true (jobs.rs:206-212). Only jobs whose name starts with optional- are permitted to be non-fatal; any other Auto job with continue_on_error: Some(true) is rejected.

Source

Thrown at src/ci/citool/src/jobs.rs:208

            ))
        }
    }

    for pr_job in &db.pr_jobs {
        // At this point, any PR job must also be an Auto job, auto-registered or overridden.
        let auto_job = db
            .find_auto_job_by_name(&pr_job.name)
            .expect("PR job must either be auto-registered as Auto job or overridden");

        equivalent_modulo_carve_out(pr_job, auto_job)?;
    }

    // Auto CI should "fail-fast" to avoid wasting Auto CI resources.
    // However, some experimental auto jobs can be made optional, for example if we are unsure about
    // their flakiness. Those have to be prefixed with `optional-`.
    for auto_job in &db.auto_jobs {
        if auto_job.continue_on_error == Some(true) && !auto_job.name.starts_with("optional-") {
            return Err(anyhow!(
                "Auto job `{job}` cannot have `continue_on_error: true`. If the job should be optional, name it `optional-{job}`.",
                job = auto_job.name
            ));
        }
    }

    Ok(())
}

/// Representation of a job outputted to a GitHub Actions workflow.
#[derive(serde::Serialize, Debug)]
struct GithubActionsJob {
    /// The main identifier of the job, used by CI scripts to determine what should be executed.
    name: String,
    /// Helper label displayed in GitHub Actions interface, containing the job name and a run type
    /// prefix (PR/try/auto).
    full_name: String,
    os: String,

View on GitHub (pinned to 7088e4b63a)

Solutions

  1. Rename the job to start with optional- if it should be non-fatal: optional-{job}.
  2. Remove continue_on_error: true from the Auto job if it must fail-fast.
  3. Move the experimental job into the optional section instead of toggling continue_on_error.

Example fix

# before
auto_jobs:
  - name: x86_64-gnu-experimental
    continue_on_error: true   # error

# after
auto_jobs:
  - name: optional-x86_64-gnu-experimental
    continue_on_error: true
Defensive patterns

Strategy: validation

Validate before calling

fn validate_auto_optional(auto_jobs: &[Job]) -> Result<(), String> {
    for j in auto_jobs {
        if j.continue_on_error == Some(true) && !j.name.starts_with("optional-") {
            return Err(format!("Auto job `{}` cannot have continue_on_error: true; rename to optional-{}", j.name, j.name));
        }
    }
    Ok(())
}

Prevention

When it happens

Trigger: Adding continue_on_error: true to an Auto job whose name does not start with optional- in the CI job config.

Common situations: Trying to make a flaky/experimental Auto job non-fatal without renaming it; copy-pasting an optional job's config onto a regular Auto job.

Related errors


AI-assisted analysis of rust-lang/rust@7088e4b63a (2026-08-10). Data as JSON: /api/errors/a7dea65d967e2892. Report an issue: GitHub.