GitoxideLabs/gitoxide · error
Cannot run without any task to perform on the repositories
Error message
Cannot run without any task to perform on the repositories
What it means
gitoxide-core's corpus `run` engine bails out when the resolved task list is empty. Tasks are looked up via `tasks_or_insert(&allowed_task_names)`; if no task names were supplied (or none matched) there is nothing to execute, so the function refuses to run rather than silently performing a no-op run that would still mutate corpus metadata.
Solutions
- Pass one or more valid task names in `allowed_task_names` (e.g. `gix corpus run <path> <task>...`).
- Check the spelling of the task name against tasks already registered in the corpus (query the corpus SQLite DB or list tasks).
- If scripting, ensure the task-name variable is non-empty before invoking run.
- Insert the desired tasks into the corpus first (`gix corpus insert` workflow) if none exist.
Example fix
// before corpus::Engine::at(db_path)?.run(corpus_path, threads, dry_run, repo_sql_suffix, vec![])?; // after corpus::Engine::at(db_path)?.run(corpus_path, threads, dry_run, repo_sql_suffix, vec!["leak-check".into()])?;
Defensive patterns
Strategy: validation
Validate before calling
if allowed_task_names.is_empty() {
eprintln!("no tasks given: pass at least one task name, e.g. 'leak-check'");
std::process::exit(2);
} Try / catch
match engine.run(...) {
Err(e) if e.to_string().contains("without any task") => eprintln!("specify at least one task name"),
other => other?,
} Prevention
- Always pass task names explicitly to `corpus run`; never build the vec from an unset shell variable.
- Validate CLI arguments (non-empty task list) before calling the engine.
- Keep a canonical list of registered task names in scripts to avoid typos.
When it happens
Trigger: Calling `gitoxide_core::corpus::Engine::run` (or the CLI `gix corpus run`) with an empty `allowed_task_names` vec, or with task names that match no existing tasks in the corpus database, so `tasks_or_insert` returns an empty set.
Common situations: Typing a misspelled task name on the CLI, forgetting the task-name argument entirely, scripting `gix corpus run` with a variable that expands to an empty string, or a fresh corpus where no tasks have been inserted yet.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- No commits to process
- At least one operation failed
- Refusing to checkout index into existing directory
- Cannot print information using 'human' format.
- JSON output isn't supported
AI-assisted analysis of GitoxideLabs/gitoxide@e73179060b (2026-09-08).
Data as JSON: /api/errors/2f8b888c6a6854ab.
Report an issue: GitHub.
Appendix: source
Thrown at gitoxide-core/src/corpus/engine.rs:46
impl Engine {
/// Open the corpus DB or create it.
pub fn open_or_create(db: PathBuf, state: State) -> anyhow::Result<Engine> {
let con = crate::corpus::db::create(db).context("Could not open or create database")?;
Ok(Engine { con, state })
}
/// Run on the existing set of repositories we have already seen or obtain them from `path` if there is none yet.
pub fn run(
&mut self,
corpus_path: PathBuf,
threads: Option<usize>,
dry_run: bool,
repo_sql_suffix: Option<String>,
allowed_task_names: Vec<String>,
) -> anyhow::Result<()> {
let tasks = self.tasks_or_insert(&allowed_task_names)?;
if tasks.is_empty() {
bail!("Cannot run without any task to perform on the repositories");
}
let (corpus_path, corpus_id) = self.prepare_corpus_path(corpus_path)?;
let gitoxide_id = self.gitoxide_version_id_or_insert()?;
let runner_id = self.runner_id_or_insert()?;
let repos = self.find_repos_or_insert(&corpus_path, corpus_id, repo_sql_suffix)?;
self.perform_run(&corpus_path, gitoxide_id, runner_id, &tasks, repos, threads, dry_run)
}
pub fn refresh(&mut self, corpus_path: PathBuf) -> anyhow::Result<()> {
let (corpus_path, corpus_id) = self.prepare_corpus_path(corpus_path)?;
let repos = self.refresh_repos(&corpus_path, corpus_id)?;
self.state.progress.set_name("refresh repos".into());
self.state.progress.info(format!(
"Added or updated {} repositories under '{corpus_path}'",
repos.len(),
corpus_path = corpus_path.display(),
));
Ok(())View on GitHub (pinned to e73179060b)