Tencent/WeKnora · error
search notion pages: %w
Error message
search notion pages: %w
What it means
ListResources wraps any failure from client.SearchPages (the whole paginated Notion search used to discover pages the integration can access) with "search notion pages: %w". It signals that resource discovery itself failed, before any per-resource fetching starts.
Source
Thrown at internal/datasource/connector/notion/connector.go:83
// Notion returns the full hierarchy (with parent_id populated) in a single
// call, so children are already delivered with the root listing. Lazy-load
// requests for a specific parent therefore have nothing extra to return.
if parentID != "" {
return []types.Resource{}, nil
}
notionCfg, err := parseNotionConfig(config)
if err != nil {
return nil, err
}
client, err := newClient(notionCfg.APIKey, extractBaseURL(config))
if err != nil {
return nil, err
}
pages, err := client.SearchPages(ctx)
if err != nil {
return nil, fmt.Errorf("search notion pages: %w", err)
}
allIDs := make(map[string]bool, len(pages))
for _, p := range pages {
allIDs[p.ID] = true
}
// Precompute effective parent for each page.
// data_source objects need database_parent (their `parent` points at the
// database container, not the workspace location); see resolveParentID.
parentOf := make(map[string]string, len(pages))
for _, p := range pages {
if p.InTrash {
continue
}
parentOf[p.ID] = resolveParentID(p, allIDs)
}
View on GitHub (pinned to 988cbb0330)
Solutions
- Check the wrapped cause for auth vs network vs parse failure
- Validate the api_key credential (see ErrInvalidCredentials errors)
- Share the target pages/databases with the Notion integration in Notion UI
- Retry after backing off if the cause is 429/5xx
Example fix
pages, err := client.SearchPages(ctx)
if err != nil {
log.Printf("notion discovery failed: %v", err) // see wrapped cause
return nil, err
} Defensive patterns
Strategy: try-catch
Validate before calling
if err := connector.Validate(ctx, config); err != nil { return err } // fail before discovery Try / catch
resources, err := connector.ListResources(ctx, config)
if err != nil {
if errors.Is(err, datasource.ErrInvalidCredentials) { return reconfigurePrompt }
return fmt.Errorf("notion discovery failed: %w", err)
} Prevention
- Validate credentials with Validate before discovery runs
- Share target pages/databases with the integration in the Notion UI
- Wrap discovery with retry/backoff for transient 429/5xx
When it happens
Trigger: SearchPages fails while ListResources is enumerating accessible pages — invalid API key, pagination error, unmarshal error, or network failure.
Common situations: Integration token not configured or revoked, no pages shared with the integration plus an API quirk, network outage during discovery, Notion rate limiting.
Related errors
- KB hybrid search failed: %w
- failed to get messages by knowledge IDs: %w
- rate limited: %s
- server error %d: %s
- unexpected status %d: %s
AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02).
Data as JSON: /api/errors/7bbbaaaa731d823b.
Report an issue: GitHub.