BigPizzaV3/CodexPlusPlus · error · anyhow::Error

DreamSkin 主题包 SHA-256 与审核元数据不一致

Error message

DreamSkin 主题包 SHA-256 与审核元数据不一致

What it means

SHA-256 over the downloaded package (hex, compared case-insensitively) must equal metadata.package_sha256 recorded at review time. Any byte-level difference - transit corruption or a replaced artifact - aborts the install before the zip is opened.

Source

Thrown at crates/codex-plus-core/src/dream_skin_community.rs:170

    }
    if !metadata.apply_compatible {
        bail!("该主题是旧格式,只支持在线预览或手动下载");
    }

    let download_url = format!("{COMMUNITY_API_ORIGIN}/v1/themes/{version_id}/download");
    let package = download_limited(
        &client,
        &download_url,
        metadata.package_bytes,
        "application/zip",
    )
    .await?;
    if package.len() != metadata.package_bytes {
        bail!("DreamSkin 主题包实际大小与审核元数据不一致");
    }
    let actual_sha = format!("{:x}", Sha256::digest(&package));
    if !actual_sha.eq_ignore_ascii_case(&metadata.package_sha256) {
        bail!("DreamSkin 主题包 SHA-256 与审核元数据不一致");
    }
    let validated = crate::dream_skin_package::validate_and_read_package(
        &package,
        if cfg!(windows) { "windows" } else { "macos" },
    )?;
    if validated.manifest.theme_id != metadata.theme_id
        || validated.manifest.version != metadata.version
    {
        bail!("DreamSkin 主题包身份与审核元数据不一致");
    }
    crate::dream_skin_library::save_validated_dream_skin_package(state_dir, &validated)
}

pub fn import_theme_package(
    state_dir: &Path,
    archive_path: &Path,
) -> anyhow::Result<DreamSkinThemeSummary> {
    let metadata = std::fs::symlink_metadata(archive_path)

View on GitHub (pinned to f2074595a2)

Solutions

  1. Retry once - transit corruption is the most common cause
  2. Refresh the catalog and retry so metadata matches any re-published artifact
  3. If SHA still mismatches, stop and report the theme - a persistent hash mismatch may mean a tampered or mis-versioned artifact
Defensive patterns

Strategy: retry

Try / catch

Catch the 'SHA-256 与审核元数据不一致' message and retry install_community_theme once; a second identical failure must terminate with a clear report (artifact drift or tampering), never a retry loop.

Prevention

When it happens

Trigger: Bit-level corruption on flaky links; the zip replaced on the server after review; a CDN serving different content for the same URL.

Common situations: Hotspot or mobile networks corrupting large transfers; gallery re-publishing artifacts without refreshing reviewed metadata.

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 BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23). Data as JSON: /api/errors/6707cd648e92af03. Report an issue: GitHub.