{"record":{"id":"7c1b759b25484de2","repo":"jdx/mise","slug":"output-does-not-exist","errorCode":null,"errorMessage":"output {} does not exist","messagePattern":"output (.+?) does not exist","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/task_cache.rs","lineNumber":1309,"sourceCode":"                    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}\n\nfn remove_nested_roots(mut roots: Vec<PathBuf>) -> Vec<PathBuf> {\n    roots.sort_by_key(|path| path.components().count());\n    let mut result = Vec::<PathBuf>::new();\n    for root in roots {\n        if !result.iter().any(|parent| root.starts_with(parent)) {\n            result.push(root);\n        }\n    }\n    result.sort();\n    result\n}","sourceCodeStart":1291,"sourceCodeEnd":1327,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/task/task_cache.rs#L1291-L1327","documentation":"For a non-glob (literal) cache output, if the path doesn't exist on disk (neither exists() nor symlink_metadata succeeds) and require_matches is set, mise refuses to build a cache entry around a missing artifact. This catches tasks that claim outputs they never produced.","triggerScenarios":"Task declares `outputs = ['build/app']` but the file was never created, was deleted, or is a broken symlink at the time the cache is saved; the matcher accepted the path but the existence re-check failed.","commonSituations":"Build step failed or was skipped; output removed by a later cleanup step; typo in output path; broken symlink pointing to a nonexistent target.","solutions":["Verify the task command actually creates the declared output and fix the build if not","Correct the output path to match what the task produces","Remove the stale/broken symlink and regenerate the output"],"exampleFix":"# before\noutputs = ['build/app']\n# after (tool writes to out/)\noutputs = ['out/app']","handlingStrategy":"validation","validationCode":"test -e build/app || echo \"declared output build/app missing\"","typeGuard":null,"tryCatchPattern":"if err contains 'does not exist':\n    verify_task_command_ran_and_created_outputs()","preventionTips":["Keep output declarations in sync with the build tool's actual output paths","Avoid cleanup steps that delete outputs before cache save","Check for broken symlinks in output locations"],"tags":["task-cache","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"}