quarto-dev / netlify-plugin-quarto

MIT License
12 stars 1 forks source link

API rate limit leading to Netlify build fail #7

Open ravicodelabs opened 1 year ago

ravicodelabs commented 1 year ago

Describe the bug

I am getting the following error intermittently (sometimes with a different IP address) when trying to deploy from Netlify using netlify-plugin-quarto:

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

The full deploy log is here and the website source code being deployed is here. More examples of failed deploy previews can be seen here.

It looks to me like at any given time, some subset of Netlify's build/deploy servers are rate limited from GitHub API requests (e.g. via github.js), leading to a build failure and the above error.

Any thoughts on the above or what's happening here? Any ideas for setting things up to avoid this rate limit issue?

Steps to reproduce

  1. Start with a simple Quarto website in a repo.
  2. Add netlify.toml and package.json as we have done here to the repo.
  3. Set up a Netlify site with Netlify's GitHub integration and try to deploy without providing a valid GITHUB_TOKEN. (If it succeeds, you may have to try a few more times.)
ravicodelabs commented 1 year ago

I have updated our deploy method to not use netlify-plugin-quarto for the time being to avoid the Netlify deploy failures we were getting. Just adding this note here in case anyone checks out the repo link in my last post.

sagikazarmark commented 1 year ago

6 likely solves this problem.

Can it be released? @jjallaire maybe (as last committer in the repo)

jjallaire commented 1 year ago

I'm not sure how to release the plugin -- @cscheid ?

cscheid commented 1 year ago

@jjallaire it should be just a matter of updating versions and npm publish, but I can do that.

ravicodelabs commented 1 year ago

Thanks all! Just to clarify, will generating my own token and adding that as a Netlify env var GITHUB_TOKEN be sufficient here, e.g. so that I don't need a token with special permissions for the quarto-cli repo?

sagikazarmark commented 1 year ago

@ravicube No. The reason why you need a token is to increase the API request rate limit which is quite low for unauthenticated requests. But you don't need access to the quarto-cli repo.

I'd recommend however limiting the scopes of the token to a minumum.