Tencent/WeKnora · error

load incoming page %s: %w

Error message

load incoming page %s: %w

What it means

Loading an incoming wiki page by slug failed during the machine-maintained link rewrite: GetPageBySlug errored or returned nothing, so the rewrite loop stops on first failure and returns already-applied changes so the caller can roll back (compensate).

Source

Thrown at internal/agent/tools/wiki_link_mutation.go:37

// applyIncomingWikiContentRewrite updates machine-maintained links without
// incrementing user-visible page versions. It stops on the first failure and
// returns the already-applied changes so the caller can compensate.
func applyIncomingWikiContentRewrite(
	ctx context.Context,
	service interfaces.WikiPageService,
	kbID string,
	inLinks []string,
	rewrite wikiContentRewrite,
) ([]appliedWikiContentChange, []string, error) {
	var changes []appliedWikiContentChange
	var updatedSlugs []string
	for _, sourceSlug := range dedupNonEmptyStrings(inLinks) {
		page, err := service.GetPageBySlug(ctx, kbID, sourceSlug)
		if err != nil || page == nil {
			if err == nil {
				err = fmt.Errorf("empty result")
			}
			return changes, updatedSlugs, fmt.Errorf("load incoming page %s: %w", sourceSlug, err)
		}
		updatedContent, changed := rewrite(page.Content)
		if !changed {
			continue
		}
		original := page.Content
		page.Content = updatedContent
		if err := service.UpdateAutoLinkedContent(ctx, page); err != nil {
			page.Content = original
			return changes, updatedSlugs, fmt.Errorf("update incoming page %s: %w", sourceSlug, err)
		}
		changes = append(changes, appliedWikiContentChange{page: page, originalContent: original})
		updatedSlugs = append(updatedSlugs, sourceSlug)
	}
	return changes, updatedSlugs, nil
}

func rollbackWikiContentChanges(

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Confirm the page slug exists in the knowledge base
  2. Reconcile stale incoming-links metadata
  3. Run the caller's rollback path to undo partial rewrites
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at internal/agent/tools/wiki_link_mutation.go:37 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/5394813af528f393. Report an issue: GitHub.