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

"Activating extension 'matklad.rust-analyzer' failed" #3280

Closed
yoshuawuyts opened this issue Feb 23, 2020 · 11 comments
Closed

"Activating extension 'matklad.rust-analyzer' failed" #3280

yoshuawuyts opened this issue Feb 23, 2020 · 11 comments

Comments

@yoshuawuyts
Copy link
Member

I just updated to the latest rust-analyzer, which prompted the installation of the language server "2020-02-17".

During installation the progress bar didn't progress smoothly, but instead on different attempts got stuck at early stages of the download such as 5%, 14% or 20%. While I was trying to debug this I kept the devtools open, and to my surprise at some point the download did succeed. But with errors.

Screenshots

Screenshot 2020-02-23 11 53 14

Screenshot 2020-02-23 11 53 18

@yoshuawuyts
Copy link
Member Author

Ah, restarting VS Code brings the prompt back up to install the language server. It seems if the download stream errors out, then the "download successful" flow is still kicked off, but doesn't have the right output available so all values are "null".

This seems it could be related to the work done around #3092.

@yoshuawuyts
Copy link
Member Author

Confirming that the root cause of the stream getting stuck and timing out is outside of rust-analyzer. Downloading manually from GitHub Releases also gets stuck. This might be a problem with my local network or with GitHub Releases.

The problem about the "success" flow being kicked off when a download stream times out is likely the only problem rust-analyzer could address.

@yoshuawuyts
Copy link
Member Author

Switched my laptop to tether from my phone, and was able to successfully download from GitHub. It must be because of an interaction with the local network here (on friend's WiFi).

@Veetaha
Copy link
Contributor

Veetaha commented Feb 24, 2020

UNKNOWN error code, nice 😅
Thanks for the report! I thought we managed to handle all errors in #3116. There was a bug in NodeJS fs module (nodejs/node#31776), but we put a workaround for that. I suppose there was no error during the download, otherwise the progress would not reach 100% and we would see the following error message-box with a sanity-dns-resolution check here:
https://github.com/rust-analyzer/rust-analyzer/blob/4fea5808e9209c385e915d9d060c18520ce081b3/editors/code/src/installation/server.ts#L65-L89

@yoshuawuyts, when you reloaded the VSCode did it fail with the same UNKNOWN error code in the console? And have you already overwritten that binary that failed with the error you reported? If not I'd ask you to upload it somewhere so that I could test what's wrong with that...

P.S. It's also helpful to see that the download took 5+ minutes (maybe we should not remove that log message as we did it in #3261 @matklad)?

@Veetaha
Copy link
Contributor

Veetaha commented Feb 24, 2020

And I know where that circular JSON error comes from, though this should not be the cause of the problem (it just was an untested sanity-check path, i.e. Downloaded binary is not functional).
https://github.com/rust-analyzer/rust-analyzer/blob/4fea5808e9209c385e915d9d060c18520ce081b3/editors/code/src/installation/server.ts#L91-L94

Veetaha pushed a commit to Veetaha/rust-analyzer that referenced this issue Feb 24, 2020
bors bot added a commit that referenced this issue Feb 24, 2020
3288: Quick fix circular json error when sanity-check fails r=matklad a=Veetaha

Related issue: #3280

Co-authored-by: Veetaha <gerzoh1@gmail.com>
cjhopman pushed a commit to cjhopman/rust-analyzer that referenced this issue Apr 10, 2020
@erayerdin
Copy link

Failed with:

abstractExtensionService.ts:396 Activating extension 'matklad.rust-analyzer' failed: Got response 500 when trying to download a file..

@erayerdin
Copy link

erayerdin commented May 22, 2020

Oddly, installing rust-analyzer to my system globally have solved my problem. I use Manjaro, so I did:

sudo pacman -S rust-analyzer

Then reenabled the extension on VSCode and it downloaded successfully and installed successfully. Strange.

@Veetaha
Copy link
Contributor

Veetaha commented May 22, 2020

@erayerdin
You might have witnessed the case when GitHub server was having some trouble serving the language server binary to you. The extension downloads it directly from Github releases.

@erayerdin
Copy link

@Veetaha I had been experiencing this issue for a week now. That's the strange part. Whatever, I have solved it at least (or the problem solved itself, idk). Someone else might provide more insight.

@davidbarsky
Copy link
Contributor

Huh, I was getting this issue for a while and was completely puzzled. I'd get prompted to update but noticed 403 errors in the logs. Turns out, GitHub (accidentally?) rate limited traffic from my employer's network. Going off VPN resolved the issue.

@lnicola
Copy link
Member

lnicola commented Jan 22, 2021

This is probably addressed now. GitHub will always be flaky from time to time, but a new issue would probably be better if we still do error handling wrong.

@lnicola lnicola closed this as completed Jan 22, 2021
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