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

Cannot download binary due to api rate limit #3094

Closed
kwonoj opened this issue Feb 10, 2020 · 14 comments
Closed

Cannot download binary due to api rate limit #3094

kwonoj opened this issue Feb 10, 2020 · 14 comments

Comments

@kwonoj
Copy link

kwonoj commented Feb 10, 2020

published analyzer in marketplace, clicking download raises

image

and manually hitting endpoint reveals it's due to

image

looks like can gracefully handle non-expected api response & can give retry chances later.

@Veetaha
Copy link
Contributor

Veetaha commented Feb 10, 2020

How many times did you use click "Download now" button today ;D ?
Anyway thank you for the report, this was unexpected, but will be fixed!

@kwonoj
Copy link
Author

kwonoj commented Feb 10, 2020

I did 2 times, it's api server hitting limit and not caused by individual presses N times.

@Veetaha
Copy link
Contributor

Veetaha commented Feb 10, 2020

We do issue two requests to GitHub. One for retrieving the information about the latest release and the second downloads the binary itself. Do you think this is because two of them are issued in a very short period of time?

@kwonoj
Copy link
Author

kwonoj commented Feb 10, 2020

It should be related and I think that also need to be improved. Main crux is total numbers of request in a given timeframe exceeded limit - most likely after plugin is released many ppl try to download binary in a short time frame.

@kwonoj
Copy link
Author

kwonoj commented Feb 10, 2020

Per https://developer.github.com/v3/ it's 5000 per hr, each individual fires 2 requests so 2500 download attempt will hit rate limit.

@bjorn3
Copy link
Member

bjorn3 commented Feb 10, 2020

There is no api key used, so rate-limiting should be done one a per IP base.

@Veetaha
Copy link
Contributor

Veetaha commented Feb 10, 2020

Rate limiting:

For unauthenticated requests, the rate limit allows for up to 60 requests per hour. Unauthenticated requests are associated with the originating IP address, and not the user making requests.

@kwonoj
Copy link
Author

kwonoj commented Feb 10, 2020

I am certain I did not make 60 requests per hr, I just installed and tried 2 times only 🤔

@Veetaha
Copy link
Contributor

Veetaha commented Feb 10, 2020

I also doubt that downloading the file counts as an API request ...

bors bot added a commit that referenced this issue Feb 11, 2020
3100: vscode: add error handling to downloadFile() r=matklad a=Veetaha

Inspired by #3094.

Co-authored-by: Veetaha <[email protected]>
@niderhoff
Copy link

I have the same problem. I got 403 on the first try to download the rust-analyzer.
Then I tried to workaround that by manually installing it and putting it in PATH.
It is found by the extension (seems so?):

DEBUG [9/5/2020, 11:03:32 PM]: Checking availability of a binary at rust-analyzer-linux
DEBUG [9/5/2020, 11:03:32 PM]: rust-analyzer-linux --version: {
  status: 0,
  signal: null,
  output: [ null, 'rust-analyzer 0275b08\n', '' ],
  pid: 9585,
  stdout: 'rust-analyzer 0275b08\n',
  stderr: ''
}

but I still get the 403 error when tryting to start the server. Why are API request made even if the binary is available?

@bjorn3
Copy link
Member

bjorn3 commented Sep 5, 2020

You downloaded the nightly version instead of the 2020-08-31 version. The rust-analyzer extension only accepts a rust-analyzer executable that is built from the same git commit.

@Veetaha
Copy link
Contributor

Veetaha commented Sep 5, 2020

Having "rust-analyzer.serverPath": "rust-analyzer-linux" should work disregarding any versions.
If you have set the updates.channel to nightly the extension will always try to poll GitHub API for the new nightly version, even if you have overridden the serverPath. Why? This is because nightly release includes rust-analyzer.vsix (rust analyzer client extension) to be updated too.

@niderhoff
Copy link

I reinstalled it using

curl -L https://github.com/rust-analyzer/rust-analyzer/releases/latest/download/rust-analyzer-linux -o ~/.local/bin/rust-analyzer

and now it works. My theory as to why is the following: It detected the binary to be of nightly release and consequently polled Github for a new Version even though I did not explicitly set the updates.channel to nightly (the setting was on default).

@lnicola
Copy link
Member

lnicola commented Jan 22, 2021

We now support setting a GitHub auth token, and we no longer check GitHub if the LSP binary path is manually set.

Please reopen or file a new issue if you're still having problems.

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

5 participants