SubtitleEdit/subtitleedit · error · IOException

VibeVoice (CrispASR) model {fileName} failed integrity check

Error message

VibeVoice (CrispASR) model {fileName} failed integrity check (expected SHA-256 {expected}, got {actual}).

What it means

Integrity check for the VibeVoice CrispASR model set. The downloaded file is opened read-only, hashed, and compared to the pinned expected hash; mismatch throws IOException. Surrounding GetUrl also throws ArgumentException for an unknown fileName.

Source

Thrown at src/ui/Logic/Download/VibeVoiceCrispAsrDownloadService.cs:126

        {
            return;
        }

        var expected = DownloadHashManager.GetLatestKnownHash(key);
        if (string.IsNullOrEmpty(expected))
        {
            return;
        }

        string actual;
        await using (var stream = File.OpenRead(filePath))
        {
            actual = await Sha256Util.ComputeSha256Async(stream, cancellationToken);
        }

        if (!string.Equals(expected, actual, StringComparison.OrdinalIgnoreCase))
        {
            throw new IOException(
                $"VibeVoice (CrispASR) model {fileName} failed integrity check (expected SHA-256 {expected}, got {actual}).");
        }
    }

    private static string GetUrl(string fileName)
    {
        if (!ModelUrls.TryGetValue(fileName, out var url))
        {
            throw new ArgumentException($"Unknown VibeVoice (CrispASR) model: {fileName}", nameof(fileName));
        }
        return url;
    }

    private static void TryDelete(string path)
    {
        try { File.Delete(path); } catch { /* best-effort cleanup */ }
    }

View on GitHub (pinned to 17a9f07487)

Solutions

  1. Delete the cached model file and re-download.
  2. Verify the pinned expected hash matches the current origin artifact.
  3. Check network/disk for truncation.
  4. If the model was intentionally republished, update the hash constant in VibeVoiceCrispAsrDownloadService.
Defensive patterns

Strategy: try-catch

Validate before calling

var cached = Path.Combine(modelFolder, fileName);
if (File.Exists(cached))
{
    using var s = File.OpenRead(cached);
    var h = await Sha256Util.ComputeSha256Async(s, ct);
    if (!string.Equals(expected, h, StringComparison.OrdinalIgnoreCase)) File.Delete(cached);
}

Try / catch

try { await service.DownloadModelAsync(...); }
catch (IOException ex) when (ex.Message.Contains("failed integrity check"))
{
    if (File.Exists(filePath)) File.Delete(filePath);
    await service.DownloadModelAsync(...);
}

Prevention

When it happens

Trigger: Non-empty expected hash that differs from the SHA-256 of filePath on disk. Empty expected skips the check and returns early.

Common situations: Partial/interrupted download, CDN republished the model without bumping the pinned hash, corrupt cache, or a cache that survived a binary update pinning a new hash.

Related errors


AI-assisted analysis of SubtitleEdit/subtitleedit@17a9f07487 (2026-08-13). Data as JSON: /api/errors/7b9ee8896208949a. Report an issue: GitHub.