Closed felipecrs closed 3 weeks ago
Is there really such a C:\\Users\\felip\\AppData\\Local\\Programs\\Microsoft VS Code\\nul
file in there?
Yes, there is. But if I delete it through Windows File Explorer, it comes back during the update itself and then the update errors again.
I tried deleting the file and clicking retry on the update a few times, but it doesn't seem to end.
Since there was an update a few moments ago, I was able to reproduce the issue again:
In fact, I can't delete the file through Windows Explorer.
Removing with PowerShell doesn't work either:
❯ Remove-Item "C:\Users\felip\AppData\Local\Programs\Microsoft VS Code\nul"
Remove-Item: Cannot find path 'C:\Users\felip\AppData\Local\Programs\Microsoft VS Code\nul' because it does not exist.
Removing with wsl
works though:
wsl -e bash -c 'rm -f "$(wslpath "C:\Users\felip\AppData\Local\Programs\Microsoft VS Code\nul")"'
This indeed deletes the file and it no longer shows up in the Windows File Explorer.
Then, as I had mentioned, if I click retry on the updater window, it will spin a little and then fail again. The file will show up again on Windows File Explorer and the updater fails with the same error.
This means the file is being created by the updater itself.
I even tried deleting the file and waiting some minutes before clicking Retry to ensure the file won't be created again by some other process, but it doesn't. It only gets created after I click Retry on the updater.
I tried updating again today, and it worked, surprisingly. I don't think I did anything special beyond perhaps applying Windows Updates.
I hit this today in a slightly different version (https://github.com/microsoft/vscode/issues/225719) so it seems like it's still present
Upon killing the processes hold the lock and taking the update, the restored terminals show as disconnected, and I could not create new terminals until I restarted vscode:
Edit: so far 4 for 4 on hitting this each time I update Insiders
I haven't seen this, I tried restarting with vscode/xterm.js build tasks active and code - oss opened and it all shut down correctly.
I have no idea what the nul
is about, but I looked at the closepsuedoconsole code in node-pty because of @connor4312's repro (https://github.com/microsoft/vscode/issues/225719) and it seems like it's all hooked up correctly:
@deepak1556 any hints on what could be going wrong here? I'm not sure how to investigate this further.
https://github.com/microsoft/vscode/issues/225719 and this one are unrelated. I will dedupe them.
nul
is special device name which can be treated similar to /dev/null
this is used by utility process and node.js to provide the ignore
option to stdio. We do launch the inno_updater
using this stdio option of child process https://github.com/microsoft/vscode/blob/e37706186d2105b4158df80574323ebb987d7f64/src/vs/platform/update/electron-main/updateService.win32.ts#L226-L230 however those CreateFileW
callsites should not create a file on disk, needs confirmation if it is the updater process. It is also a reserved name in Win32 namespace hence file manipulation cannot be performed from Win32 programs, refs https://github.com/PowerShell/PowerShell/issues/16841
@felipecrs can you perform the following steps,
1) Delete the nul
file from a posix shell or command prompt
2) Start https://learn.microsoft.com/en-us/sysinternals/downloads/procmon to capture events
3) Perform update from VS Code
4) Save the events from proc monitor and send them to Deepak.Mohan@microsoft.com
@deepak1556, absolutely. Will remember to do that as soon as a new update of vscode arrives.
I already tried manually downgrading it then updating it, but the update happened very fast and the issue didn't happen. I guess it was cached somehow.
@felipecrs Any updates here? 🙏
Yes, it hasn't happened anymore. :)
Does this issue occur when all extensions are disabled?: Yes/No
Steps to Reproduce:
I already tried several things, but the only thing that seems to work is to download the setup.exe again and run it by hand (which works flawlessly, no errors).