{"record":{"id":"661bd645eb9cd921","repo":"odysseus-dev/odysseus","slug":"failed-to-remove-directory-str-e","errorCode":null,"errorMessage":"Failed to remove directory: {str(e)}","messagePattern":"Failed to remove directory: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"routes/personal_routes.py","lineNumber":276,"sourceCode":"            # Remove from RAG vector store (best-effort)\n            rag = _rag()\n            if rag:\n                try:\n                    rag.remove_directory(directory)\n                except Exception as e:\n                    logger.warning(f\"RAG removal failed for directory {directory}: {e}\")\n\n            return {\n                \"success\": True,\n                \"message\": f\"Successfully removed {directory} from RAG index\",\n                \"directory\": directory\n            }\n\n        except HTTPException:\n            raise\n        except Exception as e:\n            logger.error(f\"Error removing directory from RAG: {e}\")\n            raise HTTPException(500, f\"Failed to remove directory: {str(e)}\")\n    \n    @router.post(\"/upload\")\n    async def upload_files_to_rag(request: Request, files: List[UploadFile] = File(...)):\n        \"\"\"Upload files directly into RAG. Supports text and PDF.\"\"\"\n        user = require_privilege(request, \"can_use_documents\")\n        rag = _rag()\n        if not rag:\n            raise HTTPException(503, \"RAG system is not available — is the embedding service running?\")\n\n        upload_dir = _personal_upload_dir_for_owner(user)\n\n        total_indexed = 0\n        total_failed = 0\n        uploaded_files = []\n\n        for upload in files:\n            try:\n                file_path, stored_name, safe_name = _unique_personal_upload_path(upload_dir, upload.filename)","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/personal_routes.py#L258-L294","documentation":"Error \"Failed to remove directory: {str(e)}\" 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 underlying error and retry.","Verify the directory entry still exists before removing it."],"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-15T17:31:12.345Z"}