{"record":{"id":"2d758423e60d8471","repo":"odysseus-dev/odysseus","slug":"failed-to-index-directory","errorCode":null,"errorMessage":"Failed to index directory","messagePattern":"Failed to index directory","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"routes/personal_routes.py","lineNumber":224,"sourceCode":"            \n            # Use the RAGManager to index the directory\n            rag = _rag()\n            if rag:\n                result = rag.index_personal_documents(directory, owner=owner)\n                \n                if result[\"success\"]:\n                    # Also update the personal_docs_manager to track this directory\n                    personal_docs_manager.add_directory(directory, index=False)\n                    \n                    return {\n                        \"success\": True,\n                        \"message\": f\"Successfully indexed {result['indexed_count']} chunks from {directory}\",\n                        \"indexed_count\": result[\"indexed_count\"],\n                        \"failed_count\": result.get(\"failed_count\", 0),\n                        \"directory\": directory\n                    }\n                else:\n                    raise HTTPException(500, result.get(\"message\", \"Failed to index directory\"))\n            else:\n                raise HTTPException(503, \"RAG system is not available\")\n                \n        except HTTPException:\n            raise\n        except Exception as e:\n            logger.error(f\"Error adding directory to RAG: {e}\")\n            raise HTTPException(500, f\"Failed to add directory: {str(e)}\")\n    \n    @router.delete(\"/remove_directory\")\n    async def remove_directory_from_rag(directory: str = Query(...), owner: str = Depends(require_user), _admin: None = Depends(require_admin)):\n        \"\"\"\n        Remove a directory from the RAG index.\n\n        Args:\n            directory: Path to the directory to remove\n\n        Returns:","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/personal_routes.py#L206-L242","documentation":"Error \"Failed to index directory\" thrown in odysseus-dev/odysseus.","triggerScenarios":"Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.","commonSituations":"See trigger scenarios.","solutions":["Check server logs for the indexing error and retry.","Verify the RAG/embedding service is running before indexing."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}