Tencent/WeKnora · error

move wiki page: %w

Error message

move wiki page: %w

What it means

MovePage wraps the repo.UpdateMeta failure after the page's FolderID and cached category path were recalculated. The move is bookkeeping-only (no version bump); a failure leaves the page at its old folder.

Source

Thrown at internal/application/service/wiki_page.go:1612

}

// MovePage relocates a page into folderID ("" = root) and refreshes its cached
// category path. Bookkeeping-only write (no version bump).
func (s *wikiPageService) MovePage(
	ctx context.Context, kbID string, slug string, folderID string,
) (*types.WikiPage, error) {
	page, err := s.repo.GetBySlug(ctx, kbID, slug)
	if err != nil {
		return nil, err
	}
	page.FolderID = strings.TrimSpace(folderID)
	if err := s.applyFolderToPage(ctx, page); err != nil {
		return nil, err
	}
	page.UpdatedAt = time.Now()
	normalizeWikiHierarchy(page)
	if err := s.repo.UpdateMeta(ctx, page); err != nil {
		return nil, fmt.Errorf("move wiki page: %w", err)
	}
	return page, nil
}

// RenameOrMoveFolder renames and/or reparents a folder, then recomputes the
// materialized path/depth of the entire subtree and the cached category path of
// every page underneath. Guards against cycles (moving a folder into itself or
// one of its descendants) and sibling name collisions.
func (s *wikiPageService) RenameOrMoveFolder(
	ctx context.Context, kbID string, id string, newName string, newParentID string, moveParent bool,
) (*types.WikiFolder, error) {
	folder, err := s.repo.GetFolderByID(ctx, kbID, id)
	if err != nil {
		return nil, err
	}

	name := folder.Name
	if strings.TrimSpace(newName) != "" {

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Check repo/DB health and the wrapped cause
  2. Verify the target folder still exists
  3. Retry the move
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at internal/application/service/wiki_page.go:1612 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/ce665be425894c13. Report an issue: GitHub.