{"record":{"id":"de533dbe3c732d93","repo":"Tencent/WeKnora","slug":"generate-questions-prompt-not-configured","errorCode":null,"errorMessage":"generate questions prompt not configured","messagePattern":"generate questions prompt not configured","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/service/knowledge_process.go","lineNumber":1544,"sourceCode":"\n\t// Open the postprocess.question subspan now that we have payload.Attempt.\n\t// Closes via the defer above.\n\tqSpan = s.beginPostprocessSubspan(ctx, payload.KnowledgeID, payload.Attempt, \"postprocess.question\",\n\t\ttypes.JSONMap{\n\t\t\t\"question_count\": payload.QuestionCount,\n\t\t\t\"language\":       payload.Language,\n\t\t})\n\n\t// Set tenant context\n\tctx = context.WithValue(ctx, types.TenantIDContextKey, payload.TenantID)\n\tif payload.Language != \"\" {\n\t\tctx = context.WithValue(ctx, types.LanguageContextKey, payload.Language)\n\t}\n\n\tif strings.TrimSpace(s.config.Conversation.GenerateQuestionsPrompt) == \"\" {\n\t\texitStatus = \"prompt_not_configured\"\n\t\tlogger.Errorf(ctx, \"GenerateQuestionsPrompt is empty: configure conversation.generate_questions_prompt_id\")\n\t\tqErr = fmt.Errorf(\"generate questions prompt not configured\")\n\t\treturn qErr\n\t}\n\n\t// Get knowledge base\n\tkb, err := s.kbService.GetKnowledgeBaseByID(ctx, payload.KnowledgeBaseID)\n\tif err != nil {\n\t\texitStatus = \"kb_not_found\"\n\t\tlogger.Errorf(ctx, \"Failed to get knowledge base: %v\", err)\n\t\tqErr = err\n\t\treturn nil\n\t}\n\n\t// Get knowledge\n\tknowledge, err := s.repo.GetKnowledgeByID(ctx, payload.TenantID, payload.KnowledgeID)\n\tif err != nil {\n\t\texitStatus = \"knowledge_not_found\"\n\t\tlogger.Errorf(ctx, \"Failed to get knowledge: %v\", err)\n\t\tqErr = err","sourceCodeStart":1526,"sourceCodeEnd":1562,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/knowledge_process.go#L1526-L1562","documentation":"Configuration guard in processQuestionGenerationForKnowledge: the system-level Conversation.GenerateQuestionsPrompt is blank, so Doc2Query-style question generation cannot run. A deployment/configuration defect, not a data problem; the stage refuses to start rather than calling the LLM with an empty prompt.","triggerScenarios":"Thrown at internal/application/service/knowledge_process.go:1544 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set Conversation.GenerateQuestionsPrompt in service configuration","Redeploy/restart workers so the config is picked up","Re-trigger question generation for affected knowledge afterwards"],"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"}