Tencent/WeKnora · error

marshal wiki ingest pending op: %w

Error message

marshal wiki ingest pending op: %w

What it means

newWikiIngestPendingOp wraps json.Marshal failure of the WikiPendingOp payload. Structured data (strings only) makes this near-impossible in practice; it signals an unexpected serialization fault before the op is queued.

Source

Thrown at internal/application/service/wiki_ingest.go:548

		return true, err
	}
	return true, nil
}

func newWikiIngestPendingOp(
	ctx context.Context,
	tenantID uint64,
	kbID, knowledgeID string,
) (*types.TaskPendingOp, error) {
	lang := types.LanguageFromContextOrDefault(ctx)
	op := WikiPendingOp{
		Op:          WikiOpIngest,
		KnowledgeID: knowledgeID,
		Language:    lang,
	}
	payloadBytes, err := json.Marshal(op)
	if err != nil {
		return nil, fmt.Errorf("marshal wiki ingest pending op: %w", err)
	}
	return &types.TaskPendingOp{
		TenantID: tenantID,
		TaskType: wikiTaskType,
		Scope:    wikiTaskScope,
		ScopeID:  kbID,
		Op:       WikiOpIngest,
		DedupKey: knowledgeID,
		Payload:  payloadBytes,
	}, nil
}

func enqueueWikiIngestTrigger(
	ctx context.Context,
	task interfaces.TaskEnqueuer,
	tenantID uint64,
	kbID string,
) error {

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Inspect the wrapped marshal error for unexpected data
  2. Verify WikiPendingOp fields contain marshal-safe values
  3. Retry the op creation
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at internal/application/service/wiki_ingest.go:548 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/8e877b85a32117ca. Report an issue: GitHub.