{"record":{"id":"68b92f87c0fbf0d4","repo":"Hmbown/CodeWhale","slug":"installed-package-failed-content-digest-validation","errorCode":null,"errorMessage":"installed package failed content digest validation: {err}","messagePattern":"installed package failed content digest validation: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/tui/src/skills/install.rs","lineNumber":382,"sourceCode":"                format!(\"failed to create skills directory {}\", parent.display())\n            })?;\n        }\n        tokio::fs::rename(&staged.staged_path, &final_path)\n            .await\n            .context(\"failed to install staged skill\")?;\n    }\n\n    // Write the marker last so a partial install never leaves a stale\n    // .installed-from on disk. Prefer v2 with package content digest.\n    let spec = source_spec_string(&source);\n    let content_digest = match super::package_digest::compute_package_digest(&final_path) {\n        Ok(digest) => digest,\n        Err(err) => {\n            let _ = tokio::fs::remove_dir_all(&final_path).await;\n            if let Some(backup) = backup_path.take() {\n                let _ = tokio::fs::rename(&backup, &final_path).await;\n            }\n            return Err(anyhow::anyhow!(\n                \"installed package failed content digest validation: {err}\"\n            ));\n        }\n    };\n    if let Err(err) = write_installed_from_v2(\n        &final_path,\n        &spec,\n        Some(&source_url),\n        &checksum,\n        &content_digest,\n        &staged.skill_name,\n    ) {\n        let _ = tokio::fs::remove_dir_all(&final_path).await;\n        if let Some(backup) = backup_path.take() {\n            let _ = tokio::fs::rename(&backup, &final_path).await;\n        }\n        return Err(err);\n    }","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/skills/install.rs#L364-L400","documentation":"After installing a skill package into its final directory, the installer recomputes a content digest and compares it to the manifest. On mismatch it deletes the installed tree (restoring any backup) and throws this error, so a corrupted or mismatched package is never left in place.","triggerScenarios":"install_with_registry (or update_with_registry) computes a digest of the installed files that differs from the expected digest from the registry manifest.","commonSituations":"Corrupted download or truncated extraction; registry metadata out of sync with package contents; a proxy or mirror altering files; filesystem errors during extraction.","solutions":["Retry the install — a transient download/extract corruption is the usual cause","Clear any cached package and re-fetch from the registry","Verify registry integrity / update the registry index","Check disk health and free space if it recurs"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match install_with_registry(skill, registry).await {\n    Ok(pkg) => /* use */,\n    Err(e) if e.to_string().contains(\"digest validation\") => {\n        clear_package_cache();\n        install_with_registry(skill, registry).await?; // one retry\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Retry installs from a clean cache on digest failure","Keep the registry index updated so digests match package contents","Verify storage integrity if mismatches recur (disk/network)"],"tags":["integrity","digest","install","security"],"backgroundTag":"checksum-mismatch","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}