vscode icon indicating copy to clipboard operation
vscode copied to clipboard

VS Code was lost on shutdown with pending update

Open manglobe opened this issue 7 years ago • 251 comments

It was the second time ,it happend. I download VScode's update patch when I was coding , and then shut down the computer and forgot to update it. Next day I turn the computer on and can't find VScode anywhere , all the file was empty.

  • OS Version : Windows 10 Home

manglobe avatar Jun 26 '18 01:06 manglobe

@manglobe What are your machine specs? Is your system managed by a company/administrator?

joaomoreno avatar Jun 26 '18 07:06 joaomoreno

@joaomoreno

操作系统名称	Microsoft Windows 10 家庭中文版
版本	10.0.16299 版本 16299
其他操作系统描述 	没有资料
操作系统制造商	Microsoft Corporation
系统名称	DESKTOP-O5EPRK9
系统制造商	Dell Inc.
系统型号	OptiPlex 5050
系统类型	基于 x64 的电脑
系统 SKU	07A2
处理器	Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz,3408 Mhz,4 个内核,4 个逻辑处理器
BIOS 版本/日期	Dell Inc. 1.6.5, 2017/9/9
SMBIOS 版本	3.0
嵌入式控制器版本	255.255
BIOS 模式	UEFI
BaseBoard 制造商	Dell Inc.
BaseBoard 型号	没有资料
BaseBoard 名称	基板
平台角色	台式机
安全启动状态	启用
PCR7 配置	需要提升才能查看
Windows 目录	C:\Windows
系统目录	C:\Windows\system32
启动设备	\Device\HarddiskVolume1
区域设置	中国
硬件抽象层	版本 = "10.0.16299.371"
用户名	DESKTOP-O5EPRK9\work
时区	中国标准时间
已安装的物理内存(RAM)	8.00 GB
总的物理内存	7.87 GB
可用物理内存	3.73 GB
总的虚拟内存	12.5 GB
可用虚拟内存	5.33 GB
页面文件空间	4.63 GB

My system managed by myself

manglobe avatar Jun 26 '18 08:06 manglobe

Let's try to detect if the system is about to be shutdown, we don't do anything.

joaomoreno avatar Jun 26 '18 12:06 joaomoreno

Sounds like you told it to install the patch "Later". So after the reboot it messed up patching. I've had this happen to me about 2-3 times now. Except I tell it to update immediately, it gets halfway and then fails. Attached log as requested by the error message

vscode-inno-updater.log


VS Code

Failed to install VS Code update. Please download and reinstall VS Code.

Please attach the following log file to a new issue on GitHub:

C:\Users\USERNAME\AppData\Local\Temp\vscode-inno-updater.log

OK


Setup

Unable to execute file:

C:\Program Files\Microsoft VS Code\Code.exe

CreateProcess failed; code 2.

The system cannot find the file specified.

OK

gmariani avatar Jun 26 '18 13:06 gmariani

@gmariani You seem to have #47841.

Please read this comment if you can provide more detail: https://github.com/Microsoft/vscode/issues/47841#issuecomment-393101777

Please read this one to disable background updates: https://github.com/Microsoft/vscode/issues/47841#issuecomment-395017687

Also read this one to provide feedback on our new user setup: https://github.com/Microsoft/vscode/issues/47841#issuecomment-399941682

joaomoreno avatar Jun 26 '18 16:06 joaomoreno

@joaomoreno vscode-inno-updater.log That's the updater log. There was no Error, only Delete.

manglobe avatar Jun 27 '18 01:06 manglobe

Hey @joaomoreno, I've also faced the problem when VS Code decided to update on Windows shutdown, which resulted in the next boot having no VS Code installed on the system. Had to download and install it again 😢

michelkaporin avatar Sep 07 '18 11:09 michelkaporin

I just had this issue also. Visual Studio wanted to update on Windows shutting down. Now there is no VS Code installed on the computer. Here's my system specs.

OS Name	Microsoft Windows 10 Pro
Version	10.0.17134 Build 17134
System Manufacturer	Dell Inc.
System Model	Inspiron 15-7579
Processor	Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz, 2701 Mhz, 2 Core(s), 4 Logical Processor(s)
BIOS Version/Date	Dell Inc. 1.27.0, 1/18/2019
SMBIOS Version	3.0
Embedded Controller Version	255.255
BIOS Mode	UEFI
BaseBoard Manufacturer	Dell Inc.
BaseBoard Model	Not Available
BaseBoard Name	Base Board
Platform Role	Mobile
Secure Boot State	Off
Windows Directory	C:\WINDOWS
System Directory	C:\WINDOWS\system32
Boot Device	\Device\HarddiskVolume1
Locale	United States
Hardware Abstraction Layer	Version = "10.0.17134.765"
Time Zone	Eastern Daylight Time
Installed Physical Memory (RAM)	8.00 GB
Total Physical Memory	7.87 GB
Available Physical Memory	2.86 GB
Total Virtual Memory	16.9 GB
Available Virtual Memory	7.79 GB
Page File Space	8.99 GB

Edit: After reinstalling VS Code to same directory all my extensions are working and code I was working on last loaded right where I left off thankfully... 😅

EvanCrane avatar Jun 06 '19 13:06 EvanCrane

Happened to me today. Logging in after 'Shutdown anyway' and there's no code editor.

Lukortech avatar Aug 13 '19 08:08 Lukortech

Happened to me as well. My issue was that I needed to restart VS because I was (I think) having Typescript issues. I closed it, and restarted it (apparently too fast because the old process was still running) and boom, it was gone (no machine restart).

dudewad avatar Aug 15 '19 19:08 dudewad

Happened to me today. Logging in after 'Shutdown anyway' and there's no code editor.

Same thing happend to me.

NOMADE55 avatar Aug 16 '19 18:08 NOMADE55

Same here,

I received a warning on exit that it was unable to update due to some locked file. Tried the "try again" button twice and then pressed "Cancel". After that, no VS Code on my computer anymore.

anders-lundgren avatar Aug 18 '19 14:08 anders-lundgren

Similar issue yesterday. Vscode wanted to update an automatic update, computer slowed down to a halt for a second, update failed and rebooted explorer.exe. Now vscode is no longer on my system.

vscode-inno-updater-1566340881.log

Aug 21 08:41:21.270 INFO Starting: C:\Users\Fred\AppData\Local\Programs\Microsoft VS Code\Code.exe, true
Aug 21 08:41:21.274 INFO Checking for running Code.exe processes... (attempt 1)
Aug 21 08:41:21.275 INFO Code.exe is running, wait a bit
Aug 21 08:41:21.776 INFO Checking for running Code.exe processes... (attempt 2)
Aug 21 08:41:21.779 INFO Code.exe is running, wait a bit
Aug 21 08:41:22.280 INFO Checking for running Code.exe processes... (attempt 3)
Aug 21 08:41:22.283 INFO Code.exe is running, wait a bit
Aug 21 08:41:22.784 INFO Checking for running Code.exe processes... (attempt 4)
Aug 21 08:41:22.787 INFO Code.exe is not running
Aug 21 08:41:22.787 INFO Checking for possible conflicting running processes... (attempt 1)
Aug 21 08:41:22.790 INFO Inno Updater v0.8.0
Aug 21 08:41:22.790 INFO Starting update, silent = true
Aug 21 08:41:22.815 INFO do_update: "C:\\Users\\Fred\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe", _
Aug 21 08:41:22.815 INFO move_update: "C:\\Users\\Fred\\AppData\\Local\\Programs\\Microsoft VS Code\\unins000.dat", _
Aug 21 08:41:22.815 INFO Reading directory: "C:\\Users\\Fred\\AppData\\Local\\Programs\\Microsoft VS Code"

...

Aug 21 08:41:23.379 INFO Get file handle: "C:\\Users\\Fred\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\extensions\\ms-vscode.node-debug2\\node_modules\\vscode-chrome-debug-core\\i18n\\rus\\out\\src\\transformers\\remotePathTransformer.i18n.json" (attempt 1)
Aug 21 08:41:23.379 INFO Collected all directories and file handles
Aug 21 08:41:23.390 INFO All file handles marked for deletion
Aug 21 08:41:23.533 INFO All files deleted
Aug 21 08:41:23.533 INFO Delete directory recursively: "C:\\Users\\Fred\\AppData\\Local\\Programs\\Microsoft VS Code\\bin" (attempt 1)

Then it ends there

fredheidrich avatar Aug 21 '19 19:08 fredheidrich

Just as a comment for those who had the same issue, when I reinstalled (yes, quite bothersome) VSCode all my extensions, configs and keybindings where there. So, even though this error/unexpected behavior is pretty inconvenient, it's not *THAT *critical I'd say.

NOMADE55 avatar Aug 21 '19 20:08 NOMADE55

@NOMADE55 Just to clarify, you think a piece of software uninstalling itself during a supposed update cycle is not a critical issue? If a piece of software I wrote uninstalled itself when it was supposed to be improving itself I would panic and fix it immediately - this is the kind of bug I consider unacceptable and would actually switch IDEs over.

dudewad avatar Aug 21 '19 20:08 dudewad

@dudewad No, I'm just an user of this IDE, so my message was sort of a message for other users like me who might think they've lost everything. I'm do not participate actively on this repo nor I think my message would stop any active debugging of this issue.

NOMADE55 avatar Aug 21 '19 20:08 NOMADE55

I've had this happen many times on multiple machines. Windows shutting down forcefully for updates and such, killing the VSCode updater. Usually this happens when I leave my computer on and IT pushes patches in the middle of the night. VSCode saves my work, but it can't save itself from pending destruction!

I'm not sure why this is a problem that isn't already fixed (as this issue was opened over a year ago). It seems that the update process does the following:

  1. Uninstall the current version
  2. Install the new version
  3. Update shortcuts?

Instead it should be doing this:

  1. Install the new version
  2. Uninstall the current version
  3. Update shortcuts?

That way it's not possible for it to be put in a bad state if the update is interrupted. Worst case scenario is that it is still pointing to the old version and it prompts you to update again. No biggie.

By contrast, I find myself having to go out to code.visualstudio.com often to redownload and reinstall Code Insiders. Not a good use of my time, running through the installer every time my computer reboots.

joeskeen avatar Sep 19 '19 17:09 joeskeen

Wow, mine also just disappeared. Perhaps this should be an atomic process somehow?

freekvh avatar Oct 16 '19 13:10 freekvh

Hi there. The same issue occured for me as of today. I shut down my PC yesterday, had a popup opened with information I didn't get to read, this morning the programm was completely gone.

FonsyCat avatar Oct 17 '19 12:10 FonsyCat

This issue happens to me once every couple of days. It has something to do with an update checker I think

DragosPopse avatar Oct 17 '19 15:10 DragosPopse

This has happened to me twice now on Windows 10 Pro. When I go into "Apps & Features" I see it there. image

Yet it is nowhere to be found. It seems to happen after a system reboot. Can't say I've ever had a piece of software uninstall itself multiple times unprompted.

nickzelei avatar Nov 09 '19 17:11 nickzelei

I have just had the same issue, my apps&features shows it there (though the icon is missing) . This is the second time it's gone missing.

hsoolien avatar Nov 15 '19 03:11 hsoolien

It is clear that this is a problem with the auto updater. As it always happens when a new version is released, a workaround would be disabling the auto updates (forgot the steps but google should provide an answer)

DragosPopse avatar Nov 15 '19 08:11 DragosPopse

Just got the same problem too, vsc was lost but also were other programs (git, mathematica, pyzo, ...). I shut down vsc while it was trying to update (but can't understand why it uninstalled the other programs)

Thomior avatar Nov 15 '19 16:11 Thomior

This has just occurred to my friend, Visual Studio deleted itself.

dilanpace1496 avatar Nov 16 '19 19:11 dilanpace1496

FYI, I think the triage priority of this is severely off. I switched IDEs after this issue occurred to me. @joaomoreno why is this not considered a priority zero issue, given that the application deletes itself?

dudewad avatar Nov 18 '19 17:11 dudewad

Happened to me on Friday, how is this issue still open after more than one year...

raduzahariaarnia avatar Nov 25 '19 07:11 raduzahariaarnia

Happened to me today

I can't find a vscode-inno-updater.log file anywhere Looking in the following directory, I can see the basic folder structure but a lot of the folders seem empty and there is no Code.exe: C:\Users\user\AppData\Local\Programs\Microsoft VS Code

There is however a directory in there with the name '_' (a single underscore). This has a much more fleshed out folder structure, and the Code.exe file

When I run that Code.exe file VSCode opens fine with all extensions installed and settings remembered. It also opened the update notes as well.

andy-hugecalf avatar Nov 28 '19 23:11 andy-hugecalf

Same here !!

agnivesh29 avatar Dec 01 '19 22:12 agnivesh29

This just happened for as well.

The first I noticed something was wrong was when the pinned app icon on the task bar lost it's icon. When I clicked on the icon to 'launch' the app I was presented a Windows shortcut is broken dialog.

When I searched for Visual Studio Code in Windows search it temporarily display in results, then launched, but then I was presented the same Windows shortcut is broken dialog.

The icon eventually unpinned itself from the task bar and now the app has completely disappeared from my PC. However, VSC still seems to be showing in Add Remove Programs.

Uploading VSC.Add.Remove.Programs.jpg…

ghost avatar Dec 10 '19 01:12 ghost