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

auto-updater check is broken when API rate limit exceeded #1813

Closed
1 task done
douniwan5788 opened this issue Sep 3, 2018 · 9 comments
Closed
1 task done

auto-updater check is broken when API rate limit exceeded #1813

douniwan5788 opened this issue Sep 3, 2018 · 9 comments
Milestone

Comments

@douniwan5788
Copy link

douniwan5788 commented Sep 3, 2018

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.18.0.windows.1
cpu: x86_64
built from commit: cd1a74fc9dc8a07626c216940db9a51f25206e03
sizeof-long: 4
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [版本 6.1.7601]
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

shared outbound ip/under proxy

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

CMD

git update-git-for-windows
  • What did you expect to occur after running these commands?
Git for Windows 2.18.0.windows.1 (64bit)
Up to date
  • What actually happened instead?
Git for Windows 2.18.0.windows.1 (64bit)
Update  is available
Download and install  [N/y]? y
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information

What I found

The update check url (https://api.github.com/repos/git-for-windows/git/releases/latest) is API rate limit exceeded.

{
message: "API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)",
documentation_url: "https://developer.github.com/v3/#rate-limiting"
}

and checking method is not solid enough to handle this situation
https://github.com/git-for-windows/build-extra/blob/master/git-extra/git-update-git-for-windows#L141-L183

@douniwan5788
Copy link
Author

@dscho @between2spaces @larsxschneider

@sentiment-bot
Copy link

sentiment-bot bot commented Sep 11, 2018

Please be sure to review the code of conduct and be respectful of other users. cc/ @git-for-windows/trusted-git-for-windows-developers
Keep in mind, this repository uses the Contributor Covenant.

@drizzd
Copy link

drizzd commented Sep 11, 2018

So Github says they will reply with HTTP status 403 in this case. Curl by default does not return an error code. We need to add the curl --fail, then it will return status 22. We could then add a case statement 22,*) to print the curl output which contains the error message and exit. Would you be interested in implementing this?

If we want to distinguish different HTTP error codes, we can output the HTTP status with curl -i.

@drizzd
Copy link

drizzd commented Sep 11, 2018

And while we are at it, we may want to add --show-error whenever we use curl --silent in order to tell the user what happened.

@sschlesier
Copy link

sschlesier commented Dec 24, 2018

This seems to be a near daily occurrence for me lately.

$ git --version --build
git version 2.20.1.windows.1
cpu: x86_64
built from commit: 7c9fbc07db0e2939b36095df45864b8cda19b64f
sizeof-long: 4
sizeof-size_t: 8


$ git update-git-for-windows
Git for Windows 2.20.1.windows.1 (64bit)
Update  is available
Download and install  [N/y]? y
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information

Well the scheduled check is daily and keeps prompting me. This is a CLI repro.

@chris-findlay
Copy link

So it's not just me then - which means I don't need to write it up (c:
Same build as immediately above.

@PhilipOakley
Copy link

Hi @chris-findlay @sschlesier @douniwan5788,

If you are able to contribute a little time to a PR that supports @drizzd 's suggestions so that at least users like yourselves get to see the error message (that we've hit a rate limit) then that would be a great assistance to the project, as it is a volunteer community effort.

Hoping you can help.

Philip

@drizzd
Copy link

drizzd commented Mar 11, 2019

@dscho Do you see a possibility to host GFW releases elsewhere to avoid the rate limit entirely?

Otherwise, how about a firebase cloud function which listens to Github events to mirror at least the release information, including the download link. I have some experience with that.

@drizzd
Copy link

drizzd commented Mar 11, 2019

I wouldn't mind doing the same thing with Azure, by the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants