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

encountering secondary rate limit restrictions #9

Closed
travi opened this issue Mar 30, 2023 · 4 comments
Closed

encountering secondary rate limit restrictions #9

travi opened this issue Mar 30, 2023 · 4 comments

Comments

@travi
Copy link

travi commented Mar 30, 2023

when executing against projects where the dependency graph is tracking several pages of dependencies, we are encountering secondary rate limits before the full query result can be processed. is there a way to configure the client to honor the retry-after/x-ratelimit-reset headers?

for completeness, this is the error we are seeing in this case:

non-200 OK status code: 403 Forbidden body: "{\n  \"documentation_url\": \"https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits\",\n  \"message\": \"You have exceeded a secondary rate limit. Please wait a few minutes before you try again.\"\n}\n"

in addition, we are sometimes seeing a timeout error, before encountering the secondary rate limit. Is this a known issue?

Message: timedout, Locations: [{Line:1 Column:155}]
@steiza
Copy link
Collaborator

steiza commented Apr 12, 2023

Sorry for the delay! As you discovered, it can take many API calls to generate a SBOM for a large repository, or fail altogether for very large repositories.

The Dependency Graph team was kind enough to implement a server-side SBOM generator for SPDX, which is a single API call and much, much faster. The gh-sbom v0.0.9 release makes use of this feature - give it a try and let us know if that works for you?

You'll need to update gh-sbom with:

$ gh ext remove advanced-security/gh-sbom
$ gh ext install advanced-security/gh-sbom

@travi
Copy link
Author

travi commented Apr 12, 2023

Thanks for the update. Great to hear that the API generation is available. Will test it out soon!

@travi
Copy link
Author

travi commented Apr 13, 2023

this is great and so fast :)

one thing to note, the README still mentions that GHES 3.8 is needed. when using against GHES, the new rest endpoint for the sbom doesnt yet exist in v3.8. since github/roadmap#626 highlights that these features are to be expected in v3.9, what would be the appropriate update to make that clear in the README until that is released?

@steiza
Copy link
Collaborator

steiza commented Apr 13, 2023

Great call-out! I have done so with 5e0c924.

@steiza steiza closed this as completed Apr 13, 2023
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

2 participants