microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.69k stars 28.69k forks source link

Can not update extensions due to "Error: Server returned 404" (rust-analyzer) #149518

Closed rlabrecque closed 2 years ago

rlabrecque commented 2 years ago

Steps to Reproduce:

  1. Have rust-analyzer 0.2.853 installed from the marketplace
  2. Observe that your extensions are out of date.
  3. Try to use the "Check for Extension Updates" option
  4. Receive notification alert "Error: Server returned 404", no extensions receive updates.

Uninstalling rust-analyzer 0.2.853 resolved this for me.

Expectations:

  1. Notification Alert would have shown which extension it was. I only found out via the Developer Tools Console.
  2. Other extensions would have updated fine regardless of this error caused by one extension.
  3. It's been failing to update extensions in the background for a while despite having "Keep extensions up to date checked", a warning that this was failing would have been nice. (It also caused all extensions to appear up to date, when they in fact weren't.)

Developer Tools Console output:

request.ts:46 
 GET https://rust-lang.gallerycdn.vsassets.io/extensions/rust-lang/rust-analyzer/0.2.853/1639376535349/Microsoft.VisualStudio.Code.Manifest 404
request.ts:46 
 GET https://rust-lang.gallerycdn.vsassets.io/extensions/rust-lang/rust-analyzer/0.2.853/1639376535349/Microsoft.VisualStudio.Code.Manifest 404
notificationsAlerts.ts:40 Error: Server returned 404
    at C (request.ts:49:9)
    at J.getManifestFromRawExtensionVersion (extensionGalleryService.ts:1023:16)
    at async J.getEngine (extensionGalleryService.ts:1128:21)
    at async J.isValidVersion (extensionGalleryService.ts:671:19)
    at async J.toGalleryExtensionWithCriteria (extensionGalleryService.ts:868:8)
    at async J.queryGalleryExtensions (extensionGalleryService.ts:809:22)
    at async J.getExtensions (extensionGalleryService.ts:618:26)
    at async Ms.checkForUpdates (extensionsWorkbenchService.ts:1076:30)
    at async Object.run (extensions.contribution.ts:584:5)
    at async k.runAction (actions.ts:190:3)
    at async k.run (actions.ts:181:4)
Ramblestsad commented 2 years ago

I've met the same problem. When I clicked the button Check for Extensions Update, I got a message Server returned 404.

VS Code Version: 1.67.1(universal) OS Version: macOS Monterey 12.3.1

kinghat commented 2 years ago

Version: 1.67.1 Commit: da15b6fd3ef856477bf6f4fb29ba1b7af717770d Date: 2022-05-06T12:39:22.915Z Electron: 17.4.1 Chromium: 98.0.4758.141 Node.js: 16.13.0 V8: 9.8.177.13-electron.0 OS: Linux x64 5.13.0-41-generic snap

same issue here. not sure if its related but happened at the same time i messed with the rust extensions. i thought rust-analyzer rolled to the main rust extension. i disabled rust-analyzer and installed rust. if i disable both extensions i still get the error.

tresuke commented 2 years ago

I have faced the same problem.

It seems that the change in the Marketplace identifier of rust-analyzer from matklad.rust-analyzer to rust-lang.rust-analyzer seems to have affected the problem. I solved the problem by uninstalling the old rust-analyzer and installing the new rust-lang.rust-analyzer again.

bpetlert commented 2 years ago

Version: 1.67.1 Commit: da15b6fd3ef856477bf6f4fb29ba1b7af717770d Date: 2022-05-06T12:39:22.915Z Electron: 17.4.1 Chromium: 98.0.4758.141 Node.js: 16.13.0 V8: 9.8.177.13-electron.0 OS: Linux x64 5.17.7-zen1-1-zen

I got the same problem when use rust-analyzer v0.3.1051. I got this message: Command 'Extensions: Check for Extension Updates' resulted in an error (Server returned 404). After switch to Pre-Release version rust-analyzer v0.3.1055. No problem anymore.

MitchTalmadge commented 2 years ago

Same problem with rust-analyzer. After uninstalling the extension I can update my others.

image

image

getaceres commented 2 years ago

Same problem here. Having rust-analyzer installed prevents any extension update.

rlabrecque commented 2 years ago

Hey @sandy081 is it possible to escalate this? It's becoming a security issue. People suffering from this are not receiving any extension updates and are falling behind on extension security patches. Thanks!

There might be a temporary fix that someone on the marketplace side could do for rust-analyzer specifically, though fixing the root causes in vscode would be fantastic as well.

MitchTalmadge commented 2 years ago

Fully agree that this is a security issue; users have no way to know that their auto updates are not working. There is no indication that updates are even available.

jonasbb commented 2 years ago

I see some more symptoms in my installation. I see different behavior between just opening the extension page or first searching for the extension and then opening the page. Using the pre-release version also seems not to cause issues with updates. More details are here https://github.com/rust-lang/rust-analyzer/issues/12305#issuecomment-1131673527

CyriacBr commented 2 years ago

In my case, I can't even install the extension. I've just setup a codespace but I receive a "Server returned 404" error when trying to install rust-analyzer.

rlabrecque commented 2 years ago

@isidorn Would you be able to triage this one given your activity in the rust-analyzer and marketplace repos?

sandy081 commented 2 years ago

@rlabrecque Apologies that I did not notice this. Will investigate soon. Are there any simple steps to reproduce?

sandy081 commented 2 years ago

It seems I am not able to install release versions of this extension at all

sandy081 commented 2 years ago

Marketplace CDN is returning 404 for following request

https://rust-lang.gallerycdn.vsassets.io/extensions/rust-lang/rust-analyzer/0.2.853/1639376535349/Microsoft.VisualStudio.Code.Manifest

Marketplace is returning above URL indeed when querying for this extension

image

CC @prashantvc @SaiKanth007

sandy081 commented 2 years ago

Here are the issues I noticed:

  1. Cannot install release version of Rust analyzer extension in Insiders (In stable works)
  2. Cannot update Rust analyzer extension
  3. Preventing other extensions to update

Root cause is that Marketplace when requested for latest versions, is returning 0.2.853 version that is invalid/bogus - this version's assets (manifest, vsix) are not found and it has no properties. It seems it was published with old publisher name.

Irrespective of that, an error while updating one extension shall not prevent other extensions.

SaiKanth007 commented 2 years ago

Looking into it

SaiKanth007 commented 2 years ago

The extension was recently transferred to a new publisher 'rust-lang' and there is a step that got missed from the publisher end. I will reach out to the publisher and discuss on this.

sandy081 commented 2 years ago

Pushed a fix to insiders to recover from it

rlabrecque commented 2 years ago
  1. @SaiKanth007 Can the marketplace team do anything to prevent this in the future, an extension publisher probably shouldn't be able to miss a step that breaks things this much.
  2. @sandy081 Which part of this issue specifically does your change fix? Assuming it at least allows other extensions to update now if you had rust-analyzer installed, then this issue is largely solved from my POV. I do think there's likely additional non-critical work to be done on VSCode's side to improve the experience around this, such as improving the error messaging.
sandy081 commented 2 years ago

Yes - it fixes the update.

jonasbb commented 2 years ago

I updated to the latest rust-analyzer version v0.3.1066 and can still reproduce this error with the release version of the extension. VS Code still tries to download https://rust-lang.gallerycdn.vsassets.io/extensions/rust-lang/rust-analyzer/0.2.853/1639376535349/Microsoft.VisualStudio.Code.Manifest.

The latest rust-analyzer release contains the PR "internal: Publish universal VSIX to make VS happy" https://github.com/rust-lang/rust-analyzer/pull/12349 From the descriptions here and in the PR it is not clear if that alone should have fixed the issues already.

SaiKanth007 commented 2 years ago

@jonasbb I assume the latest version for universal is not yet published to marketplace, the latest version for universal is still 0.2.853 on marketplace

jonasbb commented 2 years ago

@SaiKanth007 The last two releases (release and pre-release) are based on the above linked PR. The release v0.3.1066 is just a couple of hours old, so also after the PR was merged. That means that at least some new extension versions were published. Of course, it could be that the universal version failed for some reason, maybe @lnicola knows? Screenshot from 2022-05-23 12-05-20

lnicola commented 2 years ago

Publishing the universal VSIX failed in https://github.com/rust-lang/rust-analyzer/runs/6549037342?check_suite_focus=true#step:19:36 with an already exists error.

Maybe we should make sure to put the universal VSIX first in the list?

isidorn commented 2 years ago

@SaiKanth007 just informed me he is investigating. We should have more details soon. Thank you for your patience.

isidorn commented 2 years ago

It seems like this error is coming from the vsce publish step. We are emailing with Aleksey from the rust-analyzer extension side. We suggest to try a workaround to publish the universal version of the extension using the marketplace UI https://marketplace.visualstudio.com/manage/publishers/rust-lang

This is a workaround. Sorry about this.

lnicola commented 2 years ago

Would we have to do that only once, or every time? I don't know whether we have access there.

isidorn commented 2 years ago

Another workaround as @lnicola suggests - publishing universal first before other versions should work.

And yes, you should only need to do this once. We want you to keep your nice automatic flow.

lnicola commented 2 years ago

@isidorn that appears to have failed in an interesting way in https://github.com/rust-lang/rust-analyzer/runs/6559062568?check_suite_focus=true.

isidorn commented 2 years ago

@lnicola thanks a lot for trying. I suggest to try to upload the universal version directly via Marketplace UI then. I have also sent Alexey an email. If both of you do not have access let me know and then we can go for an alternative approach tomorrow.

And I apologise again for the issue, it seems like the combination of platform specific extensions and renaming the extension publisher uncovered quite some issues on our side.

lnicola commented 2 years ago

AFAIK neither of us has access, so that might be problematic.

And yeah, don't worry, we've had some fun with platform-specific extensions before.

isidorn commented 2 years ago

@lnicola I will drop you and Alexey an email. We have an idea.

sandy081 commented 2 years ago

rust-analyzer extension team has published an universal version which fixed this issue in VS Code stable. Hence closing this.

Thanks a lot @lnicola for your active involvement in getting this issue fixed. Very much appreciated 👏

lnicola commented 2 years ago

Wait, how did it fix the issue? Publishing the Alpine VSIX failed right afterwards.

sandy081 commented 2 years ago

Fix for this issue needed any universal version > 0.2.853 to be published and that seems to be happened.

Publishing the Alpine VSIX failed right afterwards.

This seems to be a different unrelated issue which shall be looked at separately.

isidorn commented 2 years ago

Thanks everybody for tackling this weird issue.

Community please let us know if somebody can still reproduce this problem. Thanks!

lnicola commented 2 years ago

Update: publishing went through!

The Marketplace still has a minor issue where it's only showing the pre-release versions (because they're higher than the stable ones), but that's not a new problem.

sesameJar commented 2 years ago

Hey guys, I accidentally removed my rust-analyzer and now I cannot install it for the same reason. Is this supposed to be fixed?

lnicola commented 2 years ago

@sesameJar did you try restarting Code afterwards?

PierreBeucher commented 2 years ago

Still had a similar issue, I upgraded to latest VS Code (1.68.1) and it works now.