{"record":{"id":"26525a45ff7a576f","repo":"Tencent/WeKnora","slug":"model-not-found","errorCode":null,"errorMessage":"model not found","messagePattern":"model not found","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"internal/application/service/model.go","lineNumber":24,"sourceCode":"\t\"fmt\"\n\t\"strings\"\n\n\tapperrors \"github.com/Tencent/WeKnora/internal/errors\"\n\t\"github.com/Tencent/WeKnora/internal/logger\"\n\t\"github.com/Tencent/WeKnora/internal/models/asr\"\n\t\"github.com/Tencent/WeKnora/internal/models/chat\"\n\t\"github.com/Tencent/WeKnora/internal/models/embedding\"\n\t\"github.com/Tencent/WeKnora/internal/models/provider\"\n\t\"github.com/Tencent/WeKnora/internal/models/rerank\"\n\t\"github.com/Tencent/WeKnora/internal/models/utils/ollama\"\n\t\"github.com/Tencent/WeKnora/internal/models/vlm\"\n\t\"github.com/Tencent/WeKnora/internal/types\"\n\t\"github.com/Tencent/WeKnora/internal/types/interfaces\"\n\t\"github.com/Tencent/WeKnora/internal/utils\"\n)\n\n// ErrModelNotFound is returned when a model cannot be found in the repository\nvar ErrModelNotFound = errors.New(\"model not found\")\n\n// modelService implements the model service interface\ntype modelService struct {\n\trepo          interfaces.ModelRepository\n\tkbRepo        interfaces.KnowledgeBaseRepository\n\tagentRepo     interfaces.CustomAgentRepository\n\tollamaService *ollama.OllamaService\n\tpooler        embedding.EmbedderPooler\n\ttenantService interfaces.TenantService\n}\n\n// NewModelService creates a new model service instance\nfunc NewModelService(repo interfaces.ModelRepository,\n\tkbRepo interfaces.KnowledgeBaseRepository,\n\tagentRepo interfaces.CustomAgentRepository,\n\tollamaService *ollama.OllamaService,\n\tpooler embedding.EmbedderPooler,\n\ttenantService interfaces.TenantService,","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/model.go#L6-L42","documentation":"Sentinel ErrModelNotFound returned by model service getters (GetModel, UpdateModel, delete paths) when the repository returns nil for the model id — no model config row exists. Distinguishes missing config from lookup errors; handlers map it to 404.","triggerScenarios":"Thrown at internal/application/service/model.go:24 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the model id; it may have been deleted or belong to another tenant","Create/register the model config before referencing it"],"exampleFix":null,"handlingStrategy":"type-guard","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"}