{"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/533346cc374382b41ec5ff70536252b2e96e725c/src/task/task_cache.rs#L1279-L1315","documentation":"When a task cache output is a glob pattern and require_matches is set, resolve_output_roots fails if the glob matched zero files during its walk. mise needs at least one captured artifact to build a cache entry; a pattern matching nothing means the cache would be empty or the build didn't produce expected files.","triggerScenarios":"Running a task whose `outputs` contains a glob like `dist/*.js` where dist/ is empty or doesn't exist, or the pattern is misspelled, at the point where the cache is being populated (save) with require_matches=true.","commonSituations":"Build silently failed before producing artifacts; pattern typo (`build/*.o` vs `out/*.o`); glob doesn't match on case-sensitive filesystems; outputs cleaned before cache save.","solutions":["Run the task's command and verify the files matching the pattern actually exist","Fix the glob pattern to match real paths","If zero matches is legitimate, adjust the outputs declaration or use a non-glob literal path that's checked for existence instead"],"exampleFix":"# before\noutputs = ['dist/**/*.js']\n# after (dir actually produced)\noutputs = ['dist/']","handlingStrategy":"validation","validationCode":"# shell check before relying on the cache\nls dist/*.js 2>/dev/null | head -n1 || echo 'pattern matches nothing'","typeGuard":null,"tryCatchPattern":"if err contains 'matched no files':\n    # build produced nothing; run task verbosely to see why\n    rerun_task_with_verbose_output()","preventionTips":["Run the task once with cache disabled and confirm the pattern matches real files","Keep patterns simple and anchored to directories the build actually writes","Watch for case-sensitivity differences between CI and local"],"tags":["task-cache","glob","file-not-found"],"backgroundTag":"file-not-found","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}