{"record":{"id":"8e877b85a32117ca","repo":"Tencent/WeKnora","slug":"marshal-wiki-ingest-pending-op-w","errorCode":null,"errorMessage":"marshal wiki ingest pending op: %w","messagePattern":"marshal wiki ingest pending op: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/service/wiki_ingest.go","lineNumber":548,"sourceCode":"\t\treturn true, err\n\t}\n\treturn true, nil\n}\n\nfunc newWikiIngestPendingOp(\n\tctx context.Context,\n\ttenantID uint64,\n\tkbID, knowledgeID string,\n) (*types.TaskPendingOp, error) {\n\tlang := types.LanguageFromContextOrDefault(ctx)\n\top := WikiPendingOp{\n\t\tOp:          WikiOpIngest,\n\t\tKnowledgeID: knowledgeID,\n\t\tLanguage:    lang,\n\t}\n\tpayloadBytes, err := json.Marshal(op)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"marshal wiki ingest pending op: %w\", err)\n\t}\n\treturn &types.TaskPendingOp{\n\t\tTenantID: tenantID,\n\t\tTaskType: wikiTaskType,\n\t\tScope:    wikiTaskScope,\n\t\tScopeID:  kbID,\n\t\tOp:       WikiOpIngest,\n\t\tDedupKey: knowledgeID,\n\t\tPayload:  payloadBytes,\n\t}, nil\n}\n\nfunc enqueueWikiIngestTrigger(\n\tctx context.Context,\n\ttask interfaces.TaskEnqueuer,\n\ttenantID uint64,\n\tkbID string,\n) error {","sourceCodeStart":530,"sourceCodeEnd":566,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/wiki_ingest.go#L530-L566","documentation":"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.","triggerScenarios":"Thrown at internal/application/service/wiki_ingest.go:548 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped marshal error for unexpected data","Verify WikiPendingOp fields contain marshal-safe values","Retry the op creation"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}