{"record":{"id":"497083a801cfc283","repo":"SubtitleEdit/subtitleedit","slug":"f5-tts-crispasr-model-filename-failed-integrit","errorCode":null,"errorMessage":"F5-TTS (CrispASR) model {fileName} failed integrity check (expected SHA-256 {expected}, got {actual}).","messagePattern":"F5-TTS \\(CrispASR\\) model (.+?) failed integrity check \\(expected SHA-256 (.+?), got (.+?)\\)\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"src/ui/Logic/Download/F5TtsCrispAsrDownloadService.cs","lineNumber":110,"sourceCode":"        {\n            return;\n        }\n\n        var expected = DownloadHashManager.GetLatestKnownHash(key);\n        if (string.IsNullOrEmpty(expected))\n        {\n            return;\n        }\n\n        string actual;\n        await using (var stream = File.OpenRead(filePath))\n        {\n            actual = await Sha256Util.ComputeSha256Async(stream, cancellationToken);\n        }\n\n        if (!string.Equals(expected, actual, StringComparison.OrdinalIgnoreCase))\n        {\n            throw new IOException(\n                $\"F5-TTS (CrispASR) model {fileName} failed integrity check (expected SHA-256 {expected}, got {actual}).\");\n        }\n    }\n\n    private static string GetUrl(string fileName)\n    {\n        if (!ModelUrls.TryGetValue(fileName, out var url))\n        {\n            throw new ArgumentException($\"Unknown F5-TTS (CrispASR) model: {fileName}\", nameof(fileName));\n        }\n        return url;\n    }\n\n    private static void TryDelete(string path)\n    {\n        try { File.Delete(path); } catch { /* best-effort cleanup */ }\n    }\n","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/ui/Logic/Download/F5TtsCrispAsrDownloadService.cs#L92-L128","documentation":"Thrown by the F5-TTS CrispASR integrity check after download: the SHA-256 of the file at filePath does not case-insensitively equal the expected hash registered for that fileName. Same pattern as the other CrispASR services — IOException so the pipeline can treat it as a (potentially retryable) I/O fault. A mismatch means the file is corrupt, truncated, tampered, or the expected hash is stale.","triggerScenarios":"Downloaded bytes for fileName hash to a value other than expected; cached partial/corrupt file at filePath; mirror served a different artifact; expected-hash registry was updated for a new model release but old bytes remain on disk; concurrent modification while hashing.","commonSituations":"Stale local cache from a prior version after an app update bumped the model; CDN edge cache poisoning; AV quarantine of part of the file; user copied a similarly-named but different model over the path.","solutions":["Delete the file at filePath and let the service re-download.","If it still fails, confirm the expected hash matches the upstream artifact for the current model version and update the registry if a new release shipped.","Download from a different mirror / clean network to rule out in-transit corruption.","Make sure no other process (AV, cloud sync) touches the file during hashing."],"exampleFix":"// before\nawait f5Service.DownloadAsync(fileName, path, progress, ct);\n\n// after: purge corrupt cache before retry\nif (File.Exists(path)) File.Delete(path);\nawait f5Service.DownloadAsync(fileName, path, progress, ct);","handlingStrategy":"try-catch","validationCode":"// Pre-check existence; full hash IS the check, so prefer try/catch\nif (!File.Exists(filePath)) { /* allow download */ }","typeGuard":null,"tryCatchPattern":"try { await f5Service.VerifyAsync(fileName, filePath, expected, ct); }\ncatch (IOException ex) when (ex.Message.Contains(\"failed integrity check\"))\n{ File.Delete(filePath); await f5Service.DownloadAsync(fileName, filePath, progress, ct); }","preventionTips":["Delete cached files when bumping the model version.","Log the actual vs expected hash to diagnose registry drift.","Update expected hash and URL together to keep them consistent."],"tags":["integrity","sha256","f5-tts","crispasr","download","corruption"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}