snok / container-retention-policy

GitHub action for pruning old GHCR container image versions.
MIT License
186 stars 30 forks source link

You have exceeded a secondary rate limit #59

Closed den-is closed 4 months ago

den-is commented 1 year ago

Got another Warning/Notification while trying to delete "not-that-small" (a not that huge either) amount of images.

Couldn't delete xxxxxxx/yyyy:77988391.
Status code: 403
Response: {'documentation_url': 'https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits', 'message': 'You have exceeded a secondary rate limit. Please wait a few minutes before you try again.'}
den-is commented 1 year ago

I have tried to push a dumb fix but it did not help. https://github.com/snok/container-retention-policy/pull/58/commits/c556712fd48f26d5297b6c6aa90792667d79d2b1

sondrelg commented 5 months ago

Sorry for the lack of a response here @den-is. This issue will be fixed in the upcoming v3 release where we handle all secondary rate limits πŸ‘ I'll update this issue when it's released.

sondrelg commented 4 months ago

The latest release redoes rate limiting completely. It should fix this issue, and a few more. That said, you can risk running into this, even in the new version, if you run multiple processes at the same time. For single runs however, we now handle secondary rate limits gracefully.

If you have time, the migration guide for v3 is included in the release post πŸ‘ I would greatly appreciate feedback if you have any.

If you run into any issues, please share them in the issue opened for tracking the v3 release ☺️