{"record":{"id":"25b00292e2f196d3","repo":"SubtitleEdit/subtitleedit","slug":"f5-tts-crispasr-the-crispasr-server-crashed-du","errorCode":null,"errorMessage":"F5-TTS (CrispASR) — the crispasr server crashed during synthesis.","messagePattern":"F5-TTS \\(CrispASR\\) — the crispasr server crashed during synthesis\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/ui/Features/Video/TextToSpeech/Engines/F5TtsCrispAsr.cs","lineNumber":424,"sourceCode":"            response = await HttpClient.PostAsync($\"{ServerBaseUrl}/v1/audio/speech\", content, cancellationToken);\n        }\n        catch (HttpRequestException ex)\n        {\n            var serverLog = SnapshotServerLog();\n            var launchCommand = _serverLaunchCommand;\n            var died = _serverProcess?.HasExited == true;\n            if (died)\n            {\n                StopServerInternal();\n            }\n\n            var failMsg = $\"F5-TTS (CrispASR) request failed — Voice: {f5Voice}, Text: {text}, \"\n                + $\"RequestJson: {body}, ServerExited: {died}, ServerLog: {serverLog}\"\n                + LaunchCmdSuffix(launchCommand);\n            Se.LogError(ex, failMsg);\n            Se.WriteToolsLog(failMsg);\n\n            throw new InvalidOperationException(\n                (died\n                    ? \"F5-TTS (CrispASR) — the crispasr server crashed during synthesis.\"\n                    : \"F5-TTS (CrispASR) request failed — the connection to the crispasr server was dropped.\")\n                + (string.IsNullOrEmpty(serverLog) ? string.Empty : $\"{Environment.NewLine}Server log:{Environment.NewLine}{serverLog}\")\n                + LaunchCmdSuffix(launchCommand),\n                ex);\n        }\n\n        using (response)\n        {\n            if (!response.IsSuccessStatusCode)\n            {\n                var errorBody = await SafeReadErrorAsync(response, cancellationToken);\n                var serverLog = SnapshotServerLog();\n                var launchCommand = _serverLaunchCommand;\n                var errMsg = $\"F5-TTS (CrispASR) server error {(int)response.StatusCode} {response.StatusCode} — \"\n                    + $\"Voice: {f5Voice}, Text: {text}, RequestJson: {body}, \"\n                    + $\"ResponseBody: {errorBody}, ServerLog: {serverLog}\"","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/ui/Features/Video/TextToSpeech/Engines/F5TtsCrispAsr.cs#L406-L442","documentation":"InvalidOperationException from F5TtsCrispAsr.Speak's HttpRequestException catch: the POST to /v1/audio/speech failed AND _serverProcess.HasExited is true, so the failure is read as the crispasr (f5-tts) server crashing mid-synthesis. The original HttpRequestException is chained and the server log is appended.","triggerScenarios":"HttpClient.PostAsync raises HttpRequestException; the catch finds _serverProcess?.HasExited == true → the 'crashed during synthesis' branch; StopServerInternal reaps the dead process.","commonSituations":"Synthesis OOM killing the server; a reference WAV/ref-text combo that crashes the f5-tts backend on a particular input; an upstream assert that exits the process mid-response.","solutions":["Inspect the appended 'Server log' for the fatal backend error (assert/OOM).","Retry with a shorter input or a different reference WAV to rule out input-triggered crashes.","Re-download the F5-TTS talker model in case of corruption (IsValidLocalModelFile).","Track the upstream CrispASR fix for the asserted backend and re-download when released."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if (f5TtsEngine is F5TtsCrispAsr f5 && !f5.IsServerAlive()) {\n    f5.StopServer(); // force clean relaunch on next Speak\n}","typeGuard":null,"tryCatchPattern":"try { await f5TtsEngine.Speak(text, out, voice, lang, region, model, ct); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"server crashed during synthesis\", StringComparison.Ordinal))\n{\n    Se.WriteToolsLog(\"F5-TTS server crashed mid-synth; retrying once after relaunch.\", true);\n    F5TtsCrispAsr.StopServer();\n    await f5TtsEngine.Speak(text, out, voice, lang, region, model, ct);\n}","preventionTips":["Re-download the F5-TTS talker model on any corruption suspicion.","Keep inputs reasonable to avoid backend asserts that kill the process.","Validate the reference WAV format (24 kHz mono) before cloning."],"tags":["tts","f5-tts","crispasr","server-crash","synthesis","http-request-exception"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}