{"record":{"id":"6fe6f35bf57793f2","repo":"jdx/mise","slug":"task-cache-command-input-must-not-be-empty-co-6fe6f3","errorCode":null,"errorMessage":"task {} cache command input must not be empty: {command:?}","messagePattern":"task (.+?) cache command input must not be empty: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/task_executor.rs","lineNumber":1423,"sourceCode":"            sandbox.filter_env(resolved_env)\n        } else {\n            resolved_env.clone()\n        };\n        let timeout = task\n            .timeout\n            .as_ref()\n            .and_then(|value| match duration::parse_duration(value) {\n                Ok(timeout) => Some(timeout),\n                Err(err) => {\n                    warn!(\"invalid timeout {:?} for task {}: {err}\", value, task.name);\n                    None\n                }\n            })\n            .unwrap_or(COMMAND_INPUT_TIMEOUT);\n        let mut inputs = Vec::with_capacity(cache.command_inputs.len());\n        for command in &cache.command_inputs {\n            if command.trim().is_empty() {\n                eyre::bail!(\n                    \"task {} cache command input must not be empty: {command:?}\",\n                    task.name\n                );\n            }\n            let (program, args, cmd_verbatim) =\n                self.get_cmd_program_and_args(command, task, &[])?;\n            // The same refusal as in `exec_program`, and it matters more here: these commands feed\n            // the cache key, so running them from C:\\Windows would hash the wrong directory's\n            // answer. Measured on 2026.8.6 with the project on a UNC share — a `command_inputs`\n            // entry reading a file that exists in the project fails, while the same config on a\n            // local path succeeds. `--dry-run` does not reach here (see the cache branch in\n            // `run_task`), so there is nothing to exempt.\n            #[cfg(windows)]\n            if cmd_shell_cannot_use_dir(&program, &root) {\n                eyre::bail!(\"{}\", unc_working_dir_error(&root));\n            }\n            #[cfg(not(windows))]\n            let _ = cmd_verbatim;","sourceCodeStart":1405,"sourceCodeEnd":1441,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/task/task_executor.rs#L1405-L1441","documentation":"When computing/verifying a task's cache, mise re-derives command inputs from the task's cache.command_inputs entries. Each entry is treated as a command string; a blank or whitespace-only entry cannot produce a meaningful program/args pair, so mise fails the task naming the offending entry rather than silently ignoring it.","triggerScenarios":"A task defines cache.command_inputs containing \"\", \"   \", or a tabs/newlines-only string; running the task (not under --dry-run) reaches task_executor.rs:1423 and bails on that entry.","commonSituations":"TOML like command_inputs = [\"\", \"Cargo.lock\"] from copy-paste; a template/variable that evaluates to an empty string inside an entry; a programmatically built list with an empty element.","solutions":["Remove the empty entry from cache.command_inputs in the task definition","Fix the variable/template inside the entry that resolves to an empty string","Filter blank strings at generation time if the list is built programmatically","Re-run the task after cleaning the config"],"exampleFix":"# before\n[tasks.build.cache]\ncommand_inputs = [\"\", \"Cargo.lock\"]\n# after\n[tasks.build.cache]\ncommand_inputs = [\"Cargo.lock\"]","handlingStrategy":"validation","validationCode":"const cmds = (config.cache?.command_inputs ?? []).map(c => c.trim());\nconst bad = cmds.findIndex(c => c === \"\");\nif (bad !== -1) throw new Error(`command_inputs[${bad}] is empty`);","typeGuard":"fn non_blank(s: &&str) -> bool { !s.trim().is_empty() }\n// let valid: Vec<_> = command_inputs.iter().filter(non_blank).collect();","tryCatchPattern":"try {\n  await miseRun([\"build\"]);\n} catch (e) {\n  if (String(e).includes(\"cache command input must not be empty\")) {\n    console.error(\"Fix cache.command_inputs in mise.toml: remove blank entries\");\n  }\n  throw e;\n}","preventionTips":["Audit cache.command_inputs for blank entries after editing mise.toml","Filter empty strings when building the list from variables/templates","Use templates with defaults inside entries","Lint task configs in CI before running"],"tags":["task","cache","config","validation"],"backgroundTag":"empty-required-field","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}