{"record":{"id":"d1388d609bad6331","repo":"jdx/mise","slug":"output-pattern-output-matched-no-files","errorCode":null,"errorMessage":"output pattern {output:?} matched no files","messagePattern":"output pattern (.+?) matched no files","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/task_cache.rs","lineNumber":1297,"sourceCode":"                for entry in glob_walk(&root.join(expanded), false)? {\n                    let path = match entry {\n                        Ok(entry) => entry.into_path(),\n                        Err(err) => match symlink_walk_error_path(&err) {\n                            Some(path) => path.to_path_buf(),\n                            None => return Err(err.into()),\n                        },\n                    };\n                    glob_matched = true;\n                    let rel = path.strip_prefix(root)?.to_path_buf();\n                    ensure_safe_relative(&rel)?;\n                    let is_dir = fs::symlink_metadata(&path)?.is_dir();\n                    if is_output(&matcher, &path, is_dir) {\n                        resolved.insert(rel);\n                    }\n                }\n            }\n            if require_matches && !glob_matched {\n                bail!(\"output pattern {output:?} matched no files\");\n            }\n        } else {\n            let rel = PathBuf::from(&output);\n            let abs = root.join(&rel);\n            let is_dir = fs::symlink_metadata(&abs)\n                .map(|metadata| metadata.is_dir())\n                .unwrap_or(false);\n            if !is_output(&matcher, &abs, is_dir) {\n                continue;\n            }\n            if require_matches && !abs.exists() && fs::symlink_metadata(&abs).is_err() {\n                bail!(\"output {} does not exist\", rel.display());\n            }\n            resolved.insert(rel);\n        }\n    }\n    Ok(resolved.into_iter().collect())\n}","sourceCodeStart":1279,"sourceCodeEnd":1315,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/task/task_cache.rs#L1279-L1315","documentation":"When resolving output roots with require_matches, each positive output glob pattern must match at least one existing file (or be a valid literal path). If a glob matches nothing, mise treats the cache config as invalid rather than silently caching an empty artifact.","triggerScenarios":"An outputs pattern like \"build/*.zip\" is validated (validation path calls resolve_output_roots with require_matches = true) but no files on disk match — the glob is wrong, or the output-producing step hasn't run yet during validation.","commonSituations":"Typos in glob patterns or wrong directory names; declaring outputs for files only produced in CI but validating locally; outputs that depend on a build step never executed; case-sensitive filename mismatches on Linux.","solutions":["Fix the glob so it matches actual files produced by the task (verify with ls the matching files exist)","Run the task's output-producing command before validation, or only validate after a build","Remove outputs patterns for artifacts the task no longer produces","Check for case sensitivity/platform path differences in the pattern"],"exampleFix":"# before\noutputs = [\"build/bin/app-linux\"]\n# after\noutputs = [\"build/bin/app\"]  # matches the actually produced binary","handlingStrategy":"validation","validationCode":"let matches: Vec<_> = glob(pattern)?\n    .filter_map(Result::ok)\n    .collect();\nif matches.is_empty() {\n    return Err(format!(\"output pattern {pattern:?} matches no files\"));\n}","typeGuard":"fn pattern_matches_files(pattern: &str) -> bool {\n    glob::glob(pattern).map(|it| it.count() > 0).unwrap_or(false)\n}","tryCatchPattern":null,"preventionTips":["Verify each output glob matches real files after running the task","Keep outputs in sync with what the task actually produces","Beware case-sensitivity and platform path differences in globs"],"tags":["config","glob","mise-tasks"],"backgroundTag":"resource-not-found","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"}