oraios/serena · error · FileNotFoundError

Download failed? Could not find clojure-lsp executable at {c

Error message

Download failed? Could not find clojure-lsp executable at {clojurelsp_executable_path}

What it means

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.

Source

Thrown at src/solidlsp/language_servers/clojure_lsp.py:275

            verify_clojure_cli()
            clojure_lsp_version = self._custom_settings.get("clojure_lsp_version", DEFAULT_CLOJURE_LSP_VERSION)
            deps = ClojureLSP._runtime_dependencies(clojure_lsp_version)
            dependency = deps.get_single_dep_for_current_platform()

            # legacy unversioned dir reserved for INITIAL; every other version goes into a versioned subdir
            install_dir = (
                self._ls_resources_dir
                if clojure_lsp_version == INITIAL_CLOJURE_LSP_VERSION
                else os.path.join(self._ls_resources_dir, f"clojure-lsp-{clojure_lsp_version}")
            )
            clojurelsp_executable_path = deps.binary_path(install_dir)
            if not os.path.exists(clojurelsp_executable_path):
                log.info(
                    f"Downloading and extracting clojure-lsp from {dependency.url} to {install_dir}",
                )
                deps.install(install_dir)
            if not os.path.exists(clojurelsp_executable_path):
                raise FileNotFoundError(f"Download failed? Could not find clojure-lsp executable at {clojurelsp_executable_path}")
            os.chmod(clojurelsp_executable_path, 0o755)
            return clojurelsp_executable_path

        def _create_launch_command(self, core_path: str) -> list[str]:
            return [core_path]

    def _resolve_source_paths(self) -> list[str] | None:
        """Determines whether to inject ``source-paths`` into clojure-lsp's init options.

        :return: the list of repo-root-relative source paths to inject, or ``None`` to inject
            nothing (because clojure-lsp will read the project's own ``.lsp/config.edn`` natively).
            See the class docstring for the precedence order.
        """
        # explicit user override of source paths wins outright
        explicit_paths = self._custom_settings.get("source_paths")
        if explicit_paths:
            log.info(f"clojure-lsp source-paths from user setting 'source_paths': {explicit_paths}")
            return list(explicit_paths)

View on GitHub (pinned to 7fcbca7e62)

Solutions

  1. Delete the install/cache directory and re-run so deps.install downloads and extracts fresh
  2. Check logs for the extraction step and verify the artifact URL manually (download + inspect the archive layout)
  3. Check disk space and write permissions on the install directory
  4. Pin/verify the dependency URL matches a release that contains the expected executable name

Example fix

// before
rm -rf ~/.cache/serena/language_servers/clojure-lsp
// rerun; if it persists, inspect the archive:
curl -L -o clj-lsp.zip <dependency.url> && unzip -l clj-lsp.zip
// after: confirm the binary name/path inside the zip matches expected clojurelsp_executable_path
Defensive patterns

Strategy: retry

Validate before calling

import os
url = dep["url"]
install_dir = "/tmp/clj-lsp-test"
os.makedirs(install_dir, exist_ok=True)
# preflight: ensure URL is reachable and archive contains the expected binary
import urllib.request
with urllib.request.urlopen(url) as r:
    head = r.read(4)
assert head[:2] in (b"PK", b"\x1f\x8b"), "URL did not return a zip/tar artifact"

Type guard

def clojure_lsp_installed(path: str) -> bool:
    return os.path.isfile(path) and os.access(path, os.X_OK)

Try / catch

try:
    path = ClojureLSP._get_or_install_core_dependency()
except FileNotFoundError as e:
    shutil.rmtree(install_dir, ignore_errors=True)  # clear partial install
    path = ClojureLSP._get_or_install_core_dependency()  # one clean retry
    if not clojure_lsp_installed(path):
        raise RuntimeError(f"clojure-lsp still missing: {e}") from e

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of oraios/serena@7fcbca7e62 (2026-08-29). Data as JSON: /api/errors/5ec545a90f801ed9. Report an issue: GitHub.