{"record":{"id":"8c61d57541410791","repo":"HKUDS/DeepTutor","slug":"question-extraction-output-not-found","errorCode":null,"errorMessage":"Question extraction output not found","messagePattern":"Question extraction output not found","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"deeptutor/agents/question/mimic_source.py","lineNumber":125,"sourceCode":"        # Shared parse layer: cached + engine-pluggable (the active engine is\n        # selected in Settings → Document Parsing). Returns the cache dir with\n        # the parsed artifacts; the questions JSON goes to the session output\n        # dir so it never pollutes the shared parse cache.\n        doc = get_parse_service().parse(paper_path, on_output=progress_callback)\n        working_dir = doc.workdir or paper_path\n        questions_dir = output_base\n\n    json_files = list(questions_dir.glob(\"*_questions.json\"))\n    if not json_files:\n        ok = extract_questions_from_paper(\n            str(working_dir),\n            output_dir=None if questions_dir == working_dir else str(questions_dir),\n        )\n        if not ok:\n            raise RuntimeError(\"Failed to extract questions from parsed exam\")\n        json_files = list(questions_dir.glob(\"*_questions.json\"))\n    if not json_files:\n        raise RuntimeError(\"Question extraction output not found\")\n\n    with json_files[0].open(encoding=\"utf-8\") as fh:\n        payload = json.load(fh)\n    questions = payload.get(\"questions\") or []\n    if max_questions > 0:\n        questions = questions[:max_questions]\n\n    templates: list[QuizTemplate] = []\n    for idx, item in enumerate(questions, 1):\n        if not isinstance(item, dict):\n            continue\n        q_text = str(item.get(\"question_text\") or \"\").strip()\n        if not q_text:\n            continue\n        templates.append(\n            QuizTemplate(\n                question_id=f\"q_{idx}\",\n                topic=q_text[:_TOPIC_CLIP_CHARS],","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/agents/question/mimic_source.py#L107-L143","documentation":"Raised by _parse_sync when no *_questions.json file exists in questions_dir even after running extract_questions_from_paper. Distinct from extraction failure: the extractor ran but wrote nothing (or wrote outside the expected output_base directory).","triggerScenarios":"Thrown at deeptutor/agents/question/mimic_source.py:125 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify extract_questions_from_paper returned success and where it wrote its output","Check output_base permissions and disk space","Ensure the extractor's output filename convention matches the *_questions.json glob","Re-run with logging enabled to see whether extraction found any questions"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","contentChangedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}