Tencent/WeKnora · error
wiki page not found
Error message
wiki page not found
What it means
Sentinel ErrWikiPageNotFound: a wiki page lookup (by slug or id) found no matching row — gorm.ErrRecordNotFound mapped. In graph/route resolution the caller treats it as 'skip this slug' rather than a fatal error.
Source
Thrown at internal/application/repository/wiki_page.go:18
package repository
import (
"context"
"encoding/json"
"errors"
"fmt"
"strings"
"time"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/types/interfaces"
"gorm.io/gorm"
"gorm.io/gorm/clause"
)
// ErrWikiPageNotFound is returned when a wiki page is not found
var ErrWikiPageNotFound = errors.New("wiki page not found")
// ErrWikiPageConflict is returned when an optimistic lock conflict is detected
var ErrWikiPageConflict = errors.New("wiki page version conflict")
// wikiPageRepository implements the WikiPageRepository interface
type wikiPageRepository struct {
db *gorm.DB
}
// NewWikiPageRepository creates a new wiki page repository
func NewWikiPageRepository(db *gorm.DB) interfaces.WikiPageRepository {
return &wikiPageRepository{db: db}
}
func (r *wikiPageRepository) wikiCategoryRankOrder() string {
if r.db != nil && r.db.Dialector != nil && r.db.Dialector.Name() == "sqlite" {
return "CASE WHEN COALESCE(json_array_length(category_path), 0) > 0 THEN 0 ELSE 1 END ASC"
}View on GitHub (pinned to 988cbb0330)
Solutions
- Verify the slug/knowledge-base pair; the page may have been deleted or renamed
- Skip the missing page in batch flows (as wiki_route_resolver does) or return 404 for direct requests
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at internal/application/repository/wiki_page.go:18 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/9befd64ccd9334c5.
Report an issue: GitHub.