{"record":{"id":"cef8e8a69ca31f56","repo":"oraios/serena","slug":"clangd-executable-not-found-at-clangd-executable","errorCode":null,"errorMessage":"Clangd executable not found at {clangd_executable_path}.\nMake sure you have installed clangd. See https://clangd.llvm.org/installation","messagePattern":"Clangd executable not found at (.+?)\\.\nMake sure you have installed clangd\\. See https://clangd\\.llvm\\.org/installation","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/clangd_language_server.py","lineNumber":304,"sourceCode":"                clangd_executable_path = shutil.which(\"clangd\")\n                if not clangd_executable_path:\n                    raise FileNotFoundError(\n                        \"Clangd is not installed on your system.\\n\"\n                        + \"Please install clangd using your system package manager:\\n\"\n                        + \"  Ubuntu/Debian: sudo apt-get install clangd\\n\"\n                        + \"  Fedora/RHEL: sudo dnf install clang-tools-extra\\n\"\n                        + \"  Arch Linux: sudo pacman -S clang\\n\"\n                        + \"See https://clangd.llvm.org/installation for more details.\"\n                    )\n                log.info(f\"Using system-installed clangd at {clangd_executable_path}\")\n            else:\n                # Standard download and install for platforms with prebuilt binaries\n                clangd_executable_path = deps.binary_path(clangd_ls_dir)\n                if not os.path.exists(clangd_executable_path):\n                    log.info(f\"Clangd executable not found at {clangd_executable_path}. Downloading from {dep.url}\")\n                    _ = deps.install(clangd_ls_dir)\n                if not os.path.exists(clangd_executable_path):\n                    raise FileNotFoundError(\n                        f\"Clangd executable not found at {clangd_executable_path}.\\n\"\n                        + \"Make sure you have installed clangd. See https://clangd.llvm.org/installation\"\n                    )\n                os.chmod(clangd_executable_path, 0o755)\n            return clangd_executable_path\n\n        def _create_launch_command(self, core_path: str) -> list[str]:\n            # --background-index enables clangd to index all files in the project,\n            # which is required for finding cross-file references\n            return [core_path, \"--background-index\"]\n\n    def _create_base_initialize_params(self) -> dict:\n        \"\"\"\n        Returns the initialize params for the clangd Language Server.\n        \"\"\"\n        initialize_params = {\n            \"locale\": \"en\",\n            \"capabilities\": {","sourceCodeStart":286,"sourceCodeEnd":322,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/clangd_language_server.py#L286-L322","documentation":"_get_or_install_core_dependency raises FileNotFoundError when the expected clangd executable still does not exist at clangd_executable_path even after deps.install downloaded and extracted the prebuilt binary. This means the managed install did not produce the binary at the expected location (deps.binary_path), typically due to a changed archive layout or failed extraction.","triggerScenarios":"Platform uses the standard prebuilt download path; deps.install(clangd_ls_dir) runs without raising, but the second os.path.exists(clangd_executable_path) check fails immediately afterwards.","commonSituations":"Upstream clangd release archive layout changed so the binary lands in a different subpath; corrupted/partial download extracted without the binary; disk space or permission problems during extraction; stale/corrupted install directory cache.","solutions":["Delete the managed clangd install directory (clangd_ls_dir) to force a clean download/re-extract and retry","Inspect the install directory to find where the binary was actually extracted and check the archive layout","Manually install clangd system-wide (apt/dnf/pacman per the related error) so the system-installed path is used","Update to a library version matching the current upstream clangd release layout"],"exampleFix":"// before\n# managed install fails to produce binary -> FileNotFoundError\nrm -rf ~/.cache/serena/language_servers/clangd*\n// after\n# restart server; clean managed install succeeds\nclangd --version","handlingStrategy":"retry","validationCode":"import os\nexpected = deps_binary_path(clangd_ls_dir)  # same path the library computes\nif not os.path.exists(expected):\n    print(\"clangd binary missing in managed dir; clear it to force re-download\")","typeGuard":null,"tryCatchPattern":"try:\n    server = ClangdLanguageServer(...)\nexcept FileNotFoundError as e:\n    if \"executable not found at\" in str(e):\n        shutil.rmtree(clangd_ls_dir, ignore_errors=True)\n        server = ClangdLanguageServer(...)  # clean managed reinstall\n    else:\n        raise","preventionTips":["Clear the managed clangd install directory after failed installs or library upgrades","Ensure sufficient disk space and write permissions in the resources/cache directory","Prefer a system-installed clangd when upstream archive layouts change"],"tags":["clangd","installation","archive-layout","download","cpp"],"backgroundTag":"language-server-binary-install-failed","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}