Skip to content

fix: reuse stale tailscale.tgz on self-hosted runners#305

Merged
mpminardi merged 1 commit into
tailscale:mainfrom
TowyTowy:fix/294-stale-tgz
Jul 9, 2026
Merged

fix: reuse stale tailscale.tgz on self-hosted runners#305
mpminardi merged 1 commit into
tailscale:mainfrom
TowyTowy:fix/294-stale-tgz

Conversation

@TowyTowy

@TowyTowy TowyTowy commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

On persistent self-hosted runners the XDG cache directory survives between jobs. When GitHub's Actions cache backend does not return a hit (no working backend, evicted entry, etc.), the tailscale.tgz left behind by a previous job is still on disk, and tc.downloadTool() refuses to overwrite an existing destination, failing with "Destination file path ... already exists" (retried 3x by the retry helper).

This implements the maintainer-preferred Option 3 from the issue and mirrors the existing Windows MSI fix (#259): if the tarball already exists, reuse it when its sha256 matches, otherwise delete and re-download. Previously only the cloud-cache-restore path avoided the collision; the Linux download was unconditional.

Verified against the real @actions/tool-cache: the old code reproduces the exact reported failure with a stale file present; the new code reuses a checksum-matching file and replaces a mismatched one.

Includes the rebuilt dist/index.js (repo practice per #259).

Fixes #294

On persistent self-hosted runners the XDG cache directory survives between
jobs. When GitHub's Actions cache backend doesn't return a hit (no working
backend, evicted entry, etc.), the tailscale.tgz left behind by a previous
job is still on disk, and tc.downloadTool() refuses to overwrite an existing
destination, failing with "Destination file path ... already exists".

Mirror the Windows MSI fix (tailscale#259): if the tarball already exists, reuse it
when its checksum matches, otherwise delete and re-download. Only the
cloud-cache-restore path previously avoided this collision, so the Linux
download was unconditional.

Fixes tailscale#294

Signed-off-by: TowyTowy <towy@airreps.link>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@mpminardi mpminardi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix!

@mpminardi mpminardi merged commit 0e42fa1 into tailscale:main Jul 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Persistent self-hosted runner: stale tailscale.tgz causes "Destination file path … already exists"

2 participants