Skip to content

Resolve $RID in the Windows upgrade download URL before fetching

Placeholder ppxd requested to merge fix-windows-upgrade-rid-url-404 into main

Summary

Windows tentacle upgrades fail at the download step with Download failed: (404). The server emits the upgrade URL with a literal $RID placeholder (it can't know the agent's architecture), but upgrade-windows-tentacle.ps1 assigned it with single quotes — $DOWNLOAD_URL = '...-$RID.zip' — so PowerShell never expanded $RID. The agent then requested .../squid-tentacle-<ver>-$RID.zip, which doesn't exist → GitHub 404.

Fix: rewrite the $RID token to the architecture-resolved value right after arch detection, before Invoke-WebRequest consumes the URL. A targeted .Replace('$RID', $RID) — not a double-quoted re-assignment — so an operator-overridden base URL with other $/backtick characters is left intact.

Impact

  • Zip is the only Windows upgrade method, so this broke every Windows tentacle upgrade at the download step since the feature shipped — it is a latent bug, not a regression in any recent release.
  • Linux is unaffected: its DOWNLOAD_URL="..." is double-quoted and $RID is set before the assignment, so bash expands it.
  • Why CI missed it: the Windows lifecycle E2E reads the real .ps1 but its LocalReleaseMirror serves any .zip path, so the literal-$RID URL got a 200 there while real GitHub returns 404.

Test plan

  • RenderInnerScript_DownloadUrl_RewritesLiteralRidTokenBeforeDownload — written test-first (RED before the fix, GREEN after); asserts the script rewrites the literal $RID token before Invoke-WebRequest consumes $DOWNLOAD_URL
  • Full unit suite green (5905/5905)
  • Full solution build (0 errors)
  • Resolved URL .../squid-tentacle-1.8.11-win-x64.zip confirmed to exist as a published release asset

Merge request reports

Loading