{"record":{"id":"25d984b68f33784c","repo":"oraios/serena","slug":"file-or-directory-not-found-abs-path","errorCode":null,"errorMessage":"File or directory not found: {abs_path}","messagePattern":"File or directory not found: (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/ls.py","lineNumber":2274,"sourceCode":"        return result\n\n    def request_document_overview(self, relative_file_path: str) -> list[UnifiedSymbolInformation]:\n        \"\"\"\n        :return: the top-level symbols in the given file.\n        \"\"\"\n        return self.request_document_symbols(relative_file_path).root_symbols\n\n    def request_overview(self, within_relative_path: str) -> dict[str, list[UnifiedSymbolInformation]]:\n        \"\"\"\n        An overview of all symbols in the given file or directory.\n        Raises a ValueError if a path to an ignored file is passed.\n\n        :param within_relative_path: the relative path to the file or directory to get the overview of.\n        :return: A mapping of all relative paths analyzed to lists of top-level symbols in the corresponding file.\n        \"\"\"\n        abs_path = (Path(self.repository_root_path) / within_relative_path).resolve()\n        if not abs_path.exists():\n            raise FileNotFoundError(f\"File or directory not found: {abs_path}\")\n\n        if abs_path.is_file():\n            if self.is_ignored_path(within_relative_path):\n                raise ValueError(f\"The explicitly passed file {within_relative_path} is ignored, not returning overview.\")\n            symbols_overview = self.request_document_overview(within_relative_path)\n            return {within_relative_path: symbols_overview}\n        else:\n            return self.request_dir_overview(within_relative_path)\n\n    def request_hover(\n        self, relative_file_path: str, line: int, column: int, file_buffer: LSPFileBuffer | None = None\n    ) -> ls_types.Hover | None:\n        \"\"\"\n        Raise a [textDocument/hover](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_hover) request to the Language Server\n        to find the hover information at the given line and column in the given file. Wait for the response and return the result.\n\n        :param relative_file_path: The relative path of the file that has the hover information\n        :param line: The line number of the symbol","sourceCodeStart":2256,"sourceCodeEnd":2292,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/ls.py#L2256-L2292","documentation":"FileNotFoundError raised by the overview-request API when the resolved absolute path (repository_root_path / within_relative_path) does not exist. Unlike [361] this variant resolves with pathlib and reports the resolved absolute path, but the cause is the same: the requested file or directory is missing.","triggerScenarios":"Calling the request_overview-style public method with a within_relative_path that resolves to a nonexistent file/directory — nonexistent path, absolute path misinterpreted as relative, or path deleted between listing and the call.","commonSituations":"Passing absolute filesystem paths where repo-relative are required, race conditions where files were deleted after a directory scan, branch switches removing files, typos in filenames.","solutions":["Check (Path(ls.repository_root_path) / rel_path).exists() before calling.","Normalize absolute inputs with os.path.relpath(abs, ls.repository_root_path) and reject out-of-repo paths.","Re-scan the repository to refresh stale paths before requesting overviews.","Verify filename spelling/case (Linux is case-sensitive)."],"exampleFix":"// before\nls.request_overview(\"/abs/path/other/repo/file.py\")  # absolute misused\n// after\nrel = os.path.relpath(\"/abs/path/other/repo/file.py\", ls.repository_root_path)\nif not rel.startswith(\"..\") and (Path(ls.repository_root_path) / rel).exists():\n    ls.request_overview(rel)","handlingStrategy":"validation","validationCode":"from pathlib import Path\nabs_p = (Path(ls.repository_root_path) / rel_path).resolve()\nif not abs_p.exists():\n    raise FileNotFoundError(f\"overview target missing: {abs_p}\")","typeGuard":"def overview_target_exists(root: str, rel: str) -> bool:\n    return (Path(root) / rel).resolve().exists()","tryCatchPattern":"try:\n    overview = ls.request_overview(rel_path)\nexcept FileNotFoundError as e:\n    logging.warning(\"cannot overview missing path: %s\", e)\n    overview = {}","preventionTips":["Always pass paths relative to repository_root_path","Resolve and check existence before calling","Refresh file listings after git operations","Handle case-sensitivity differences across OSes"],"tags":["filesystem","path","not-found","solidlsp"],"backgroundTag":"file-not-found","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}