{"record":{"id":"caf01c2dde4dae72","repo":"HKUDS/DeepTutor","slug":"kb-kb-name-has-no-raw-directory-cannot-rei","errorCode":null,"errorMessage":"KB '{kb_name}' has no `raw/` directory; cannot reindex.","messagePattern":"KB '(.+?)' has no `raw/` directory; cannot reindex\\.","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"deeptutor/api/routers/knowledge.py","lineNumber":2790,"sourceCode":"async def run_reindex_task(kb_name: str, base_dir: str, task_id: str, signature_hash: str) -> None:\n    \"\"\"Re-index a KB's raw documents against the currently-active embedding config.\n\n    Each ``(profile, model, dimension, base_url)`` combination gets its own\n    flat ``<kb>/version-N/`` storage directory. Prior versions are preserved\n    untouched so switching the active embedding model back to a\n    previously-indexed one reuses the existing version with no extra work.\n    \"\"\"\n    task_manager = TaskIDManager.get_instance()\n    task_stream_manager = get_task_stream_manager()\n    task_stream_manager.ensure_task(task_id)\n\n    with capture_task_logs(task_id):\n        try:\n            base_path = Path(base_dir)\n            kb_dir = base_path / kb_name\n            raw_dir = kb_dir / \"raw\"\n            if not raw_dir.is_dir():\n                raise FileNotFoundError(f\"KB '{kb_name}' has no `raw/` directory; cannot reindex.\")\n            file_paths = [\n                str(path)\n                for path in FileTypeRouter.collect_supported_files(raw_dir, recursive=True)\n            ]\n            if not file_paths:\n                raise ValueError(f\"KB '{kb_name}' has no source files in `raw/` to reindex.\")\n\n            _task_log(\n                task_id,\n                f\"Re-indexing '{kb_name}' ({len(file_paths)} files) against signature {signature_hash}\",\n            )\n\n            progress_tracker = ProgressTracker(kb_name, base_path)\n            progress_tracker.task_id = task_id\n            progress_tracker.update(\n                ProgressStage.PROCESSING_DOCUMENTS,\n                message_key=\"Re-indexing {{count}} document(s) with the active embedding model...\",\n                message_params={\"count\": len(file_paths)},","sourceCodeStart":2772,"sourceCodeEnd":2808,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/api/routers/knowledge.py#L2772-L2808","documentation":"Error \"KB '{kb_name}' has no `raw/` directory; cannot reindex.\" thrown in HKUDS/DeepTutor.","triggerScenarios":"Thrown at deeptutor/api/routers/knowledge.py:2790 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}