Tencent/WeKnora · error

no resource IDs configured

Error message

no resource IDs configured

What it means

FetchIncremental requires an explicit list of Notion page/database IDs (config.ResourceIDs) to sync incrementally; it cannot discover them itself. When the configuration has no resource IDs it aborts immediately with this plain error.

Source

Thrown at internal/datasource/connector/notion/connector.go:176

			logger.Warnf(ctx, "[Notion] failed to fetch resource %s as page or database", resourceID)
		}
		allItems = append(allItems, items...)
	}

	return allItems, nil
}

// FetchIncremental performs an incremental sync based on cursor state.
// On first sync (nil cursor), delegates to FetchAll for efficiency (no discovery needed).
func (c *Connector) FetchIncremental(ctx context.Context, config *types.DataSourceConfig, cursor *types.SyncCursor) ([]types.FetchedItem, *types.SyncCursor, error) {
	notionCfg, err := parseNotionConfig(config)
	if err != nil {
		return nil, nil, err
	}

	resourceIDs := config.ResourceIDs
	if len(resourceIDs) == 0 {
		return nil, nil, fmt.Errorf("no resource IDs configured")
	}

	client, err := newClient(notionCfg.APIKey, extractBaseURL(config))
	if err != nil {
		return nil, nil, err
	}

	// Parse previous cursor
	var prevCursor notionCursor
	if cursor != nil && cursor.ConnectorCursor != nil {
		cursorBytes, _ := json.Marshal(cursor.ConnectorCursor)
		_ = json.Unmarshal(cursorBytes, &prevCursor)
	}

	// First sync: use FetchAll then build cursor from Search API (one call, no block traversal)
	isFirstSync := len(prevCursor.PageEditTimes) == 0
	if isFirstSync {
		logger.Infof(ctx, "[Notion] first sync, using FetchAll for %d resources", len(resourceIDs))

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Populate config.ResourceIDs with the Notion page/database IDs to sync
  2. Run ListResources first to discover IDs, then configure them for incremental fetch
  3. Share the desired pages with the integration so they appear in ListResources

Example fix

// before
FetchIncremental(ctx, datasource.Config{Credentials: creds})
// after
FetchIncremental(ctx, datasource.Config{
    Credentials: creds,
    ResourceIDs: []string{"page-uuid-1", "database-uuid-2"},
})
Defensive patterns

Strategy: validation

Validate before calling

if len(config.ResourceIDs) == 0 { return errors.New("incremental fetch requires ResourceIDs; run ListResources first") }

Type guard

func hasResourceIDs(cfg datasource.Config) bool { return len(cfg.ResourceIDs) > 0 }

Try / catch

if _, _, err := connector.FetchIncremental(ctx, cfg); err != nil && strings.Contains(err.Error(), "no resource IDs configured") {
    // fall back to full FetchAll to discover resources
    return connector.FetchAll(ctx, cfg)
}

Prevention

When it happens

Trigger: Calling FetchIncremental with a datasource config whose ResourceIDs slice is empty/absent.

Common situations: Operator set up incremental sync without first running ListResources or manually entering page IDs; config migration lost resource_ids; UI failed to persist selections.

Understand the failure class

Background: "X is required", "must be set", "cannot be empty": the missing-required-config error family, from Vertex AI project/location to WeChat keys — this error's family across 18 libraries.

Related errors


AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02). Data as JSON: /api/errors/61d96c36a60cdba3. Report an issue: GitHub.