Tencent/WeKnora · error

verify summary fallback freshness: %w

Error message

verify summary fallback freshness: %w

What it means

Thrown in the summary-generation retry-exhaustion path when summarySourceChanged itself errors while checking whether the terminal fallback summary still matches the current chunks/metadata revision. The freshness gate could not run, so the pre-computed fallback is discarded and the error surfaced.

Source

Thrown at internal/application/service/knowledge_process.go:1195

			if updateErr := s.repo.UpdateKnowledge(ctx, knowledge); updateErr != nil {
				logger.Warnf(ctx, "Failed to mark summary pending for retry: %v", updateErr)
			}
			summaryOut["retrying"] = true
			return fmt.Errorf("summary generation attempt failed: %w", generationErr)
		}

		// Before publishing the terminal fallback, make sure its source still
		// matches the chunks and metadata captured for this attempt.
		stale, staleErr := summarySourceChanged(
			ctx, s.repo, s.chunkRepo, payload.TenantID, payload.KnowledgeID,
			summaryMetadataVersion, textChunks,
		)
		if staleErr != nil {
			logger.Errorf(ctx, "Failed to verify summary fallback freshness for knowledge %s: %v",
				payload.KnowledgeID, staleErr)
			markSummaryFailed()
			summaryErr = staleErr
			return fmt.Errorf("verify summary fallback freshness: %w", staleErr)
		}
		if stale {
			logger.Infof(ctx, "Discarding stale summary fallback for knowledge %s", payload.KnowledgeID)
			summaryOut["skipped"] = "content_revision_changed"
			return nil
		}

		fallback := applyRetryableSummaryFailureState(knowledge, textChunks, false)
		if updateErr := s.repo.UpdateKnowledge(ctx, knowledge); updateErr != nil {
			logger.Errorf(ctx, "Failed to save terminal summary fallback: %v", updateErr)
			summaryErr = updateErr
			return fmt.Errorf("save terminal summary fallback: %w", updateErr)
		}
		if fallback == "" {
			summaryOut["fallback"] = "empty"
		} else {
			summaryOut["fallback"] = "first_chunk"
		}

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Check repo/chunkRepo availability used by the freshness check
  2. Retry the summary task; knowledge is already marked pending for retry
  3. Inspect logs for the underlying read failure on chunks or metadata version
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at internal/application/service/knowledge_process.go:1195 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/311d63322525ac6a. Report an issue: GitHub.