rust-lang/rust · error · anyhow::Error
It is only possible to schedule up to {MAX_TRY_JOBS_COUNT} c
Error message
It is only possible to schedule up to {MAX_TRY_JOBS_COUNT} custom jobs, received {} custom jobs expanded from {} pattern(s) What it means
citool caps the number of jobs a single try build can schedule at MAX_TRY_JOBS_COUNT (= 20, jobs.rs:283). After expanding try-job patterns into concrete auto/optional jobs, if the resulting list length exceeds 20, the error reports both the expanded count and the number of input patterns.
Source
Thrown at src/ci/citool/src/jobs.rs:315
let matched_jobs = db.find_auto_or_optional_jobs_by_pattern(pattern);
if matched_jobs.is_empty() {
unknown_patterns.push(pattern.clone());
} else {
for job in matched_jobs {
if !jobs.iter().any(|j| j.name == job.name) {
jobs.push(job);
}
}
}
}
if !unknown_patterns.is_empty() {
return Err(anyhow::anyhow!(
"Patterns `{}` did not match any auto jobs",
unknown_patterns.join(", ")
));
}
if jobs.len() > MAX_TRY_JOBS_COUNT {
return Err(anyhow::anyhow!(
"It is only possible to schedule up to {MAX_TRY_JOBS_COUNT} custom jobs, received {} custom jobs expanded from {} pattern(s)",
jobs.len(),
patterns.len()
));
}
jobs
} else {
db.try_jobs.clone()
};
(jobs, "try", &db.envs.try_env)
}
RunType::AutoJob => (db.auto_jobs.clone(), "auto", &db.envs.auto_env),
RunType::MainJob => return Ok(vec![]),
};
let jobs = substitute_github_vars(jobs.clone())
.context("Failed to substitute GitHub context variables in jobs")?;
let jobs = skip_jobs(jobs, channel);
let jobs = jobsView on GitHub (pinned to 7088e4b63a)
Solutions
- Narrow the patterns so the expanded set stays within 20 jobs.
- Split the try into multiple runs if you genuinely need more than 20 jobs.
- Replace broad patterns with explicit job names you actually need.
- Remove redundant patterns that expand to overlapping job sets.
Example fix
# before @bors try dist-* # expands to 30 jobs -> error # after @bors try dist-x86_64-unknown-linux-gnu dist-aarch64-unknown-linux-gnu
Defensive patterns
Strategy: validation
Validate before calling
const MAX_TRY_JOBS_COUNT: usize = 20;
fn within_quota(expanded: &[Job]) -> bool { expanded.len() <= MAX_TRY_JOBS_COUNT }
// After expanding patterns, assert within_quota(&jobs) before submitting the try build. Prevention
- Keep try-job pattern expansions under 20 jobs.
- Use explicit job names instead of broad globs.
- Split large try runs into multiple smaller ones.
When it happens
Trigger: Submitting @bors try with one or more patterns that match more than 20 distinct auto/optional jobs (e.g. a broad pattern like '*' or several prefixes that together cover >20 jobs).
Common situations: Using an overly-broad glob to rerun a large slice of CI; accumulating patterns that each match many jobs; trying to rerun the whole matrix.
Related errors
- Patterns `{}` did not match any auto jobs
- duplicate job name `{job_name}` in section `{section}`
- PR job `{}` differs from corresponding Auto job `{}` in conf
- Auto job `{job}` cannot have `continue_on_error: true`. If t
- Cannot get jobs of workflow run {workflow_run_id}: {status}
AI-assisted analysis of rust-lang/rust@7088e4b63a (2026-08-10).
Data as JSON: /api/errors/4f4e5584a4508193.
Report an issue: GitHub.