SubtitleEdit/subtitleedit · error · IOException

OmniVoice (CrispASR) model {fileName} failed integrity check

Error message

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

What it means

Identical integrity gate to the MOSS-TTS one, but for the OmniVoice CrispASR model set. The OmniVoiceCrispAsrDownloadService computes a SHA-256 over the downloaded model and throws IOException if it diverges from the pinned expected value.

Source

Thrown at src/ui/Logic/Download/OmniVoiceCrispAsrDownloadService.cs:142

        {
            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(
                $"OmniVoice (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 OmniVoice (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. Clear the cached model file and re-download.
  2. Verify the pinned expected hash against the current origin artifact.
  3. Check for disk/network issues that truncated the write.
  4. If the artifact was intentionally republished, update the hash table in OmniVoiceCrispAsrDownloadService.
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: A non-empty expected hash compared case-insensitively against the computed actual hash of the file on disk; mismatch trips the throw. Empty expected short-circuits.

Common situations: Partial download, CDN republished the model without updating the pinned hash, corrupt cache, mirrored/proxied download that altered bytes.

Related errors


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