{"record":{"id":"a39c916158386547","repo":"odysseus-dev/odysseus","slug":"path-is-not-a-directory-directory","errorCode":null,"errorMessage":"Path is not a directory: {directory}","messagePattern":"Path is not a directory: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"routes/personal_routes.py","lineNumber":203,"sourceCode":"        \"\"\"\n        Add a directory and all its subdirectories/files to the RAG index.\n        \n        Args:\n            directory_request: Directory request model containing the directory path\n            \n        Returns:\n            JSON response with indexing results\n        \"\"\"\n        directory = directory_request.directory\n        try:\n            directory = _resolve_allowed_personal_dir(directory)\n            \n            # Security check - ensure directory exists and is accessible\n            if not os.path.exists(directory):\n                raise HTTPException(404, f\"Directory not found: {directory}\")\n            \n            if not os.path.isdir(directory):\n                raise HTTPException(400, f\"Path is not a directory: {directory}\")\n            \n            logger.info(f\"Adding directory to RAG: {directory}\")\n            \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","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/personal_routes.py#L185-L221","documentation":"Error \"Path is not a directory: {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":["Point the request at a directory, not a file.","Check the path for a typo."],"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"}