Tencent/WeKnora · error
audio transcription failed: %w
Error message
audio transcription failed: %w
What it means
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.
Source
Thrown at internal/application/service/knowledge_process.go:3485
if err != nil {
logger.Errorf(ctx, "[ASR] Failed to get ASR model: %v", err)
knowledge.ParseStatus = "failed"
knowledge.ErrorMessage = fmt.Sprintf("failed to get ASR model: %v", err)
knowledge.UpdatedAt = time.Now()
s.repo.UpdateKnowledge(ctx, knowledge)
return nil
}
transcriptionResult, err := asrModel.Transcribe(ctx, convertResult.AudioData, knowledge.FileName)
if err != nil {
logger.Errorf(ctx, "[ASR] Transcription failed: %v", err)
if isLastRetry {
knowledge.ParseStatus = "failed"
knowledge.ErrorMessage = fmt.Sprintf("audio transcription failed: %v", err)
knowledge.UpdatedAt = time.Now()
s.repo.UpdateKnowledge(ctx, knowledge)
}
return fmt.Errorf("audio transcription failed: %w", err)
}
var transcribedText string
if transcriptionResult != nil {
transcribedText = transcriptionResult.Text
}
if transcribedText == "" {
logger.Warn(ctx, "[ASR] Transcription returned empty text")
transcribedText = "[No speech detected in audio file]"
}
logger.Infof(ctx, "[ASR] Transcription completed, text length=%d", len(transcribedText))
// Replace the audio placeholder with the transcribed text
convertResult.MarkdownContent = transcribedText
convertResult.IsAudio = false
convertResult.AudioData = nil
}View on GitHub (pinned to 988cbb0330)
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
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at internal/application/service/knowledge_process.go:3485 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02).
Data as JSON: /api/errors/7523dfd40c9144de.
Report an issue: GitHub.