Tencent/WeKnora · error

QA pipeline error: %s

Error message

QA pipeline error: %s

What it means

During streaming QA, the event.ErrorData handler captures the pipeline failure into qaErr ("QA pipeline error: %s", bufMu-protected) and signals completion. The caller logs it and sends a fallback reply via imQAFailureReply instead of an answer.

Source

Thrown at internal/im/service.go:2608

			answerBuilder.WriteString(data.Content)
			streamedAny = true
		}
		bufMu.Unlock()

		if data.Done {
			closeDone()
		}
		return nil
	})

	eventBus.On(event.EventError, func(_ context.Context, evt event.Event) error {
		data, ok := evt.Data.(event.ErrorData)
		if !ok {
			return nil
		}
		logger.Errorf(ctx, "[IM] QA stream error: %s", data.Error)
		bufMu.Lock()
		qaErr = fmt.Errorf("QA pipeline error: %s", data.Error)
		bufMu.Unlock()
		closeDone()
		closeComplete()
		return nil
	})

	eventBus.On(event.EventAgentReferences, func(_ context.Context, evt event.Event) error {
		data, ok := evt.Data.(event.AgentReferencesData)
		if !ok {
			return nil
		}
		bufMu.Lock()
		if assistantMsg != nil {
			refs := []*types.SearchResult(assistantMsg.KnowledgeReferences)
			collectIMKnowledgeReferences(&refs, data.References)
			assistantMsg.KnowledgeReferences = types.References(refs)
		}
		bufMu.Unlock()

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Check the underlying data.Error text in the log line '[IM] QA stream error' for the root cause
  2. Verify LLM provider credentials/quotas and KB connectivity
  3. Rely on the fallback reply path (imQAFailureReply) which is already sent to the user; retry the message after the pipeline recovers
Defensive patterns

Strategy: try-catch

Try / catch

if qaErr != nil {
    logger.Errorf(ctx, "[IM] QA failed: %v", qaErr)
    answer = imQAFailureReply(qaErr) // graceful fallback reply
}

Prevention

When it happens

Trigger: Any failure inside the streaming QA pipeline — agent/LLM invocation error, knowledge-base retrieval failure, upstream stream error event — surfaces as ErrorData on the event stream and is wrapped by this message.

Common situations: LLM provider outage or invalid API key; knowledge base unavailable; agent misconfiguration; context deadline exceeded during generation.

Related errors


AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02). Data as JSON: /api/errors/f788cb91c6ec986a. Report an issue: GitHub.