Rust-analyzer: VSCode: Cannot destructure property `releaseName` of 'undefined' or 'null'

Created on 27 Feb 2020  路  28Comments  路  Source: rust-analyzer/rust-analyzer

I just installed the rust-analyzer extension on vscode and it was unable to download the binary automatically. it gave me the following error:

Failed to download language server from rust-analyzer GitHub repository: Cannot destructure property releaseName of 'undefined' or 'null'.

My environment:

  • manjaro linux
  • rust: stable-x86_64-unknown-linux-gnu (default) rustc 1.41.0 (5e1a79984 2020-01-27)
  • vscode 1.41.1
  • rust-analyzer: 0.1.20200211

Most helpful comment

Yeah, and you need to update the vscode to 1.42 :sweat_smile: (#3139)

All 28 comments

rust-analyzer: 0.1.20200211

Did you _just_ install it from the Code Marketplace? This is an old version of the extension. If you update it, the server binary download should work.

This happens because the server binary name has changed.

yes i _just_ installed it.

When i run the Extensions: Check for extensions update command in vscode it tells me all extensions are up to date

Interesting, when I uninstall the extensions and search for it, it show the right version (0.1.20200224). However once I install it, it reverts to the version mentioned in the description (0.1.20200211)

@Progdrasil, did you install the extension from source previously?

And do you mind showing the console logs?
VSCode > Help > Toggle Developer Tools > Console.

It's interesting to find out how you stumbled upon this. I am pretty sure that the extension has to download only the matching version, even an old one.

To fix this problem for you I recommend running (on Ubuntu):

rm -rf ${HOME}/.vscode/extensions/matklad.rust-analyzer-0.1.0
rm -rf ${HOME}/.config/Code/User/globalStorage/matklad.rust-analyzer

And then reinstalling the extension from the marketplace

Could it also be related to the ongoing GitHub issues?

I had the same issue, I can confirm this is as @lnicola said related to the binary name having changes and that updating the vscode plugin fixed the issue for me.

For me since I was hacking on rust-analyzer I installed the plugin from source because it was a command away.

VSCode didn't show me that there was an update for the plugin which might be related to me being on a plugin installed from source before the update where the name was changed.

For me since I was hacking on rust-analyzer I installed the plugin from source because it was a command away.

A command and a preference change away :smiley:. Confusion will ensue otherwise.

Hmmm, I guess I know the root cause. The 02-11 version fetches the latest release, but the latest release contains renamed binary name

Since this is fixed in the new version, we may close this, @matklad ?

@Veetaha @Progdrasil said they've installed it from the marketplace, so it should be the latest version. And apparently the version number changes after installing the extension.

Interesting, when I uninstall the extensions and search for it, it show the right version (0.1.20200224). However once I install it, it reverts to the version mentioned in the description (0.1.20200211)

I am pretty sure that the logic introduced in #3162 must ensure that the extension is looking only for a release with the relevant binary name.
Anyway, #3295 should have added a double check that the needed binary did is published.

@Progdrasil, did you install the extension from source previously?

No i did not

when I install the extension the only log i have regarding rust-analyzer

[Extension Host] 
/home/rene/.config/Code - OSS/User/globalStorage/matklad.rust-analyzer/ra_lsp_server-linux --version output: undefined

then when i click Download now button:

[Extension Host] 
Issuing request for released artifacts metadata to https://api.github.com/repos/rust-analyzer/rust-analyzer/releases/latest

notificationsAlerts.ts:40 
Failed to download language server from rust-analyzer GitHub repository: Cannot destructure property `releaseName` of 'undefined' or 'null'.
onDidNotificationChange @ notificationsAlerts.ts:40
(anonymous) @ notificationsAlerts.ts:26
fire @ event.ts:581
addNotification @ notifications.ts:171
notify @ notificationService.ts:101
(anonymous) @ mainThreadMessageService.ts:83
_showMessage @ mainThreadMessageService.ts:44
$showMessage @ mainThreadMessageService.ts:38
_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

notificationsAlerts.ts:40 
Rust Analyzer Language Server is not available. Please, ensure its [proper installation](https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/user#vs-code).
onDidNotificationChange @ notificationsAlerts.ts:40
(anonymous) @ notificationsAlerts.ts:26
fire @ event.ts:581
addNotification @ notifications.ts:171
notify @ notificationService.ts:101
(anonymous) @ mainThreadMessageService.ts:83
_showMessage @ mainThreadMessageService.ts:44
$showMessage @ mainThreadMessageService.ts:38
_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

[Extension Host] DNS resolution for example.com was successful ["93.184.216.34"]

Okay, so you somehow ended up using the 2020-02-11 version (not sure how), because the request it issues goes to for ra_lsp_server binary to rust-analyzer/releases/latest, whilst the latest release binary is renamed, that's why it crashes.

And do you mind showing the console logs?
VSCode > Help > Toggle Developer Tools > Console.

It's interesting to find out how you stumbled upon this. I am pretty sure that the extension has to download only the matching version, even an old one.

To fix this problem for you I recommend running (on Ubuntu):

rm -rf ${HOME}/.vscode/extensions/matklad.rust-analyzer-0.1.0
rm -rf ${HOME}/.config/Code/User/globalStorage/matklad.rust-analyzer

And then reinstalling the extension from the marketplace

As for removing the directories, only the directory under .vscode existed. However it does not change the behavior on installation.

As for removing the directories, only the directory under .vscode existed. However it does not change the behavior on installation.

Make that ~/.vscode-oss and ~/.config/Code\ -\ OSS.

Please, ensure that ~/.vscode/extensions/ folder contains only one matklad.rust-analyzer-0.2.20200224 directory, if there are any of

matklad.rust-analyzer-0.2.20200211-dev
matklad.rust-analyzer-0.1.20200211  
matklad.rust-analyzer-0.0.1

You should remove them, otherwise you still use the old version of the extension...

yes, I was refering to the ubuntu directories my actual command is:

rm -fr  ~/.vscode-oss/extensions/matklad.rust-analyzer-0.1.20200211     
ls ~/.config/Code\ -\ OSS/User/globalStorage      

    state.vscdb  state.vscdb.backup

and the global storage had no matklad directory

What if you download the VSIX from the release page?

Or even from https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer.

Please, ensure that ~/.vscode/extensions/ folder contains only one matklad.rust-analyzer-0.2.20200224 directory, if there are any of

matklad.rust-analyzer-0.2.20200211-dev
matklad.rust-analyzer-0.1.20200211  
matklad.rust-analyzer-0.0.1

You should remove them, otherwise you still use the old version of the extension...

ls ~/.vscode-oss/extensions | rg matklad
matklad.rust-analyzer-0.1.20200211

after having removed it, it still installed the same version

You might want to click Uninstall button in VSCode first and then remove that directory under ~/.vscode-oss/extensions

Also you should restart vscode before installing again I think.

You might want to click Uninstall button in VSCode first and then remove that directory under ~/.vscode-oss/extensions

seeing as there is much confusion here are my steps:

  1. install rust-analyzer from market place
  2. check version, if == 0.1.20200211 then
  3. uninstall rust-analyzer with button
  4. run
    ```bash
    rm -fr $HOME/.vscode-oss/extensions/matklad.rust-analyzer-0.1.20200211 # Succeeds
    rm -rf $HOME/.config/Code - OSS/User/globalStorage/matklad.rust-analyzer # Does not exist
5. reload vscode window
6. Reinstall `rust-analyzer`
7. goto step 2.


> What if you download the VSIX from the release page?
> 
> Or even from https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer.

after dowing this I get the following console messages
```console
notificationsAlerts.ts:38 
Error
onDidNotificationChange @ notificationsAlerts.ts:38

log.ts:184   
ERR Unable to install extension 'matklad.rust-analyzer' as it is not compatible with VS Code '1.41.1'.: Error: Unable to install extension 'matklad.rust-analyzer' as it is not compatible with VS Code '1.41.1'.
    at file:///usr/lib/code/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:411:762
    at processTicksAndRejections (internal/process/task_queues.js:89:5)

Yeah, and you need to update the vscode to 1.42 :sweat_smile: (#3139)

Ah. that version is not in my package manager yet. Manjaro usually runs a week-ish behind Arch.

1.42 showed up in Arch on Feb 1713, and even so it was two weeks late.

You could try to install the Arch package, if you already have one for electron6.

As of today, 1.42.1 landed in Manjaro. I can confirm the the install works correctly now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bdashore3 picture bdashore3  路  30Comments

matklad picture matklad  路  25Comments

aloucks picture aloucks  路  32Comments

matklad picture matklad  路  24Comments

matklad picture matklad  路  28Comments