{"record":{"id":"5ec545a90f801ed9","repo":"oraios/serena","slug":"download-failed-could-not-find-clojure-lsp-execut","errorCode":null,"errorMessage":"Download failed? Could not find clojure-lsp executable at {clojurelsp_executable_path}","messagePattern":"Download failed\\? Could not find clojure-lsp executable at (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/clojure_lsp.py","lineNumber":275,"sourceCode":"            verify_clojure_cli()\n            clojure_lsp_version = self._custom_settings.get(\"clojure_lsp_version\", DEFAULT_CLOJURE_LSP_VERSION)\n            deps = ClojureLSP._runtime_dependencies(clojure_lsp_version)\n            dependency = deps.get_single_dep_for_current_platform()\n\n            # legacy unversioned dir reserved for INITIAL; every other version goes into a versioned subdir\n            install_dir = (\n                self._ls_resources_dir\n                if clojure_lsp_version == INITIAL_CLOJURE_LSP_VERSION\n                else os.path.join(self._ls_resources_dir, f\"clojure-lsp-{clojure_lsp_version}\")\n            )\n            clojurelsp_executable_path = deps.binary_path(install_dir)\n            if not os.path.exists(clojurelsp_executable_path):\n                log.info(\n                    f\"Downloading and extracting clojure-lsp from {dependency.url} to {install_dir}\",\n                )\n                deps.install(install_dir)\n            if not os.path.exists(clojurelsp_executable_path):\n                raise FileNotFoundError(f\"Download failed? Could not find clojure-lsp executable at {clojurelsp_executable_path}\")\n            os.chmod(clojurelsp_executable_path, 0o755)\n            return clojurelsp_executable_path\n\n        def _create_launch_command(self, core_path: str) -> list[str]:\n            return [core_path]\n\n    def _resolve_source_paths(self) -> list[str] | None:\n        \"\"\"Determines whether to inject ``source-paths`` into clojure-lsp's init options.\n\n        :return: the list of repo-root-relative source paths to inject, or ``None`` to inject\n            nothing (because clojure-lsp will read the project's own ``.lsp/config.edn`` natively).\n            See the class docstring for the precedence order.\n        \"\"\"\n        # explicit user override of source paths wins outright\n        explicit_paths = self._custom_settings.get(\"source_paths\")\n        if explicit_paths:\n            log.info(f\"clojure-lsp source-paths from user setting 'source_paths': {explicit_paths}\")\n            return list(explicit_paths)","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/clojure_lsp.py#L257-L293","documentation":"Raised by _get_or_install_core_dependency after deps.install() ran (or was skipped) but the expected clojure-lsp executable still does not exist at the expected path. It indicates the runtime-dependency download/extraction step did not produce the binary where the installer predicted it would.","triggerScenarios":"ClojureLSP._get_or_install_core_dependency when os.path.exists(clojurelsp_executable_path) is False even after calling deps.install(install_dir) — e.g. the archive layout changed upstream, extraction failed silently, or the wrong install_dir was used.","commonSituations":"Upstream clojure-lsp release renamed/moved its binary, network proxies serving an error page instead of the zip, disk-full or permission issues during extraction, or a platform-specific dependency URL pointing at an artifact with a different internal layout.","solutions":["Delete the install/cache directory and re-run so deps.install downloads and extracts fresh","Check logs for the extraction step and verify the artifact URL manually (download + inspect the archive layout)","Check disk space and write permissions on the install directory","Pin/verify the dependency URL matches a release that contains the expected executable name"],"exampleFix":"// before\nrm -rf ~/.cache/serena/language_servers/clojure-lsp\n// rerun; if it persists, inspect the archive:\ncurl -L -o clj-lsp.zip <dependency.url> && unzip -l clj-lsp.zip\n// after: confirm the binary name/path inside the zip matches expected clojurelsp_executable_path","handlingStrategy":"retry","validationCode":"import os\nurl = dep[\"url\"]\ninstall_dir = \"/tmp/clj-lsp-test\"\nos.makedirs(install_dir, exist_ok=True)\n# preflight: ensure URL is reachable and archive contains the expected binary\nimport urllib.request\nwith urllib.request.urlopen(url) as r:\n    head = r.read(4)\nassert head[:2] in (b\"PK\", b\"\\x1f\\x8b\"), \"URL did not return a zip/tar artifact\"\n","typeGuard":"def clojure_lsp_installed(path: str) -> bool:\n    return os.path.isfile(path) and os.access(path, os.X_OK)\n","tryCatchPattern":"try:\n    path = ClojureLSP._get_or_install_core_dependency()\nexcept FileNotFoundError as e:\n    shutil.rmtree(install_dir, ignore_errors=True)  # clear partial install\n    path = ClojureLSP._get_or_install_core_dependency()  # one clean retry\n    if not clojure_lsp_installed(path):\n        raise RuntimeError(f\"clojure-lsp still missing: {e}\") from e\n","preventionTips":["Pin clojure-lsp to a known-good release whose archive layout matches the expected executable path","Clear the install/cache directory after failed installs before retrying","Check network/proxy health if downloads keep producing bad artifacts","Monitor disk space on the machine running installs"],"tags":["download","installation","clojure","missing-file"],"backgroundTag":"download-artifact-missing","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}