Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unstable on Mac due to GitHub API restrictions #69

Closed
xaviergmail opened this issue Mar 30, 2021 · 8 comments
Closed

Unstable on Mac due to GitHub API restrictions #69

xaviergmail opened this issue Mar 30, 2021 · 8 comments

Comments

@xaviergmail
Copy link

xaviergmail commented Mar 30, 2021

I have been consistently running across this error when trying to use tmate on a macos-10.15 runner:

==> Installing dependencies for tmate: libssh and msgpack
==> Installing tmate dependency: libssh
==> Pouring libssh-0.9.5_1.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/libssh/0.9.5_1: 23 files, 1.2MB
==> Installing tmate dependency: msgpack
==> Pouring msgpack-3.3.0.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/msgpack/3.3.0: 757 files, 5.2MB
==> Installing tmate
==> Pouring tmate-2.4.0.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/tmate/2.4.0: 9 files, 660.9KB
Error: HttpError: API rate limit exceeded for 199.19.85.34. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)

I'm not sure what exactly is triggering this, but I am in fact using limit-access-to-actor which relies on octokit

      - name: Setup tmate session
        uses: mxschmitt/action-tmate@v3
        with:
          limit-access-to-actor: true

It seems to be related to this: actions/runner-images/issues/602

Looking at octokit's documentation, it seems setting the GITHUB_TOKEN environment variable might be enough to authenticate the user. I will try that and report back with anything I find. Edit: I have yet again come across the same error with the GITHUB_TOKEN environment variable set

@obraunsdorf
Copy link

Same issue for me

ubolonton added a commit to ubolonton/emacs-module-rs that referenced this issue Aug 8, 2021
@andreineculau
Copy link

As per https://github.com/octokit/rest.js/blob/master/docs/src/pages/api/01_authentication.md and https://github.com/octokit/auth-action.js

It does not require any configuration, but instead reads the GITHUB_TOKEN environment variable that is provided to GitHub Actions.

That doesn't seem to be the case though, exposing env: {GITHUB_TOKEN: {{ secrets.GITHUB_TOKEN }} } in my yaml workflow, hits the same issue.

@norm
Copy link

norm commented Sep 14, 2021

It's a limit enforced by tmate.io, not a GitHub thing. I've fixed this in one of my workflows by getting an API key from tmate, and setting it up:

  - name: Add tmate API key
    env:
      TMATE_API_KEY: ${{ secrets.TMATE_API_KEY }}
    run: |
      echo "set tmate-api-key '$TMATE_API_KEY'" > ~/.tmate.conf

... but it would be nice if that was done through a with option in this Action.

@mxschmitt
Copy link
Owner

Closing, since multiple different issues are mixed here.

HttpError: API rate limit exceeded for 199.19.85.34. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)

This is about the GitHub API, this has nothing to do with tmate.

Closing for now, for further issues please open new issues, thanks!

@rfay
Copy link

rfay commented Dec 31, 2022

Github seems to have started limiting things far more in recent days, is there a way we could make it use GITHUB_TOKEN?

I'm getting this every single attempt today (and seeing it on unrelated tests that use github api as well):

Error: HttpError: API rate limit exceeded for 199.19.85.26. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)

@rfay
Copy link

rfay commented Jan 3, 2023

Could we please reopen this and see if there's a way to get a token in there?

==> Running brew cleanup tmate...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see man brew).
Error: HttpError: API rate limit exceeded for 199.7.166.17. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)

@rfay
Copy link

rfay commented Jan 3, 2023

I see this gist that may help here: https://gist.github.com/willgarcia/7347306870779bfa664e

@rfay
Copy link

rfay commented Jan 3, 2023

It looks like just adding this to the test yml file:

    env:
      HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}

dscho added a commit to dscho/action-tmate that referenced this issue Jan 9, 2023
This fixes mxschmitt#69

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/action-tmate that referenced this issue Jan 9, 2023
This fixes mxschmitt#69

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
mxschmitt pushed a commit that referenced this issue Jan 9, 2023
Use the GITHUB_TOKEN to avoid exceeding the API rate limit

There was a recent uptick of problems with the `limit-access-to-actor`
feature because it uses an unauthenticated REST API call (and the rate
limiting is based on IP, i.e. hosted GitHub build agents will run into
this _a lot_). The symptom looks like this:

	Error: API rate limit exceeded for 172.176.196.48. (But here's
	the good news: Authenticated requests get a higher rate limit.
	Check out the documentation for more details.)

Let's imitate how `actions/checkout` uses authenticated REST API calls
(see https://github.com/actions/checkout/blob/v3.3.0/action.yml#L24):
add an "input" variable with the correct default (and users are
expected to never _actually_ to provide that variable).

Also use GITHUB_TOKEN in the Homebrew calls

This fixes #69
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

No branches or pull requests

6 participants