Tencent/WeKnora · error
docreader call timeout after %s: %w
Error message
docreader call timeout after %s: %w
What it means
Thrown by the docreader call wrapper when reader.Read exceeds the configured DocReaderCallTimeout (default 30m). DeadlineExceeded is promoted into this clearer message while %w preserves errors.Is(ctx.Err(), context.DeadlineExceeded) for upstream retry classification — large or slow documents commonly hit it.
Source
Thrown at internal/application/service/knowledge_process.go:3786
) (*types.ReadResult, error) {
timeout := 30 * time.Minute
if s.config != nil && s.config.KnowledgeBase != nil && s.config.KnowledgeBase.DocReaderCallTimeout > 0 {
timeout = s.config.KnowledgeBase.DocReaderCallTimeout
}
callCtx, cancel := context.WithTimeout(ctx, timeout)
defer cancel()
start := time.Now()
result, err := reader.Read(callCtx, req)
elapsed := time.Since(start)
if err != nil {
// Promote DeadlineExceeded into a clearer message; retain underlying
// error via %w so errors.Is(callCtx.Err(), context.DeadlineExceeded)
// still works for upstream classification.
if errors.Is(callCtx.Err(), context.DeadlineExceeded) && !errors.Is(ctx.Err(), context.DeadlineExceeded) {
logger.Errorf(ctx, "[convert] docreader call timed out after %s (limit %s) for %q",
elapsed, timeout, req.FileName)
return nil, fmt.Errorf("docreader call timeout after %s: %w", timeout, err)
}
return nil, err
}
logger.Infof(ctx, "[convert] docreader call ok in %s for %q", elapsed, req.FileName)
return result, nil
}
// isLikelyRateLimitError performs a fuzzy classification of an error as a
// rate-limit / quota / backpressure failure. We only need a hint — the
// caller maps to one of two error_codes so the UI can offer "retry later"
// vs. "fix configuration" advice. False positives are harmless (the
// detail is preserved in error_detail anyway).
func isLikelyRateLimitError(err error) bool {
if err == nil {
return false
}
msg := strings.ToLower(err.Error())
for _, needle := range []string{"rate limit", "ratelimit", "429", "too many requests", "quota"} {View on GitHub (pinned to 988cbb0330)
Solutions
- Increase KnowledgeBase.DocReaderCallTimeout in config for large documents
- Reduce document size or split very large files before upload
- Check docreader service health if typical documents suddenly time out
- The task retries via asynq with backoff
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at internal/application/service/knowledge_process.go:3786 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02).
Data as JSON: /api/errors/05d62b011d4effa6.
Report an issue: GitHub.