quarto-dev / quarto-actions

GNU General Public License v2.0
228 stars 53 forks source link

error in quarto-actions/setup@v2: "Unable to determine latest release for rstudio/tinytex-releases" #105

Closed iantaylor-NOAA closed 5 months ago

iantaylor-NOAA commented 6 months ago

I've seen this error in github action a few times. In the past it has gone away simply by re-running the action, but in this case a re-run didn't fix it, so it seems worth reporting here. Sorry if I'm missing something obvious.

The workflow https://github.com/NOAA-FIMS/case-studies/actions/runs/9020883427/workflow#L23-L29 uses

      - name: Set up Quarto
        uses: quarto-dev/quarto-actions/setup@v2
        with:
          # To install LaTeX to build PDF book 
          tinytex: true 
          # uncomment below and fill to pin a version
          # version: 0.9.600

Error below copied from github action lines 110 to 152: https://github.com/NOAA-FIMS/case-studies/actions/runs/9020883427/job/24787215573

Quarto Installed !
Run quarto install tool tinytex --log-level warning
  quarto install tool tinytex --log-level warning
  case $RUNNER_OS in 
    "Linux")
        echo "$HOME/bin" >> $GITHUB_PATH
        ;;
     "macOS")
        echo "$(dirname $(find ~/Library/TinyTeX -name tlmgr))" >> $GITHUB_PATH
        ;;
     "Windows")
        echo "$(dirname $(find $APPDATA/TinyTeX -name tlmgr.bat))" >> $GITHUB_PATH
        ;;
      *)
        echo "$RUNNER_OS not supported"
        exit 1
        ;;
  esac
  echo "TinyTeX installed !"
  shell: /bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    GITHUB_PAT: ***
    R_LIBS_USER: /Users/runner/work/_temp/Library
    TZ: UTC
    _R_CHECK_SYSTEM_CLOCK_: FALSE
    NOT_CRAN: true
    BUNDLE_EXT: macos.pkg
    QUARTO_PRINT_STACK: true
ERROR: Unable to determine latest release for rstudio/tinytex-releases
403 - Forbidden

Stack trace:
403 - Forbidden
    at getLatestRelease (file:///Applications/quarto/bin/quarto.js:96191:15)
    at eventLoopTick (ext:core/01_core.js:183:11)
    at async Object.remotePackageInfo [as latestRelease] (file:///Applications/quarto/bin/quarto.js:96554:27)
    at async toolSummary (file:///Applications/quarto/bin/quarto.js:96901:31)
    at async updateOrInstallTool (file:///Applications/quarto/bin/quarto.js:97058:21)
    at async Command.fn (file:///Applications/quarto/bin/quarto.js:100130:17)
    at async Command.execute (file:///Applications/quarto/bin/quarto.js:8104:13)
    at async quarto (file:///Applications/quarto/bin/quarto.js:[115](https://github.com/NOAA-FIMS/case-studies/actions/runs/9020883427/job/24787215573#step:5:119)003:5)
    at async file:///Applications/quarto/bin/quarto.js:115021:9
Error: Process completed with exit code 1.
cscheid commented 6 months ago

The error message you're getting is 403 - Forbidden. We should probably improve the error at https://github.com/quarto-dev/quarto-cli/ to show the URL that's failed. But in this case, I know that the URL is https://api.github.com/repos/rstudio/tinytex-releases/releases/latest by following the stack trace. And the fact that you're getting a Forbidden response there means that there isn't much either Quarto itself or the quarto-actions workflows can do.

This might be just genuinely bad luck on your side. I believe we run this action multiple times a day at quarto-cli for our CI, and we don't see this error. I don't see the error locally right now either:

$ curl -I https://api.github.com/repos/rstudio/tinytex-releases/releases/latest
HTTP/2 200
server: GitHub.com
date: Thu, 09 May 2024 17:59:56 GMT
content-type: application/json; charset=utf-8
cache-control: public, max-age=60, s-maxage=60
vary: Accept, Accept-Encoding, Accept, X-Requested-With
etag: W/"8aba1b1be3e84a398ee03c8f4cbcbf1bdc98cafe575d9d45f386b64ce633516c"
last-modified: Wed, 01 May 2024 07:26:07 GMT
x-github-media-type: github.v3; format=json
x-github-api-version-selected: 2022-11-28
access-control-expose-headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
access-control-allow-origin: *
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
content-security-policy: default-src 'none'
x-ratelimit-limit: 60
x-ratelimit-remaining: 58
x-ratelimit-reset: 1715281020
x-ratelimit-resource: core
x-ratelimit-used: 2
accept-ranges: bytes
x-github-request-id: E7DB:18E400:A975AA:11952C7:663D0F1C
iantaylor-NOAA commented 6 months ago

@cscheid, thanks for the quick response. Running the action one more time got the fix. We may be able to just automatically re-run actions that fail for the same reason in the future. Re-running manually isn't that hard either.

Would it be useful to post an issue to https://github.com/rstudio/tinytex-releases/?

cscheid commented 6 months ago

It's not their fault, it's most likely a transient failure of the GitHub API (or the github action runners themselves)

iantaylor-NOAA commented 6 months ago

@cscheid, got it, thank you. Feel free to close this issue unless you want to update the 403 - Forbidden error as noted in your first comment.

cderv commented 5 months ago

Just a note that 403 Forbidden is also the error that Github throw when rate-limit is hit. https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#exceeding-the-rate-limit

As we document in the action README, setting your own token is recommended to avoid being impacted by the public rate limiting. https://github.com/quarto-dev/quarto-actions/blob/a3b9e3b6268d34e343e9bdb13ba3dfe789f278ec/setup/README.md?plain=1#L33-L44

From the link you shared, I don't think you followed this advice.

iantaylor-NOAA commented 5 months ago

Thank you @cderv! Adding the token seems to have fixed our issue. Thanks for the help and adding it to the documentation for folks in the future.