Tencent/WeKnora · error
create wiki page issue: %w
Error message
create wiki page issue: %w
What it means
CreateIssue persists a wiki page issue via repo.CreateIssue; any repository failure is wrapped as 'create wiki page issue: %w'. The service generates an ID if missing, so failures here come from the storage layer, not ID generation.
Source
Thrown at internal/application/service/wiki_page.go:1352
// removeString removes a string from a slice
func removeString(slice []string, s string) types.StringArray {
result := make(types.StringArray, 0, len(slice))
for _, v := range slice {
if v != s {
result = append(result, v)
}
}
return result
}
// CreateIssue logs a new issue for a wiki page
func (s *wikiPageService) CreateIssue(ctx context.Context, issue *types.WikiPageIssue) (*types.WikiPageIssue, error) {
if issue.ID == "" {
issue.ID = uuid.New().String()
}
if err := s.repo.CreateIssue(ctx, issue); err != nil {
return nil, fmt.Errorf("create wiki page issue: %w", err)
}
return issue, nil
}
// ListIssues retrieves issues for a knowledge base
func (s *wikiPageService) ListIssues(ctx context.Context, kbID string, slug string, status string) ([]*types.WikiPageIssue, error) {
return s.repo.ListIssues(ctx, kbID, slug, status)
}
// UpdateIssueStatus updates an issue's status
func (s *wikiPageService) UpdateIssueStatus(ctx context.Context, issueID string, status string) error {
return s.repo.UpdateIssueStatus(ctx, issueID, status)
}
// --- Folder tree (wiki_folders) ---
// wikiFolderSegments splits a materialized folder path ("AI/RAG") into cleaned
// segments. Empty/blank path yields nil (the wiki root).View on GitHub (pinned to 988cbb0330)
Solutions
- Inspect the wrapped underlying error in logs to identify the storage failure cause.
- Verify the issue's page/KB references exist to rule out foreign-key violations.
- Retry on transient DB errors with backoff.
- Validate issue payload (required fields, valid status) before calling.
Defensive patterns
Strategy: try-catch
Validate before calling
if issue.PageID == "" || issue.KnowledgeBaseID == "" {
return errors.New("issue requires page and knowledge base IDs")
}
if _, err := pageSvc.GetPage(ctx, issue.KnowledgeBaseID, issue.Slug); err != nil {
return fmt.Errorf("target page missing: %w", err)
} Try / catch
created, err := svc.CreateIssue(ctx, issue)
if err != nil && strings.Contains(err.Error(), "create wiki page issue:") {
if isTransient(err) {
created, err = svc.CreateIssue(ctx, issue) // retry after backoff
}
if err != nil { return fmt.Errorf("issue not saved: %w", err) }
} Prevention
- Verify the target page exists before filing issues to avoid FK violations
- Populate required fields (ID is auto-generated if empty) and a valid status
- Apply backoff retries for transient DB errors in automation that files issues
- Keep issue-table migrations current
When it happens
Trigger: Calling CreateIssue with a WikiPageIssue whose repository insert fails — DB unavailable, foreign-key violation (issue references a nonexistent page/KB), context canceled, or constraint violation.
Common situations: Submitting issues against pages that were deleted (FK violation); DB connectivity blips; batch automation posting issues faster than the pool allows; schema drift after migrations.
Related errors
- list %s pages: %w
- failed to ensure FAQ knowledge: %w
- failed to create chunk: %w
- create default %s page: %w
- resolve page folder: %w
AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02).
Data as JSON: /api/errors/ad2b57c3d36d6292.
Report an issue: GitHub.