{"record":{"id":"83b6fe44f1e62c8e","repo":"oraios/serena","slug":"failed-to-download-package-package-name-version","errorCode":null,"errorMessage":"Failed to download package {package_name} version {package_version} from NuGet.org: {e}","messagePattern":"Failed to download package (.+?) version (.+?) from NuGet\\.org: (.+?)","errorType":"exception","errorClass":"SolidLSPException","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/csharp_language_server.py","lineNumber":487,"sourceCode":"                log.warning(\"Using a short temporary directory for Roslyn package extraction because the configured cache path is too deep\")\n                package_extract_dir = Path(tempfile.mkdtemp(prefix=\"serena-roslyn-\")) / package_extract_dir.name\n            package_extract_dir.parent.mkdir(parents=True, exist_ok=True)\n\n            try:\n                log.debug(f\"Downloading package from: {url}\")\n                FileUtils.download_and_extract_archive_verified(\n                    url,\n                    str(package_extract_dir),\n                    \"zip\",\n                    expected_sha256=dependency.sha256,\n                    allowed_hosts=dependency.allowed_hosts,\n                )\n\n                log.info(f\"Successfully downloaded and extracted {package_name} version {package_version} from NuGet.org\")\n                return package_extract_dir\n\n            except Exception as e:\n                raise SolidLSPException(f\"Failed to download package {package_name} version {package_version} from NuGet.org: {e}\") from e\n\n    def _create_base_initialize_params(self) -> dict:\n        \"\"\"\n        Returns the initialize params for the Microsoft.CodeAnalysis.LanguageServer.\n        \"\"\"\n        return {\n            \"capabilities\": {\n                \"window\": {\n                    \"workDoneProgress\": True,\n                    \"showMessage\": {\"messageActionItem\": {\"additionalPropertiesSupport\": True}},\n                    \"showDocument\": {\"support\": True},\n                },\n                \"workspace\": {\n                    \"applyEdit\": True,\n                    \"workspaceEdit\": {\"documentChanges\": True},\n                    \"didChangeConfiguration\": {\"dynamicRegistration\": True},\n                    \"didChangeWatchedFiles\": {\"dynamicRegistration\": True},\n                    \"symbol\": {","sourceCodeStart":469,"sourceCodeEnd":505,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/csharp_language_server.py#L469-L505","documentation":"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.","triggerScenarios":"_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.","commonSituations":"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.","solutions":["Check network access to https://www.nuget.org (curl the package URL manually) and configure proxy env vars (HTTPS_PROXY) if needed","Verify the package name/version exists on NuGet.org and retry — transient 5xx/rate-limit failures may pass on retry","Free disk space / ensure the temp download dir is writable","If NuGet.org is blocked, supply a reachable mirror URL in the dependency entry"],"exampleFix":"// before\n$ curl -I https://www.nuget.org/api/v2/package/microsoft.codeanalysis.languageserver/4.x  # 403 (proxy)\n// after\nexport HTTPS_PROXY=http://proxy.corp:8080\n# then rerun setup","handlingStrategy":"retry","validationCode":"import urllib.request\nurl = f\"https://www.nuget.org/api/v2/package/{dep.package_name}/{dep.package_version}\"\ntry:\n    urllib.request.urlopen(url, timeout=15)\n    print(\"NuGet.org reachable\")\nexcept Exception as e:\n    print(f\"NuGet.org unreachable, fix network/proxy first: {e}\")\n","typeGuard":"def nuget_reachable(timeout: float = 15) -> bool:\n    import urllib.request\n    try:\n        urllib.request.urlopen(\"https://www.nuget.org/\", timeout=timeout)\n        return True\n    except OSError:\n        return False\n","tryCatchPattern":"import time\nfor attempt in range(3):\n    try:\n        ls._ensure_server_installed()\n        break\n    except SolidLSPException as e:\n        if \"Failed to download package\" in str(e) and attempt < 2:\n            time.sleep(2 ** attempt)\n            continue\n        raise\n","preventionTips":["Configure HTTPS_PROXY/HTTP_PROXY in environments behind corporate proxies","Retry transient NuGet failures with exponential backoff","Free adequate disk space before large package downloads","Pin package versions that exist on NuGet.org to avoid 404s"],"tags":["csharp","nuget","network","download"],"backgroundTag":"download-failed","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}