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

Hitting secondary rate limits and other errors when fetching tags #170

Closed
YJDoc2 opened this issue Apr 5, 2024 · 6 comments · Fixed by #183
Closed

Hitting secondary rate limits and other errors when fetching tags #170

YJDoc2 opened this issue Apr 5, 2024 · 6 comments · Fixed by #183

Comments

@YJDoc2
Copy link

YJDoc2 commented Apr 5, 2024

When using this action for generating a tag PR, we are getting error

GET https://api.github.com/search/issues?q=repo%3Acontainers%2Fyouki+is%3Apr+is%3Aclosed+13d791b+c98c0ca+a51c03a+33e417f+496d955+cfa2ea9+919ff4a+762a2e8+701085d+9e35012+ae48534: 403 You have exceeded a secondary rate limit. Please wait a few minutes before you try again.

Corresponding CI run : https://github.com/containers/youki/actions/runs/8554693630/job/23440530901

Also, When this was run on a PR merged by dependabot, it errored with

POST https://api.github.com/repos/containers/youki/releases/generate-notes: 403 Resource not accessible by integration []

Corresponding CI run : https://github.com/containers/youki/actions/runs/8548546699/job/23438881389

Is there anything that can be done on our side to fix this issue, or any changes needed in this action itself?

Thanks!

@gteufelberger
Copy link
Contributor

gteufelberger commented May 3, 2024

@YJDoc2
Copy link
Author

YJDoc2 commented May 3, 2024

Hey, unfortunately I haven't yet found any way to resolve this. The best is I wait for a few minutes, hoping that the timeout for the rate limit passes and manually re-run it. (yes, we are still using this action).

@Songmu , can you help out , suggesting what can be done. If you can suggest any solution, I'd be happy to try and contribute the fix.

@snaka
Copy link
Contributor

snaka commented Sep 17, 2024

The same problem sometimes occurs in my repositories, and I have been dealing with it by manually retrying.

A quick look into “Secondary Rate limit” turned up the following information.

https://github.com/gofri/go-github-ratelimit

https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#about-secondary-rate-limits

I am guessing that these may be the solution, but at this point I cannot be sure.

@snaka
Copy link
Contributor

snaka commented Sep 19, 2024

After repeating the experiment several times, we noticed an interesting fact.

I noticed that tagpr's own workflow used create-github-app-token to generate a Token, so I did the same for my repository, which was having problem, and the problem was solved.

- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: checkout
uses: actions/checkout@v3
with:
token: ${{ steps.generate_token.outputs.token }}
- name: tagpr
run: |
make install
echo '::echo::on'
tagpr
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}

Now it seems to work more stable than when using secrets.GITHUB_TOKEN as mentioned in the README.

I'm not sure if this is a tagpr issue or a GitHub API issue, but I was able to work around the problem with the above.

However, I don't think this is a very common method because it requires a GitHub App to be prepared for deployment.
I believe there is a better solution. (I think it is probably go-github-ratelimit now)

@snaka
Copy link
Contributor

snaka commented Sep 24, 2024

@YJDoc2

The above PR addresses the Secondary Rate Limit error by implementing retries. However, it does not address the other error.

If necessary, please create a separate issue for the remaining error.

@YJDoc2
Copy link
Author

YJDoc2 commented Sep 27, 2024

@snaka thanks a lot for your investigation and fix! I haven't seen the second issue in a while, I'll create a new issue if needed. Thanks!

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 a pull request may close this issue.

3 participants