{"record":{"id":"adda97d7c0169f77","repo":"jdx/mise","slug":"task-cache-archive-is-missing","errorCode":null,"errorMessage":"task cache archive is missing {}","messagePattern":"task cache archive is missing (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/task_cache.rs","lineNumber":608,"sourceCode":"                .map(|artifact| artifact.path())\n                .ok_or_else(|| eyre!(\"task cache archive is missing\"))?;\n\n            let staging = tempfile::Builder::new()\n                .prefix(\".mise-task-cache-\")\n                .tempdir_in(&self.root)?;\n            file::untar(\n                archive_path,\n                staging.path(),\n                ExtractionFormat::TarZst,\n                &ExtractOptions {\n                    preserve_mtime: false,\n                    ..Default::default()\n                },\n            )?;\n            for rel in &manifest.roots {\n                let restored = staging.path().join(rel);\n                if !restored.exists() && fs::symlink_metadata(&restored).is_err() {\n                    bail!(\"task cache archive is missing {}\", rel.display());\n                }\n                ensure_no_symlink_ancestors(staging.path(), rel)?;\n                ensure_no_symlink_ancestors(&self.root, rel)?;\n            }\n\n            let mut remove = resolve_output_roots(task, &self.root, false)?;\n            remove.extend(manifest.roots.iter().cloned());\n            let remove = remove_nested_roots(remove);\n            for rel in &remove {\n                ensure_no_symlink_ancestors(&self.root, rel)?;\n            }\n            let output_matcher = build_output_matcher(&self.root, &task.outputs.patterns())?;\n            install_transactionally(\n                &self.root,\n                staging.path(),\n                &manifest.roots,\n                &remove,\n                Some(&output_matcher),","sourceCodeStart":590,"sourceCodeEnd":626,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/task/task_cache.rs#L590-L626","documentation":"During cache restore, mise extracts the archive into a staging directory and then checks that every root listed in the manifest actually exists there (including as a symlink). If a declared root is absent after extraction, the archive is considered incomplete and restore fails. This prevents silently proceeding with a partial restore.","triggerScenarios":"Cache restore path in restore(): an entry's archive was extracted but a root from manifest.roots is neither a file/dir nor a symlink at staging/<root>. Caused by truncated/corrupt archives, archives created without all output roots, or manifests that list roots not included at save time.","commonSituations":"Interrupted or partial cache uploads to a remote store; archives pruned by cleanup tooling; outputs config changed so the manifest lists roots the older archive never contained.","solutions":["Delete the bad cache entry and rerun the task so it executes and repopulates the cache.","Clear the task-artifacts cache directory if corruption is widespread.","Verify remote cache uploads are atomic (upload manifest only after the full artifact).","Update the task's outputs to match what the command actually produces, then re-save the cache."],"exampleFix":"// before (manifest lists \"coverage\" but archive only contains \"dist\")\n{\"roots\": [\"dist\", \"coverage\"]}  -> task cache archive is missing coverage\n// after\ntask.outputs = [\"dist\"]  # or fix the archiver, then clear the entry and rerun","handlingStrategy":"fallback","validationCode":"for rel in manifest.roots:\n    if not (staging / rel).exists() and not (staging / rel).is_symlink():\n        print(f\"entry incomplete: {rel}\")  # skip entry, run task","typeGuard":null,"tryCatchPattern":"// on restore failure from missing root, fall back to executing the task\ntry { cache.restore(entry) } catch (e) {\n  if (String(e).startsWith('task cache archive is missing')) { cache.delete(entry); task.run(); }\n  else throw e;\n}","preventionTips":["Upload cache artifacts atomically (manifest only after full archive)","Keep outputs config in sync with what the command actually produces","Avoid external cleanup jobs that prune archive contents selectively"],"tags":["task-cache","archive","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"}