Tencent/WeKnora · error
update incoming page %s: %w
Error message
update incoming page %s: %w
What it means
Persisting a rewritten incoming wiki page failed: UpdateAutoLinkedContent rejected the update after the in-memory content was already mutated, so the page content is restored and the loop stops, returning prior changes for compensation.
Source
Thrown at internal/agent/tools/wiki_link_mutation.go:47
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(
ctx context.Context,
service interfaces.WikiPageService,
changes []appliedWikiContentChange,
) error {
var failures []string
for i := len(changes) - 1; i >= 0; i-- {
change := changes[i]
change.page.Content = change.originalContent
if err := service.UpdateAutoLinkedContent(ctx, change.page); err != nil {
failures = append(failures, fmt.Sprintf("%s: %v", change.page.Slug, err))View on GitHub (pinned to 988cbb0330)
Solutions
- Check page service/storage health from the wrapped error
- Resolve optimistic-concurrency conflicts if the page changed concurrently
- Invoke rollback of already-applied changes after this failure
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at internal/agent/tools/wiki_link_mutation.go:47 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/cb30f92e5370e110.
Report an issue: GitHub.