-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
Extension incomplete after update #43813
Comments
Another instance of a corrupt extension https://github.com/Microsoft/vscode-tslint/issues/323#issuecomment-366261023. I´m starting to think that we should have a checksum for an installed extension so that we can detect a corruption and recover from it. |
@egamma wrote:
Here you are: shared.log |
@thorn0 From the logs I am guessing following:
After this, I think you have TS Lint extension working. I would be interested to know how the extension got corrupted before above happened. We preserve logs for last 10 VS Code sessions, hoping that the corrupted extension might occurred during those 10 sessions. Can you please share the logs of the shared process from last available sessions. To get that
Also, any idea if you restarted (quit and restart) VS Code while the update of TS Lint extension is happening? |
That's what helped:
First I tried reinstalling the extension without the step 2, but it didn't help.
Sorry, I open and close VS Code often enough, so there are only today's and yesterday's logs there.
Probably. Extensions are updated automatically, so I don't pay much attention to their updating. |
Logs at the point of the corruption would have been helpful to know what happened. My suspect is that code would have been restarted while extension update is in progress. |
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines. Happy Coding! |
This will be fixed in the perspective of |
Will it be something like along the lines of:
? |
Hmm I suspect download was not an issue but extracting for which we do not have checksum. If there is an interruption or failure while extracting, I will not consider that as installed and remove it. |
I pushed following fix in #44471
The other case that is left is when there is an abrupt shutdown of VS Code. |
@sandy081 This has been happening multiple times in the Go extension as well. The extension fails to activate due to missing files. For some, uninstall -> install works. Others have to manually delete the extension from the extensions folder and then install. Next time it happens, I'll direct them here and ask them to share the logs of the shared process cc @octref who has seen this in the vetur extension as well |
@ramya-rao-a Yeah I opened #44709...
That's the same case with Vetur. Do you have any theory as to why in some cases, uninstall -> install works, whereas for some people they had to remove the extension folders manually?
Maybe a fix for that could be making the shutdown or upgrade process start until all extension upgrades are done. It would be a common case where people are not using Code for a few days, got updates for both Code and extensions, and did the Code upgrade while extensions were installing. I actually get this easily reproduced. Go to Vim's extension folder and in
I think it does not cover the case where the extraction completed without error but some files become missing. Are we 100% sure we are not hitting any bugs in |
@octref For Go there is a good mix of Windows, linux and Mac. So I don't think this is a Windows specific |
This is because, Internally, during uninstall we just tag the extension as uninstalled and remove this tag if user installs it immediately. If user wants to remove and install the extension completely I have introduced a new command
Yes, it does not cover shutdown case while update is happening. One suggestion from Alex is to extract it to some temp folder and move it when the extraction is complete. But this will also have a time frame where VS Code could quit while moving.
I am not sure. |
Thanks for the addition. I'll point people to using it until a checksum becomes available. |
Is the extension removed some time later if the user doesn't re-install it immediately? Sounds like a really questionable design decision any way. |
Yes, extension is removed when VS Code is restarted. Removing the uninstalled tag happens only If the user is trying to install the same version as he/she uninstalled. If there is a new version available, new version is installed. |
@sandy081 I think there's still an issue here. I don't know how this is happening, but it's quite easy to reproduce. I click the install button on an extension, them immediately press cmd+q. Then I see some files in the We should just be calling fs.rename, so something weird is up. I tried it from the command line, pressing ctrl+c while installing, but don't see an issue there. The shared process logs don't show anything useful. I think they are missing the last log message or two.
|
@roblourens Yes you are right. I expected operation I reverted the Better approach would be
|
@bpasero Helped in investigating deeper into this to understand why Fallback was needed for the windows defender issue during rename. So fix is to run the fallback only if the error is EPERM error in Windows. Thanks @bpasero |
To verify:
Please try above steps during different timings during extension installation |
Verified under Windows. |
Verified on Linux (Ubuntu 16.04) |
@roblourens Can you please verify on Mac |
Verified on Mac. Is the fallback for if it still fails after the 5s retry period? And in this case the promise was just being canceled when the renderer process goes down? |
Yes fallback is for the case when the rename fails after trying for 5s. |
Did you see a case where the rename still failed after trying for 5s, or is it a theoretical problem? This solution still leaves a gap where the unzip to the final extension folder could be interrupted, which I think was basically the original problem. You mentioned above that another sort of solution would be better and I agree with that. #43813 (comment) |
@roblourens Yes it is an hypothesis and it could cause user not able to install extensions at all. Yes, there could be still some set of users (who has windows defenders holding onto files for more than 5s) can fall into this gap. But I think that will be very very minimal. I have already pushed a fix to masters to remove the fallback and increase the retry time to 30s. I am also thinking to increase time to a minute. If there is a process that hangs onto extracted folder for such an amount of time, it is really an issue that the user should be known to. Because, it will be an issue while removing extensions too. So this will remove that very minimal set of users too. I also agree other solution is bit consistent but was not trivial to implement in last minute. This can be thought about too in April. |
pls see this issue https://github.com/Microsoft/vscode-tslint/issues/324.
The text was updated successfully, but these errors were encountered: