Repository navigation
Conversation
`quarto install tinytex` looked up rstudio/tinytex-releases through api.github.com, whose unauthenticated limit is 60 requests per hour per IP, and one install made two lookups (the tool summary, then preparePackage). Behind shared egress (CI runners, Docker build farms, corporate NAT) the install failed with "Unable to determine latest release for rstudio/tinytex-releases 403 - Forbidden". Without a token, the tag now comes from the 302 that github.com/<repo>/releases/latest returns to releases/tag/<tag>, and the download URLs are built from the tag with tinyTexPkgName(), the way the yihui.org install scripts use fixed URLs. Those candidates are not checked against an asset list any more, so preparePackage moves on to the next candidate (old naming) when a download is a 404. The API stays the path when a token is set, and the fallback when the redirect carries no tag: github.com web endpoints have their own anonymous limits. Install and update now pass the release info they already looked up to preparePackage instead of fetching it again. getLatestRelease also reads GITHUB_TOKEN, the variable GitHub Actions provides, after GH_TOKEN.
An undefined token falls back to githubToken(), which reads GH_TOKEN, and the test workflow sets GH_TOKEN, so on CI these tests took the authenticated API path instead of the unauthenticated one they assert.
preparePackage tried the next candidate when a download failed with a 404, but the install context's download exits the process on any failure, so the old-name fallback could never run. The unit test hid this with a download stub that returned the 404 instead. A HEAD request on each github.com download URL now picks the first candidate that is not a 404 (github.com answers 302 for an existing asset and 404 otherwise), and only that one is downloaded. This keeps the install context and the other tools' download handling unchanged, at the cost of one extra github.com request per install. A HEAD that fails outright selects the candidate, so the download reports the real error.
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Member
Author
|
I am thinking of backporting this to v1.11. The TinyTeX install code is the same in 1.11.x, so the 403 happens there too on CI runners and shared networks, and the change only touches I tried cherry-picking the commits on This is not a regression, so I kept the changelog entry under |
cderv
deleted the
fix/quarto-install-tinytex-fails-with-403-from-github-api-rate-limit-on-shared-ips
branch
November 17, 2026 14:59
2 of 5 tasks
cderv
added a commit
that referenced
this pull request
Nov 17, 2026
#15391) quarto install tinytex and quarto update tinytex looked up the latest TinyTeX release through the GitHub REST API, whose anonymous limit of 60 requests per hour per IP made installs fail with a 403 behind shared egress such as CI runners and corporate NAT. Without a token, the latest tag now comes from the github.com releases redirect, and the bundle is chosen by a HEAD probe of the candidate URLs before download. The API is still used when GITHUB_TOKEN or GH_TOKEN is set. - Read the latest tag from the github.com elease redirect when no token is set, and from the API otherwise. - Build download URLs from the tag and HEAD-probe them, so the old-name candidate is used when the new name returns 404. - Pass the release info from install and update to preparePackage instead of fetching it again. - Read GITHUB_TOKEN after GH_TOKEN, the variable GitHub Actions provides. Related to #15388
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
quarto install tinytexruns behind a shared IP (GitHub Actions runners, Docker build farms, corporate NAT), it can fail with:Root cause
To find the latest TinyTeX release, Quarto calls the GitHub REST API (
api.github.com/repos/rstudio/tinytex-releases/releases/latest). Without a token, GitHub allows 60 of these requests per hour per IP, shared by everyone behind the same address. One install made two calls (one to compare versions, one to pick the download), andquarto update tinytexmade three.Only the tag name is really needed from that response: the bundle names are derived from the tag. The TinyTeX install scripts don't hit this because they download from fixed
releases/download/...URLs and never call the API.Fix
Without a token, the latest tag now comes from the redirect that
github.com/rstudio/tinytex-releases/releases/latestreturns (a 302 to.../releases/tag/v2026.11), and the download URLs are built from the tag. github.com web pages have their own anonymous limits, so the API is still used when a token is set, and as a fallback when the redirect carries no tag.As the download URLs are no longer checked against the release asset list, a HEAD request picks the first bundle name that exists (the current
TinyTeX-<os>-<tag>naming, then the older one) before downloading. A failed download ends the install, so this check can't happen after.Install and update now reuse the release they already looked up instead of fetching it again. The token lookup also reads
GITHUB_TOKENafterGH_TOKEN, so a workflow exporting the Actions token under its usual name gets the authenticated API.Checked against github.com with
api.github.comblocked: release lookup and download of the Windows bundle make no request to the API.Checklist
I have (if applicable):
AI-assisted PR
Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.