{"record":{"id":"7d03b9ccd0b68bbb","repo":"Tencent/WeKnora","slug":"failed-to-index-summary-chunk-w","errorCode":null,"errorMessage":"failed to index summary chunk: %w","messagePattern":"failed to index summary chunk: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/service/knowledge_process.go","lineNumber":1365,"sourceCode":"\t\t\tlogger.Errorf(ctx, \"Failed to get embedding model: %v\", err)\n\t\t\tsummaryErr = err\n\t\t\treturn fmt.Errorf(\"failed to get embedding model: %w\", err)\n\t\t}\n\n\t\tindexInfo := []*types.IndexInfo{{\n\t\t\tContent:         summaryChunk.Content,\n\t\t\tSourceID:        summaryChunk.ID,\n\t\t\tSourceType:      types.ChunkSourceType,\n\t\t\tChunkID:         summaryChunk.ID,\n\t\t\tKnowledgeID:     knowledge.ID,\n\t\t\tKnowledgeBaseID: knowledge.KnowledgeBaseID,\n\t\t\tIsEnabled:       true,\n\t\t}}\n\n\t\tif err := retrieveEngine.BatchIndex(ctx, embeddingModel, indexInfo); err != nil {\n\t\t\tlogger.Errorf(ctx, \"Failed to index summary chunk: %v\", err)\n\t\t\tsummaryErr = err\n\t\t\treturn fmt.Errorf(\"failed to index summary chunk: %w\", err)\n\t\t}\n\n\t\tlogger.Infof(ctx, \"Successfully created and indexed summary chunk for knowledge: %s\", payload.KnowledgeID)\n\t\tsummaryOut[\"summary_chunk_indexed\"] = true\n\t}\n\n\tlogger.Infof(ctx, \"Successfully generated summary for knowledge: %s\", payload.KnowledgeID)\n\tsummaryOut[\"status\"] = \"completed\"\n\treturn nil\n}\n\n// ProcessQuestionGeneration handles async question generation task. It\n// dispatches between the batched fan-out path (current: one task per window of\n// text chunks, payload.ChunkIDs set) and the legacy whole-knowledge path (kept\n// for tasks enqueued before fan-out shipped, no chunk ids). A lone ChunkID\n// (from an interim per-chunk build) is treated as a one-element batch.\nfunc (s *knowledgeService) ProcessQuestionGeneration(ctx context.Context, t *asynq.Task) (retErr error) {\n\tvar payload types.QuestionGenerationPayload","sourceCodeStart":1347,"sourceCodeEnd":1383,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/knowledge_process.go#L1347-L1383","documentation":"Thrown when retrieveEngine.BatchIndex fails to embed and write the summary chunk into the vector store. The chunk row exists in the DB but is not retrievable; typically embedding-provider or vector-store failure.","triggerScenarios":"Thrown at internal/application/service/knowledge_process.go:1365 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check embedding provider and vector store health/quotas","Verify the summary content does not exceed embedding input limits","Retry summary regeneration; indexing is re-attempted end-to-end"],"exampleFix":null,"handlingStrategy":"retry","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"}