{"record":{"id":"172b87bfbc48d809","repo":"HKUDS/DeepTutor","slug":"kb-kb-name-has-no-source-files-in-raw-to-re","errorCode":null,"errorMessage":"KB '{kb_name}' has no source files in `raw/` to reindex.","messagePattern":"KB '(.+?)' has no source files in `raw/` to reindex\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"deeptutor/api/routers/knowledge.py","lineNumber":2796,"sourceCode":"    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)},\n                current=0,\n                total=len(file_paths),\n            )\n\n            from deeptutor.services.rag.service import RAGService\n","sourceCodeStart":2778,"sourceCodeEnd":2814,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/api/routers/knowledge.py#L2778-L2814","documentation":"Error \"KB '{kb_name}' has no source files in `raw/` to reindex.\" thrown in HKUDS/DeepTutor.","triggerScenarios":"Thrown at deeptutor/api/routers/knowledge.py:2796 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"}