Skip to content
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

VS Code automatic update not working #225160

Closed
felipecrs opened this issue Aug 8, 2024 · 12 comments
Closed

VS Code automatic update not working #225160

felipecrs opened this issue Aug 8, 2024 · 12 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug install-update VS Code installation and upgrade system issues papercut 🩸 A particularly annoying issue impacting someone on the team windows VS Code on Windows issues

Comments

@felipecrs
Copy link
Contributor

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: started with recent versions
  • OS Version: Windows 11 23H2 and 24H2

Steps to Reproduce:

  1. On my machine, open an outdated VS Code, click on check updates
  2. Wait for it to ask to restart to complete the update
  3. Click on it, wait, then:
    explorer_m88sg2IF08
    vscode-inno-updater-1723140822.log

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

@joaomoreno
Copy link
Member

Is there really such a C:\\Users\\felip\\AppData\\Local\\Programs\\Microsoft VS Code\\nul file in there?

@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Aug 15, 2024
@felipecrs
Copy link
Contributor Author

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.

@felipecrs
Copy link
Contributor Author

Since there was an update a few moments ago, I was able to reproduce the issue again:

image

In fact, I can't delete the file through Windows Explorer.

@felipecrs
Copy link
Contributor Author

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.

@joaomoreno joaomoreno assigned Tyriar and unassigned joaomoreno Aug 16, 2024
@joaomoreno joaomoreno removed the info-needed Issue requires more information from poster label Aug 16, 2024
@felipecrs
Copy link
Contributor Author

I tried updating again today, and it worked, surprisingly. I don't think I did anything special beyond perhaps applying Windows Updates.

@connor4312
Copy link
Member

I hit this today in a slightly different version (#225719) so it seems like it's still present

@connor4312
Copy link
Member

connor4312 commented Aug 16, 2024

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:

image

Edit: so far 4 for 4 on hitting this each time I update Insiders

@Tyriar Tyriar added this to the August 2024 milestone Aug 16, 2024
@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug terminal-conpty Integrated terminal issues related to the ConPTY backend terminal-process Problems launching processes, managing ptys, exiting, process leaks, etc. labels Aug 16, 2024
@connor4312 connor4312 added the papercut 🩸 A particularly annoying issue impacting someone on the team label Aug 21, 2024
@Tyriar
Copy link
Member

Tyriar commented Aug 23, 2024

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 (#225719) and it seems like it's all hooked up correctly:

https://github.com/microsoft/node-pty/blob/cb94da7f1aca551366fd7ffb27b1268d1b90679d/src/win/conpty.cc#L529-L535

@deepak1556 any hints on what could be going wrong here? I'm not sure how to investigate this further.

@deepak1556
Copy link
Collaborator

#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

const child = spawn(this.availableUpdate.packagePath, ['/verysilent', '/log', `/update="${this.availableUpdate.updateFilePath}"`, '/nocloseapplications', '/mergetasks=runcode,!desktopicon,!quicklaunchicon'], {
detached: true,
stdio: ['ignore', 'ignore', 'ignore'],
windowsVerbatimArguments: true
});
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 PowerShell/PowerShell#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 [email protected]

@deepak1556 deepak1556 added install-update VS Code installation and upgrade system issues windows VS Code on Windows issues and removed terminal-conpty Integrated terminal issues related to the ConPTY backend terminal-process Problems launching processes, managing ptys, exiting, process leaks, etc. labels Aug 26, 2024
@deepak1556 deepak1556 removed this from the August 2024 milestone Aug 26, 2024
@felipecrs
Copy link
Contributor Author

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

@joaomoreno
Copy link
Member

@felipecrs Any updates here? 🙏

@felipecrs
Copy link
Contributor Author

Yes, it hasn't happened anymore. :)

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Nov 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug install-update VS Code installation and upgrade system issues papercut 🩸 A particularly annoying issue impacting someone on the team windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests

5 participants