microsoft / vscode

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

VS Code was lost on shutdown with pending update #52855

Open manglobe opened 6 years ago

manglobe commented 6 years ago

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.

joaomoreno commented 6 years ago

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

manglobe commented 6 years ago

@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

joaomoreno commented 6 years ago

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

gmariani commented 6 years ago

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

joaomoreno commented 6 years ago

@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

manglobe commented 6 years ago

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

michelkaporin commented 5 years ago

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 😢

EvanCrane commented 5 years ago

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... 😅

Lukortech commented 4 years ago

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

dudewad commented 4 years ago

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).

NOMADE55 commented 4 years ago

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

Same thing happend to me.

anders-lundgren commented 4 years ago

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.

fredheidrich commented 4 years ago

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

NOMADE55 commented 4 years ago

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.

dudewad commented 4 years ago

@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.

NOMADE55 commented 4 years ago

@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.

joeskeen commented 4 years ago

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.

freekvh commented 4 years ago

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

FonsyCat commented 4 years ago

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.

DragosPopse commented 4 years ago

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

nickzelei commented 4 years ago

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.

hsoolien commented 4 years ago

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.

DragosPopse commented 4 years ago

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)

Thomior commented 4 years ago

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)

dilanpace1496 commented 4 years ago

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

dudewad commented 4 years ago

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?

raduzahariaarnia commented 4 years ago

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

andy-hugecalf commented 4 years ago

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.

agnivesh29 commented 4 years ago

Same here !!

ghost commented 4 years ago

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…]()

avivbiton commented 4 years ago

Happened to me as well, and VS Code website download link is broken. Never thought I wouldn't be able to code because of an IDE

amysen commented 4 years ago

Just happened to me, not on shutdown though. Was there one minute and now it's gone.

kenbonilla commented 4 years ago

Happened overnight to me

RobertKlohr commented 4 years ago

Yesterday this happened to me. I started VSCode in the afternoon and used it for several hours. Then exited the application and shutdown my system. When I started my system today VSCode was uninstalled.

Windows 10 VSCode 1.41 Installed in User space

Belows are all the entries from the "AppData\Roaming\Code\logs\20200206T154141\main.log"

It seems interesting that the logs show I had automatic updates disabled but did the download and started the updates. There was a folder created "AppData\Local\Programs\Microsoft VS Code_" with the data time stamp that matches the log entry below where I can see the files for the update. There are several other folders under "AppData\Local\Programs\Microsoft VS Code\resources" folder and some of its subfolders (not all of them) that have an updated date time stamp that matches my shutdown time AND there are no files in this entire folder tree.

Maybe the bug is in the update code that fails to check or honor the "disable update setting" and downloads the update and uninstalls VSCode but then does check the setting and does not complete the install action.

[2020-02-06 15:41:41.223] [main] [info] update#setState idle [2020-02-06 15:41:41.223] [main] [info] update#ctor - startup checks only; automatic updates are disabled by user preference [2020-02-06 15:42:11.223] [main] [info] update#setState checking for updates [2020-02-06 15:42:11.260] [main] [info] update#setState downloading [2020-02-06 15:42:16.639] [main] [info] update#setState updating [2020-02-06 15:42:36.764] [main] [info] update#setState ready

YesDnil41 commented 4 years ago

I had this issue happen to me as well. Friday 7 Feb 2020 an update was made available. I turned off the computer. Started the computer again and found no Visual Studio Code as if it uninstalled itself. I downloaded the latest version today 10 Feb 2020 and had this error code present "The terminal process terminated with exit code: {0}" Windows 10 pc

YesDnil41 commented 4 years ago

In addition to the application deleting itself, the terminal becomes unavailable after re-instillation. :|

RobertKlohr commented 4 years ago

@joaomoreno this issue is assigned to you by @roblourens but your last activity on this issue was a year ago. Would please take some action to move this along or remove yourself from the assignment so that someone else might pick it up? Right now it's just gathering comments.

As stated in previous comments this bug does not cause the application to stop working or slow down but uninstall itself. How is this sitting in the backlog almost 2 years after it was first reported?

joaomoreno commented 4 years ago

@RjKGitHub Unfortunately there just hasn't been any developments over here.

mmehr2 commented 4 years ago

POSSIBLE WORKAROUND

Well, I've noticed it twice now as well. For me, the ./bin directory that contains code.exe got renamed to '' and an empty bin directory got created. I put the original back (or maybe I moved the files into and renamed it back, I forget) and it seemed to work fine. I've verified that the resulting code.exe file does have the new date and version resource, and it does display the latest release notes when run, so I would suspect the bug is lurking in the final code at the end of the auto-update process.

And yes, I'm always leaving my system on overnight, so it does that. Annoying, but I have come to expect it. I'd love to see a solution, though.

Kmilka commented 4 years ago

Hey @joaomoreno! I had this problem also yesterday on Windows 10. I write this comment only to increase the priority of this issue to VSCode support. People suffer. Can you, please, do something?

mverkerk-godaddy commented 4 years ago

Same problem here and not for the first time - i did a regular restart of my machine (Windows 10) and upon return, vscode was missing. Like @Kmilka, i just want to raise awareness and make sure this goes high on the priority list. I had to postpone a code presentation since i couldn't display/debug my code which I had planned to do in vscode. This is a frustrating hick-up in this otherwise AWESOME tool ...

WillGoGithub commented 4 years ago

Same thing happend to me 3 times.

rui-ren commented 4 years ago

The is because of failure update. I got this issue, then downloaded and installed by myself. Problem solved

mornir commented 4 years ago

This happened to me today (on Windows 10 v1909). Strange to have a program auto-delete itself. But it took me 20 seconds to reinstall it.

geduardo commented 4 years ago

Same issue over here.

Wilus23 commented 4 years ago

Maybe this should help someone: My problem: I had a odd problem, VSC just disappeared from my PC. I couldn't find any VSC file or folder. I tried to uninstall VSC, but even there I couldn't find it. Then I downloaded and opened the installation file from code.visualstudio.com. When the installation was ending, a message popped up "Access denied". My solution: First I changed the hidden folders to visible like in this tutorial: https://www.youtube.com/watch?v=rBteQswtPI0 Then I went in: C:\Users{My_win10_username}\AppData\Local\Programs then folder -> Microsoft VS Code I deleted the folder and installed again the newest Visual Studio Code. That worked!

I hope that this will help someone in the future :)

YesDnil41 commented 4 years ago

This happened 2x to me this week again! This program is frustrating to use. It's smells like the installation on the user directory proves problematic with the updater. I have VS installed as an admin on the computer and again, when an update comes around, EVEN THOUGH I'VE DISABLED THE AUTO-UPDATES, the update performs. When i attempt to reinstall, i get messages about not having permissions on the computer. Here's an example "Windows cannot access the specified device, path, etc....." the file path is the user directory not the system. Can this get fixed please?!

image

image

image

image

image

image

image

Rajesh-Narayanappa87 commented 4 years ago

Happened to me on mac in middle of an meeting. I can't find vscode in my mac anymore..

mbitzos commented 4 years ago

I had this happen to me just today (Apirl 8th 2020) just as an update that this bug has happened recently.

muhfs94 commented 4 years ago

happenned to me just now. I just needed to restart my laptop without closing (or had I closed it? I forgot) then it just disappeared. need your help on this one please