{"record":{"id":"e0d9aa327e721543","repo":"Tencent/WeKnora","slug":"empty-embedding-vector-for-chunk-id-s-e0d9aa","errorCode":null,"errorMessage":"empty embedding vector for chunk ID: %s","messagePattern":"empty embedding vector for chunk ID: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/repository/retriever/milvus/repository.go","lineNumber":244,"sourceCode":"\t\ttotalStorageSize += m.calculateStorageSize(embeddingDB)\n\t}\n\tlogger.GetLogger(ctx).Infof(\n\t\t\"[Milvus] Storage size for %d indices: %d bytes\", len(indexInfoList), totalStorageSize,\n\t)\n\treturn totalStorageSize\n}\n\n// Save stores a single point in Milvus\nfunc (m *milvusRepository) Save(ctx context.Context,\n\tembedding *types.IndexInfo,\n\tadditionalParams map[string]any,\n) error {\n\tlog := logger.GetLogger(ctx)\n\tlog.Debugf(\"[Milvus] Saving index for chunk ID: %s\", embedding.ChunkID)\n\n\tembeddingDB := toMilvusVectorEmbedding(embedding, additionalParams)\n\tif len(embeddingDB.Embedding) == 0 {\n\t\terr := fmt.Errorf(\"empty embedding vector for chunk ID: %s\", embedding.ChunkID)\n\t\tlog.Errorf(\"[Milvus] %v\", err)\n\t\treturn err\n\t}\n\n\tdimension := len(embeddingDB.Embedding)\n\tif err := m.ensureCollection(ctx, dimension); err != nil {\n\t\treturn err\n\t}\n\n\tcollectionName := m.getCollectionName(dimension)\n\n\tembeddingDB.ID = uuid.New().String()\n\topts := createUpsert(collectionName, []*MilvusVectorEmbedding{embeddingDB})\n\n\t_, err := m.client.Upsert(ctx, opts)\n\tif err != nil {\n\t\tlog.Errorf(\"[Milvus] Failed to save index: %v\", err)\n\t\treturn err","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/repository/retriever/milvus/repository.go#L226-L262","documentation":"Milvus save guard: the converted embedding for the chunk has a zero-length vector (upstream embedding failure or unsupported content), so the point cannot be inserted into a fixed-dimension collection and the save is rejected.","triggerScenarios":"Thrown at internal/application/repository/retriever/milvus/repository.go:244 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the embedding pipeline produced a vector for this chunk","Skip non-embeddable chunks rather than inserting empties","Check embedding model/dimension configuration"],"exampleFix":null,"handlingStrategy":"validation","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"}