Hmbown/CodeWhale · critical

installed package failed content digest validation

Error message

installed package failed content digest validation: {err}

What it means

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.

Solutions

  1. Retry the install — a transient download/extract corruption is the usual cause
  2. Clear any cached package and re-fetch from the registry
  3. Verify registry integrity / update the registry index
  4. Check disk health and free space if it recurs
Defensive patterns

Strategy: retry

Try / catch

match install_with_registry(skill, registry).await {
    Ok(pkg) => /* use */,
    Err(e) if e.to_string().contains("digest validation") => {
        clear_package_cache();
        install_with_registry(skill, registry).await?; // one retry
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: install_with_registry (or update_with_registry) computes a digest of the installed files that differs from the expected digest from the registry manifest.

Common situations: Corrupted download or truncated extraction; registry metadata out of sync with package contents; a proxy or mirror altering files; filesystem errors during extraction.

Understand the failure class

Background: Checksum mismatch errors: "checksum verification failed", "digest mismatch", "expected vs actual checksum" — what they mean and how to fix them — this error's family across 41 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/68b92f87c0fbf0d4. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/skills/install.rs:382

                format!("failed to create skills directory {}", parent.display())
            })?;
        }
        tokio::fs::rename(&staged.staged_path, &final_path)
            .await
            .context("failed to install staged skill")?;
    }

    // Write the marker last so a partial install never leaves a stale
    // .installed-from on disk. Prefer v2 with package content digest.
    let spec = source_spec_string(&source);
    let content_digest = match super::package_digest::compute_package_digest(&final_path) {
        Ok(digest) => digest,
        Err(err) => {
            let _ = tokio::fs::remove_dir_all(&final_path).await;
            if let Some(backup) = backup_path.take() {
                let _ = tokio::fs::rename(&backup, &final_path).await;
            }
            return Err(anyhow::anyhow!(
                "installed package failed content digest validation: {err}"
            ));
        }
    };
    if let Err(err) = write_installed_from_v2(
        &final_path,
        &spec,
        Some(&source_url),
        &checksum,
        &content_digest,
        &staged.skill_name,
    ) {
        let _ = tokio::fs::remove_dir_all(&final_path).await;
        if let Some(backup) = backup_path.take() {
            let _ = tokio::fs::rename(&backup, &final_path).await;
        }
        return Err(err);
    }

View on GitHub (pinned to 73e0f67d83)