-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
Rate limit errors when paginating using app authentication #738
Comments
I initially suspected #562 but it seems that the allowed_authorities check in |
For reference, this is our Octocrab initialization code: octocrab::OctocrabBuilder::new()
.add_retry_config(octocrab::service::middleware::retry::RetryConfig::Simple(
20,
))
.app(
std::env::var("GITHUB_APP_ID")
.expect("GITHUB_APP_ID env variable is missing")
.parse::<u64>()
.unwrap()
.into(),
jsonwebtoken::EncodingKey::from_rsa_pem(
std::env::var("GITHUB_APP_KEY")
.expect("GITHUB_APP_KEY env variable is missing")
.as_bytes(),
)
.expect("Cannot convert contents of GITHUB_APP_KEY to an EncodingKey"),
)
.build()
.unwrap()
.installation(
std::env::var("GITHUB_APP_INSTALLATION_ID")
.expect("GITHUB_APP_INSTALLATION_ID env variable is missing")
.parse::<u64>()
.unwrap()
.into(),
)
.unwrap()
``` |
Hmm, ripping out the Although now that I know what I'm looking for, there are other comments on similar issues which blame that middleware: #576 |
I can confirm that downgrading to 0.33.3 fixes the problem. I haven't been able to pinpoint the issue, but I think it's in the way the auth header is generated and passed around when using app authentication. I'm out of time to dig into this tonight, but I'm interested in whether anyone else has any insights! |
I'm only part way through isolating this, but I'm making an issue in case anyone else is running into similar problems.
We recently upgraded to the most recent release (0.42.1) and we're hitting rate limits on one of our tools that lists a lot of github release pages.
There seem to be two problems:
This behaviour seems identical when using either
into_stream
, or explicitly callingget_page
with thenext_page
property from the previous request. The above logs were generated via this code:This means that our paginated requests are being subjected to the public rate limit.
Octocrab
#349 ? I tried enabling the newretry
feature, but it doesn't handle 403 error or the rate limit header, so it's not very useful.Handling 403s in the retry middleware would be easy to fix, but it's not the main problem, since the public rate limits are very tight for our use case.
The text was updated successfully, but these errors were encountered: