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

"Downloaded language server binary is not funtional" error on Windows #3087

Closed
yoshuawuyts opened this issue Feb 10, 2020 · 17 comments · Fixed by #3092
Closed

"Downloaded language server binary is not funtional" error on Windows #3087

yoshuawuyts opened this issue Feb 10, 2020 · 17 comments · Fixed by #3092

Comments

@yoshuawuyts
Copy link
Member

After trying to install the language server binary through the popup today, the following error occurred:

Screenshot 2020-02-10 17 43 21

This occurs on Rust 1.41 on Windows 10. Possibly related to #3073

@Veetaha
Copy link
Contributor

Veetaha commented Feb 10, 2020

Can you please open command palette with Ctrl+Shift+P, write Toggle Developer Tools and press enter to open the Developer Tools, then open Console tab and send its contents here?
Also please give the contents of Help > About window in VSCode?

@yoshuawuyts
Copy link
Member Author

@Veetaha I can't seem to get the popup to appear again. Is there a recommended way to make that happen?

Actually I'm suspecting it may have been a one-off glitch because now that I've refreshed it seems like it's working?


Console output:

[Intervention] Slow network is detected. See https://www.chromestatus.com/feature/5636954674692096 for more details. Fallback font will be used while loading: file:///C:/Users/yoshu/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/base/browser/ui/codiconLabel/codicon/codicon.ttf?c4e66586cd3ad4acc55fc456c0760dec
actionbar.ts:669 [Intervention] Slow network is detected. See https://www.chromestatus.com/feature/5636954674692096 for more details. Fallback font will be used while loading: file:///C:/Users/yoshu/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/extensions/theme-seti/icons/seti.woff
2console.ts:137 [Extension Host] (node:1696) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
t.log @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
_doInvokeHandler @ rpcProtocol.ts:398
_invokeHandler @ rpcProtocol.ts:383
_receiveRequest @ rpcProtocol.ts:299
_receiveOneMessage @ rpcProtocol.ts:226
(anonymous) @ rpcProtocol.ts:101
fire @ event.ts:581
fire @ ipc.net.ts:453
_receiveMessage @ ipc.net.ts:733
(anonymous) @ ipc.net.ts:592
fire @ event.ts:581
acceptChunk @ ipc.net.ts:239
(anonymous) @ ipc.net.ts:200
t @ ipc.net.ts:28
emit @ events.js:200
addChunk @ _stream_readable.js:294
readableAddChunk @ _stream_readable.js:275
Readable.push @ _stream_readable.js:210
onStreamRead @ internal/stream_base_commons.js:166
console.ts:137 [Extension Host] Checked binary availablity via --version {status: 0, signal: null, output: Array(3), pid: 15748, stdout: {…}, …}
console.ts:137 [Extension Host] c:\Users\yoshu\AppData\Roaming\Code\User\globalStorage\matklad.rust-analyzer\ra_lsp_server-windows.exe --version output: (3) ["null", "rust-analyzer 5b703bd↵", ""]

About:

Version: 1.41.1 (user setup)
Commit: 26076a4de974ead31f97692a0d32f90d735645c0
Date: 2019-12-18T14:58:56.166Z
Electron: 6.1.5
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.18363

@Veetaha
Copy link
Contributor

Veetaha commented Feb 10, 2020

@yoshuawuyts I am sorry to admit that we already stumbled with your bug, the error was EBUSY, but it just disappeared away like in your case so we were not able to track the actual reason. Now you do have a working binary and it must not reproduce.

@matklad I think to kill this bug we will need to setup logging to a file from vscode extension

@Veetaha
Copy link
Contributor

Veetaha commented Feb 10, 2020

I also wonder whether this always happens on Windows or just on a case-by-base basis...

@yoshuawuyts
Copy link
Member Author

@Veetaha Going to try running this again on my Windows desktop to see if I can reproduce it once more.

@yoshuawuyts
Copy link
Member Author

This time around it went without a problem:

Screenshot 2020-02-10 18 58 30
Screenshot 2020-02-10 18 58 26
Screenshot 2020-02-10 18 58 18

@matklad
Copy link
Member

matklad commented Feb 10, 2020 via email

@Veetaha
Copy link
Contributor

Veetaha commented Feb 10, 2020

@yoshuawuyts Thank you for the report and efforts, this is very valuable. I see that you have the same symptoms, reinstalling does not reproduce the error.
@matklad sure, will try

@deltaphc
Copy link

Just passing by to confirm. I had been tracking master up until today, and decided to try the marketplace extension on Windows.

I deleted my rust-analyzer repo dir, uninstalled the manually-installed extension, and deleted ra-lsp-server from .cargo/bin, then installed the marketplace extension. It prompted me to download, downloaded it, but then said the binary was 'non-functional' after it was done.

Did RA's "restart language server" command, and it started working fine.

@matklad
Copy link
Member

matklad commented Feb 10, 2020 via email

@Veetaha
Copy link
Contributor

Veetaha commented Feb 10, 2020

@matklad, this is ridiculous, but yeah, I independently came to this conclusion in #3090

@marcogroppo
Copy link
Contributor

marcogroppo commented Feb 10, 2020

@matklad I think we should explicitly close() the output file stream here, after we receive a finish event: https://github.com/rust-analyzer/rust-analyzer/blob/7cba77ed4e4207b2e24b8dd57723368c2717bb2a/editors/code/src/installation/download_file.ts#L32

Something like that:

const outFile = fs.createWriteStream(destFilePath);
response.pipe(outFile)
outFile.on('finish', () => outFile.close())

@Veetaha
Copy link
Contributor

Veetaha commented Feb 10, 2020

@marcogroppo,
From pipe docs:

By default, stream.end() is called on the destination Writable stream when the source Readable stream emits 'end', so that the destination is no longer writable.

@marcogroppo
Copy link
Contributor

marcogroppo commented Feb 10, 2020

@Veetaha does this imply that the underlying file descriptor is immediately closed? 🤔 (I don't know)

EDIT yes, it seems that it should be closed automatically (autoClose is true by default) https://nodejs.org/api/fs.html#fs_fs_createwritestream_path_options

@TheAifam5
Copy link

TheAifam5 commented Feb 10, 2020

I have similar issue but on Linux. Prompts me to download the rust-analyzer binaries, even I have them installed (system-wide). Do I still need rust-analyzer installed globally on my system?

@Veetaha
Copy link
Contributor

Veetaha commented Feb 10, 2020

@TheAifam5 , what do you mean by system-wide? Did you press "Download now" and then it prompted you to download them one more time after the reboot, or do you mean that you have ra_lsp_server in your $PATH. If the latter, please set "rust-analyzer.raLspServerPath": "ra_lsp_server"

[UPD] The preffered way now is to delete rust-analyzer installed via cargo xtask install and just download the prebuilt binaries. Please note that, the auto-updating logic is currently WIP

@TheAifam5
Copy link

@Veetaha yup, I mean system-wide (in /usr/bin) which is accessible through PATH. Thank you for the advice.

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

Successfully merging a pull request may close this issue.

6 participants