{"record":{"id":"ff960309a5a2c210","repo":"Tencent/WeKnora","slug":"failed-to-batch-save-dimension-d-w","errorCode":null,"errorMessage":"failed to batch save (dimension %d): %w","messagePattern":"failed to batch save \\(dimension (.+?)\\): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/repository/retriever/milvus/repository.go","lineNumber":321,"sourceCode":"\tfor dimension, embeddings := range embeddingsByDimension {\n\t\tif err := m.ensureCollection(ctx, dimension); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tcollectionName := m.getCollectionName(dimension)\n\t\tn := len(embeddings)\n\t\tembeddingDBList := make([]*MilvusVectorEmbedding, 0, n)\n\n\t\tfor _, embedding := range embeddings {\n\t\t\tembeddingDB := toMilvusVectorEmbedding(embedding, additionalParams)\n\t\t\tembeddingDB.ID = uuid.New().String()\n\t\t\tembeddingDBList = append(embeddingDBList, embeddingDB)\n\t\t}\n\t\topts := createUpsert(collectionName, embeddingDBList)\n\t\t_, err := m.client.Upsert(ctx, opts)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"[Milvus] Failed to execute batch operation for dimension %d: %v\", dimension, err)\n\t\t\treturn fmt.Errorf(\"failed to batch save (dimension %d): %w\", dimension, err)\n\t\t}\n\t\ttotalSaved += n\n\t\tlog.Infof(\"[Milvus] Saved %d points to collection %s\", n, collectionName)\n\t}\n\n\tlog.Infof(\"[Milvus] Successfully batch saved %d indices\", totalSaved)\n\treturn nil\n}\n\n// DeleteByChunkIDList removes points from the collection based on chunk IDs\nfunc (m *milvusRepository) DeleteByChunkIDList(ctx context.Context, chunkIDList []string, dimension int, knowledgeType string) error {\n\tlog := logger.GetLogger(ctx)\n\tif len(chunkIDList) == 0 {\n\t\tlog.Warn(\"[Milvus] Empty chunk ID list provided for deletion, skipping\")\n\t\treturn nil\n\t}\n\n\tcollectionName := m.getCollectionName(dimension)","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/repository/retriever/milvus/repository.go#L303-L339","documentation":"Milvus batch upsert failed for one dimension group: after collection ensure, the Upsert call for the prepared embedding list errored (network, schema, or quota), aborting the whole batched save for that dimension.","triggerScenarios":"Thrown at internal/application/repository/retriever/milvus/repository.go:321 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped Milvus error for schema/limit causes","Check connectivity and collection load state","Retry the batch or split it into smaller upserts"],"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"}