oraios/serena · error · SolidLSPException

Error downloading file.

Error message

Error downloading file.

What it means

SolidLSPException raised by FileUtils.download_file_verified (src/solidlsp/ls_utils.py:461) when the HTTP response for a language-server download has a status code other than 200. The status and body are logged; the public message is deliberately generic.

Source

Thrown at src/solidlsp/ls_utils.py:461

        expected_sha256: str | None = None,
        allowed_hosts: Sequence[str] | None = None,
    ) -> None:
        """
        Downloads a file from ``url`` to ``target_path`` with optional integrity and host validation.
        """
        # validating the requested host
        FileUtils._validate_download_host(url, allowed_hosts)

        # streaming the download into a temporary file
        target_directory = os.path.dirname(target_path) or "."
        os.makedirs(target_directory, exist_ok=True)
        temp_file_path = str(PurePath(target_directory, f".{Path(target_path).name}.{uuid.uuid4().hex}.download"))
        response: requests.Response | None = None
        try:
            response = requests.get(url, stream=True, timeout=60)
            if response.status_code != 200:
                log.error(f"Error downloading file '{url}': {response.status_code} {response.text}")
                raise SolidLSPException("Error downloading file.")

            FileUtils._validate_download_host(response.url, allowed_hosts)

            with open(temp_file_path, "wb") as output_file:
                for chunk in response.iter_content(chunk_size=1024 * 1024):
                    if chunk:
                        output_file.write(chunk)

            FileUtils._verify_sha256_if_configured(temp_file_path, expected_sha256)

            os.replace(temp_file_path, target_path)
        except Exception as exc:
            log.error(f"Error downloading file '{url}': {exc}")
            raise SolidLSPException("Error downloading file.") from None
        finally:
            if response is not None:
                response.close()
            if os.path.exists(temp_file_path):

View on GitHub (pinned to 7fcbca7e62)

Solutions

  1. Check the logged status code and URL in the error output to see whether it's 404/403/5xx.
  2. Update to a library version whose download URLs point at existing releases.
  3. Retry later if rate-limited (403/429) or use an authenticated mirror.
  4. Manually download the artifact to the expected target path to bypass the download step.

Example fix

// before
FileUtils.download_file_verified(url, target_dir)  # url 404s
// after
resp = requests.head(url, timeout=60)
if resp.status_code != 200:
    url = fallback_mirror_url(version)
FileUtils.download_file_verified(url, target_dir)
Defensive patterns

Strategy: retry

Validate before calling

def url_reachable(url: str) -> bool:
    try:
        return requests.head(url, timeout=10, allow_redirects=True).status_code == 200
    except requests.RequestException:
        return False

Type guard

def is_download_status_error(exc: BaseException) -> bool:
    return isinstance(exc, SolidLSPException) and str(exc) == "Error downloading file."

Try / catch

for delay in (1, 5, 30):
    try:
        FileUtils.download_file_verified(url, target_dir)
        break
    except SolidLSPException:
        time.sleep(delay)
else:
    raise RuntimeError(f"download kept failing: {url}")

Prevention

When it happens

Trigger: Downloading a language server/runtime archive or auxiliary file when the URL 404s (version removed/renamed), returns 403 (blocked/rate-limited), or 5xx from the CDN/host.

Common situations: Pinned download URLs broken after upstream release changes; corporate proxies intercepting with non-200 responses; GitHub rate limiting; retired binary hosting locations.

Related errors


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