{"record":{"id":"4f85290408840c8c","repo":"oraios/serena","slug":"failed-to-download-taplo-from-download-url-try","errorCode":null,"errorMessage":"Failed to download Taplo from {download_url}. Try installing manually: cargo install taplo-cli --locked","messagePattern":"Failed to download Taplo from (.+?)\\. Try installing manually: cargo install taplo-cli --locked","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/taplo_server.py","lineNumber":206,"sourceCode":"                archive_type = \"zip\" if archive_filename.endswith(\".zip\") else \"gz\"\n                target_path = install_dir if archive_type == \"zip\" else executable_path\n                FileUtils.download_and_extract_archive_verified(\n                    download_url,\n                    target_path,\n                    archive_type,\n                    expected_sha256=expected_hash,\n                    allowed_hosts=TAPLO_ALLOWED_HOSTS,\n                )\n\n                # Make executable on Unix systems\n                if os.name != \"nt\":\n                    os.chmod(executable_path, os.stat(executable_path).st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)\n\n                log.info(f\"Taplo installed successfully at: {executable_path}\")\n\n            except Exception as e:\n                log.error(f\"Failed to download Taplo: {e}\")\n                raise RuntimeError(\n                    f\"Failed to download Taplo from {download_url}. Try installing manually: cargo install taplo-cli --locked\"\n                ) from e\n\n    def _create_base_initialize_params(self) -> dict:\n        \"\"\"\n        Returns the initialize params for the Taplo Language Server.\n        \"\"\"\n        initialize_params = {\n            \"locale\": \"en\",\n            \"capabilities\": {\n                \"textDocument\": {\n                    \"synchronization\": {\"didSave\": True, \"dynamicRegistration\": True},\n                    \"completion\": {\"dynamicRegistration\": True, \"completionItem\": {\"snippetSupport\": True}},\n                    \"definition\": {\"dynamicRegistration\": True},\n                    \"references\": {\"dynamicRegistration\": True},\n                    \"documentSymbol\": {\n                        \"dynamicRegistration\": True,\n                        \"hierarchicalDocumentSymbolSupport\": True,","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/taplo_server.py#L188-L224","documentation":"_download_taplo wraps the whole verified-download-and-extract step in a try/except; if any part fails (network error, 404, corrupt archive, checksum mismatch, extraction failure, missing chmod), it re-raises as RuntimeError with the download URL and the manual-install hint, chaining the original exception. This converts low-level download failures into a single actionable message.","triggerScenarios":"Auto-install of Taplo runs (binary not on PATH) and FileUtils.download_and_extract_archive_verified raises: unreachable URL, HTTP error, checksum mismatch, unsupported archive format, or extraction into install_dir failing.","commonSituations":"Corporate proxies/firewalls blocking GitHub release downloads; offline CI runners; transient network failures; Taplo releasing a new version that removes the pinned archive URL (404); insufficient disk space or write permissions in the install dir.","solutions":["Read the chained exception (raise ... from e) to see the root cause — check network/proxy access to the download_url printed in the message.","Install Taplo manually: `cargo install taplo-cli --locked`, or download the binary from GitHub releases and add it to PATH.","Retry after transient network issues — the install dir is re-created/re-attempted on next server start.","Pin to an existing Taplo version whose release assets still exist, if the failure was a 404 on the pinned archive."],"exampleFix":"// before: failing behind a corporate proxy\nls = SolidLanguageServer.create(\"taplo\")  # RuntimeError: Failed to download Taplo from https://...\n// after: pre-install so no download is attempted\nexport PATH=\"$HOME/.cargo/bin:$PATH\"  # after `cargo install taplo-cli --locked`\nls = SolidLanguageServer.create(\"taplo\")","handlingStrategy":"try-catch","validationCode":"import shutil, subprocess\nif shutil.which(\"taplo\") is None:\n    url_ok = subprocess.run([\"curl\", \"-sfIL\", \"https://github.com/tamasfe/taplo/releases\"], capture_output=True).returncode == 0\n    if not url_ok:\n        subprocess.run([\"cargo\", \"install\", \"taplo-cli\", \"--locked\"], check=True)  # pre-install when downloads are blocked","typeGuard":null,"tryCatchPattern":"try:\n    server = SolidLanguageServer.create(\"taplo\")\nexcept RuntimeError as e:\n    if \"Failed to download Taplo\" in str(e):\n        subprocess.run([\"cargo\", \"install\", \"taplo-cli\", \"--locked\"], check=True)\n        server = SolidLanguageServer.create(\"taplo\")\n    else:\n        raise","preventionTips":["Pre-install taplo on machines behind restrictive proxies/firewalls.","Configure proxy env vars (HTTPS_PROXY) if the release host requires them.","Verify the pinned Taplo version's release assets still exist before upgrading."],"tags":["taplo","download-failure","network","installation","toml"],"backgroundTag":"dependency-download-failed","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}