oraios/serena · error · SolidLSPException

Failed to download package {package_name} version {package_v

Error message

Failed to download package {package_name} version {package_version} from NuGet.org: {e}

What it means

Raised by _download_nuget_package when the actual download/extraction of the Roslyn NuGet package from NuGet.org throws; the original exception is wrapped in a SolidLSPException with the package name/version. It signals network or extraction failure against the direct NuGet.org endpoint.

Source

Thrown at src/solidlsp/language_servers/csharp_language_server.py:487

                log.warning("Using a short temporary directory for Roslyn package extraction because the configured cache path is too deep")
                package_extract_dir = Path(tempfile.mkdtemp(prefix="serena-roslyn-")) / package_extract_dir.name
            package_extract_dir.parent.mkdir(parents=True, exist_ok=True)

            try:
                log.debug(f"Downloading package from: {url}")
                FileUtils.download_and_extract_archive_verified(
                    url,
                    str(package_extract_dir),
                    "zip",
                    expected_sha256=dependency.sha256,
                    allowed_hosts=dependency.allowed_hosts,
                )

                log.info(f"Successfully downloaded and extracted {package_name} version {package_version} from NuGet.org")
                return package_extract_dir

            except Exception as e:
                raise SolidLSPException(f"Failed to download package {package_name} version {package_version} from NuGet.org: {e}") from e

    def _create_base_initialize_params(self) -> dict:
        """
        Returns the initialize params for the Microsoft.CodeAnalysis.LanguageServer.
        """
        return {
            "capabilities": {
                "window": {
                    "workDoneProgress": True,
                    "showMessage": {"messageActionItem": {"additionalPropertiesSupport": True}},
                    "showDocument": {"support": True},
                },
                "workspace": {
                    "applyEdit": True,
                    "workspaceEdit": {"documentChanges": True},
                    "didChangeConfiguration": {"dynamicRegistration": True},
                    "didChangeWatchedFiles": {"dynamicRegistration": True},
                    "symbol": {

View on GitHub (pinned to 7fcbca7e62)

Solutions

  1. Check network access to https://www.nuget.org (curl the package URL manually) and configure proxy env vars (HTTPS_PROXY) if needed
  2. Verify the package name/version exists on NuGet.org and retry — transient 5xx/rate-limit failures may pass on retry
  3. Free disk space / ensure the temp download dir is writable
  4. If NuGet.org is blocked, supply a reachable mirror URL in the dependency entry

Example fix

// before
$ curl -I https://www.nuget.org/api/v2/package/microsoft.codeanalysis.languageserver/4.x  # 403 (proxy)
// after
export HTTPS_PROXY=http://proxy.corp:8080
# then rerun setup
Defensive patterns

Strategy: retry

Validate before calling

import urllib.request
url = f"https://www.nuget.org/api/v2/package/{dep.package_name}/{dep.package_version}"
try:
    urllib.request.urlopen(url, timeout=15)
    print("NuGet.org reachable")
except Exception as e:
    print(f"NuGet.org unreachable, fix network/proxy first: {e}")

Type guard

def nuget_reachable(timeout: float = 15) -> bool:
    import urllib.request
    try:
        urllib.request.urlopen("https://www.nuget.org/", timeout=timeout)
        return True
    except OSError:
        return False

Try / catch

import time
for attempt in range(3):
    try:
        ls._ensure_server_installed()
        break
    except SolidLSPException as e:
        if "Failed to download package" in str(e) and attempt < 2:
            time.sleep(2 ** attempt)
            continue
        raise

Prevention

When it happens

Trigger: _ensure_language_server -> _download_nuget_package when the HTTP request to NuGet.org fails (connection error, timeout, 404/403) or archive extraction raises, for any of the calling contexts including the listed tests.

Common situations: Corporate proxies/firewalls blocking nuget.org, DNS failures, NuGet.org rate limiting or temporary outages, insufficient disk space during extraction, or the package/version URL returning 404.

Related errors


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