{"record":{"id":"e6c4731fc9f27ba7","repo":"Tencent/WeKnora","slug":"failed-to-load-collection-w","errorCode":null,"errorMessage":"failed to load collection: %w","messagePattern":"failed to load collection: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/repository/retriever/milvus/repository.go","lineNumber":199,"sourceCode":"\t\t\tcreateOpt = createOpt.WithShardNum(int32(m.shardsNum))\n\t\t}\n\t\terr = m.client.CreateCollection(ctx, createOpt)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"[Milvus] Failed to create collection: %v\", err)\n\t\t\treturn fmt.Errorf(\"failed to create collection: %w\", err)\n\t\t}\n\n\t\tlog.Infof(\"[Milvus] Successfully created collection %s\", collectionName)\n\t}\n\n\tloadOpt := client.NewLoadCollectionOption(collectionName)\n\tif m.replicaNumber > 0 {\n\t\tloadOpt = loadOpt.WithReplica(m.replicaNumber)\n\t}\n\tloadTask, err := m.client.LoadCollection(ctx, loadOpt)\n\tif err != nil {\n\t\tlog.Errorf(\"[Milvus] Failed to load collection: %v\", err)\n\t\treturn fmt.Errorf(\"failed to load collection: %w\", err)\n\t}\n\tif err := loadTask.Await(ctx); err != nil {\n\t\tlog.Errorf(\"[Milvus] Failed to await load collection: %v\", err)\n\t\treturn fmt.Errorf(\"failed to await load collection: %w\", err)\n\t}\n\n\t// Mark as initialized\n\tm.initializedCollections.Store(dimension, true)\n\treturn nil\n}\n\nfunc (m *milvusRepository) EngineType() types.RetrieverEngineType {\n\treturn types.MilvusRetrieverEngineType\n}\n\nfunc (m *milvusRepository) Support() []types.RetrieverType {\n\treturn []types.RetrieverType{types.KeywordsRetrieverType, types.VectorRetrieverType}\n}","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/repository/retriever/milvus/repository.go#L181-L217","documentation":"Milvus collection bootstrap failed at LoadCollection: the collection exists (or was created) but could not be loaded into memory for searching, so the repository aborts before performing writes that assume a queryable collection.","triggerScenarios":"Thrown at internal/application/repository/retriever/milvus/repository.go:199 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check Milvus query-node memory and load limits","Verify replica/shard configuration","Retry the load after cluster resources free up"],"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-08T15:18:49.778Z"}