Tencent/WeKnora · error
list %s pages: %w
Error message
list %s pages: %w
What it means
GetIndexView lists wiki pages per content type via repo.ListByTypeLight. If the underlying repository call fails (DB down, query error, context canceled), the service wraps it with 'list <type> pages: %w' so the failing content type is identified. It is a wrapped persistence-layer error, not a validation error.
Source
Thrown at internal/application/service/wiki_page.go:507
}
offset = v
}
// Default to every known content type when the caller passes no
// filter. Any unknown request-time type is passed through verbatim so
// future page types (declared in types/wiki_page.go) start showing
// up in the index the moment the LLM starts creating them, without a
// handler change.
selected := pageTypes
if len(selected) == 0 {
selected = append([]string{}, wikiIndexContentPageTypes...)
}
groups := make([]types.WikiIndexGroup, 0, len(selected))
for _, pt := range selected {
entries, total, listErr := s.repo.ListByTypeLight(ctx, kbID, pt, limit, offset)
if listErr != nil {
return nil, fmt.Errorf("list %s pages: %w", pt, listErr)
}
if entries == nil {
entries = []types.WikiIndexEntry{}
}
for i := range entries {
normalizeWikiIndexEntryHierarchy(&entries[i], pt)
}
next := ""
// Only emit a cursor when a full page was returned AND more rows
// remain past `offset + limit`. A short page or one that exactly
// consumed the remainder should signal end-of-feed.
if len(entries) == limit && int64(offset+len(entries)) < total {
next = strconv.Itoa(offset + limit)
}
groups = append(groups, types.WikiIndexGroup{
Type: pt,
Total: total,
Items: entries,View on GitHub (pinned to 988cbb0330)
Solutions
- Check database connectivity and service logs for the underlying wrapped error (%w chain).
- Retry the request — transient DB/network failures often resolve; consider context timeout adjustments.
- Verify the schema/migrations for the pages table and the queried content type are current.
- Inspect repo.ListByTypeLight for query or index problems if the error is reproducible for one type.
Defensive patterns
Strategy: retry
Try / catch
groups, err := svc.GetIndexView(ctx, kbID, cursor)
if err != nil {
var retriable = ctx.Err() == nil // DB blips: retry with backoff
if retriable && isTransient(err) {
groups, err = svc.GetIndexView(ctx, kbID, cursor)
}
if err != nil { log.Errorf("index view failed: %v", err); return err }
} Prevention
- Monitor DB health and pool saturation for the service
- Keep migrations for wiki pages current
- Set generous but bounded context timeouts for index scans
- Log the full wrapped error chain to identify the failing content type
When it happens
Trigger: Any GetIndexView call where the repository's ListByTypeLight returns an error — database connectivity loss, SQL/schema errors, context deadline/cancellation, or permission failures at the storage layer.
Common situations: Database migrations leaving the wiki_pages table out of sync; transient connection pool exhaustion; request canceled by the client mid-scan of many content types; misconfigured DSN in the service environment.
Understand the failure class
Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.
Related errors
- create wiki page issue: %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/cde13b336cd1a706.
Report an issue: GitHub.