{"record":{"id":"7523dfd40c9144de","repo":"Tencent/WeKnora","slug":"audio-transcription-failed-w","errorCode":null,"errorMessage":"audio transcription failed: %w","messagePattern":"audio transcription failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/service/knowledge_process.go","lineNumber":3485,"sourceCode":"\t\tif err != nil {\n\t\t\tlogger.Errorf(ctx, \"[ASR] Failed to get ASR model: %v\", err)\n\t\t\tknowledge.ParseStatus = \"failed\"\n\t\t\tknowledge.ErrorMessage = fmt.Sprintf(\"failed to get ASR model: %v\", err)\n\t\t\tknowledge.UpdatedAt = time.Now()\n\t\t\ts.repo.UpdateKnowledge(ctx, knowledge)\n\t\t\treturn nil\n\t\t}\n\n\t\ttranscriptionResult, err := asrModel.Transcribe(ctx, convertResult.AudioData, knowledge.FileName)\n\t\tif err != nil {\n\t\t\tlogger.Errorf(ctx, \"[ASR] Transcription failed: %v\", err)\n\t\t\tif isLastRetry {\n\t\t\t\tknowledge.ParseStatus = \"failed\"\n\t\t\t\tknowledge.ErrorMessage = fmt.Sprintf(\"audio transcription failed: %v\", err)\n\t\t\t\tknowledge.UpdatedAt = time.Now()\n\t\t\t\ts.repo.UpdateKnowledge(ctx, knowledge)\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"audio transcription failed: %w\", err)\n\t\t}\n\n\t\tvar transcribedText string\n\t\tif transcriptionResult != nil {\n\t\t\ttranscribedText = transcriptionResult.Text\n\t\t}\n\n\t\tif transcribedText == \"\" {\n\t\t\tlogger.Warn(ctx, \"[ASR] Transcription returned empty text\")\n\t\t\ttranscribedText = \"[No speech detected in audio file]\"\n\t\t}\n\n\t\tlogger.Infof(ctx, \"[ASR] Transcription completed, text length=%d\", len(transcribedText))\n\t\t// Replace the audio placeholder with the transcribed text\n\t\tconvertResult.MarkdownContent = transcribedText\n\t\tconvertResult.IsAudio = false\n\t\tconvertResult.AudioData = nil\n\t}","sourceCodeStart":3467,"sourceCodeEnd":3503,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/knowledge_process.go#L3467-L3503","documentation":"Thrown in ProcessDocument's ASR path when asrModel.Transcribe fails to convert audio to text. Provider-side failure (model error, unsupported/Corrupt audio, quota); on the last retry the knowledge is terminally marked failed with the transcription message.","triggerScenarios":"Thrown at internal/application/service/knowledge_process.go:3485 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the audio file format is supported and not corrupt","Check ASR model provider health and tenant quotas","Retry the parse; earlier attempts already logged the ASR-stage error","Inspect knowledge.ErrorMessage on terminal failure"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}