{"record":{"id":"d79a6b135d21c6b5","repo":"Tencent/WeKnora","slug":"failed-to-get-tenant-info-w","errorCode":null,"errorMessage":"failed to get tenant info: %w","messagePattern":"failed to get tenant info: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/service/knowledge_process.go","lineNumber":1333,"sourceCode":"\t\t\tStartAt:         0,\n\t\t\tEndAt:           0,\n\t\t\tChunkType:       types.ChunkTypeSummary,\n\t\t\tParentChunkID:   textChunks[0].ID,\n\t\t}\n\n\t\t// Save summary chunk\n\t\tif err := s.chunkService.CreateChunks(ctx, []*types.Chunk{summaryChunk}); err != nil {\n\t\t\tlogger.Errorf(ctx, \"Failed to create summary chunk: %v\", err)\n\t\t\tsummaryErr = err\n\t\t\treturn fmt.Errorf(\"failed to create summary chunk: %w\", err)\n\t\t}\n\n\t\t// Index summary chunk\n\t\ttenantInfo, err := s.tenantRepo.GetTenantByID(ctx, payload.TenantID)\n\t\tif err != nil {\n\t\t\tlogger.Errorf(ctx, \"Failed to get tenant info: %v\", err)\n\t\t\tsummaryErr = err\n\t\t\treturn fmt.Errorf(\"failed to get tenant info: %w\", err)\n\t\t}\n\t\tctx = context.WithValue(ctx, types.TenantInfoContextKey, tenantInfo)\n\n\t\tretrieveEngine, err := retriever.CreateRetrieveEngineForKB(\n\t\t\tctx, s.retrieveEngine, s.ownership, tenantInfo.ID, kb.VectorStoreID)\n\t\tif err != nil {\n\t\t\tlogger.Errorf(ctx, \"Failed to init retrieve engine: %v\", err)\n\t\t\tsummaryErr = err\n\t\t\treturn fmt.Errorf(\"failed to init retrieve engine: %w\", err)\n\t\t}\n\n\t\tembeddingModel, err := s.modelService.GetEmbeddingModel(ctx, kb.EmbeddingModelID)\n\t\tif err != nil {\n\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","sourceCodeStart":1315,"sourceCodeEnd":1351,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/knowledge_process.go#L1315-L1351","documentation":"Thrown when tenantRepo.GetTenantByID fails while loading tenant info needed to index the summary chunk into the vector store. Blocks the embedding/reindex step, after the summary chunk row was already created.","triggerScenarios":"Thrown at internal/application/service/knowledge_process.go:1333 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check tenant repository availability and retry","Verify the payload tenant ID exists and is active","The summary chunk is persisted; a later regeneration/reindex can complete indexing"],"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"}