{"record":{"id":"2f8b888c6a6854ab","repo":"GitoxideLabs/gitoxide","slug":"cannot-run-without-any-task-to-perform-on-the-repo","errorCode":null,"errorMessage":"Cannot run without any task to perform on the repositories","messagePattern":"Cannot run without any task to perform on the repositories","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gitoxide-core/src/corpus/engine.rs","lineNumber":46,"sourceCode":"impl Engine {\n    /// Open the corpus DB or create it.\n    pub fn open_or_create(db: PathBuf, state: State) -> anyhow::Result<Engine> {\n        let con = crate::corpus::db::create(db).context(\"Could not open or create database\")?;\n        Ok(Engine { con, state })\n    }\n\n    /// Run on the existing set of repositories we have already seen or obtain them from `path` if there is none yet.\n    pub fn run(\n        &mut self,\n        corpus_path: PathBuf,\n        threads: Option<usize>,\n        dry_run: bool,\n        repo_sql_suffix: Option<String>,\n        allowed_task_names: Vec<String>,\n    ) -> anyhow::Result<()> {\n        let tasks = self.tasks_or_insert(&allowed_task_names)?;\n        if tasks.is_empty() {\n            bail!(\"Cannot run without any task to perform on the repositories\");\n        }\n        let (corpus_path, corpus_id) = self.prepare_corpus_path(corpus_path)?;\n        let gitoxide_id = self.gitoxide_version_id_or_insert()?;\n        let runner_id = self.runner_id_or_insert()?;\n        let repos = self.find_repos_or_insert(&corpus_path, corpus_id, repo_sql_suffix)?;\n        self.perform_run(&corpus_path, gitoxide_id, runner_id, &tasks, repos, threads, dry_run)\n    }\n\n    pub fn refresh(&mut self, corpus_path: PathBuf) -> anyhow::Result<()> {\n        let (corpus_path, corpus_id) = self.prepare_corpus_path(corpus_path)?;\n        let repos = self.refresh_repos(&corpus_path, corpus_id)?;\n        self.state.progress.set_name(\"refresh repos\".into());\n        self.state.progress.info(format!(\n            \"Added or updated {} repositories under '{corpus_path}'\",\n            repos.len(),\n            corpus_path = corpus_path.display(),\n        ));\n        Ok(())","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gitoxide-core/src/corpus/engine.rs#L28-L64","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\ncorpus::Engine::at(db_path)?.run(corpus_path, threads, dry_run, repo_sql_suffix, vec![])?;\n// after\ncorpus::Engine::at(db_path)?.run(corpus_path, threads, dry_run, repo_sql_suffix, vec![\"leak-check\".into()])?;","handlingStrategy":"validation","validationCode":"if allowed_task_names.is_empty() {\n    eprintln!(\"no tasks given: pass at least one task name, e.g. 'leak-check'\");\n    std::process::exit(2);\n}","typeGuard":null,"tryCatchPattern":"match engine.run(...) {\n    Err(e) if e.to_string().contains(\"without any task\") => eprintln!(\"specify at least one task name\"),\n    other => other?,\n}","preventionTips":["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."],"tags":["cli","empty-input","corpus","git"],"backgroundTag":"empty-required-field","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}