Skip to content

VS Code tried to update itself and deleted resources/app/out; no longer starts and broke my existing open sessions #224571

Open
@sandersaares

Description

@sandersaares

Does this issue occur when all extensions are disabled?: Unknown

Version: 1.91.1 (system setup)
Commit: f1e16e1
Date: 2024-07-09T22:06:49.809Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.22631

Steps to Reproduce:

  1. Wait for a VS Code update to be automatically installed at 12:00 on an arbitrary day (I do not know how/why/when exactly this occurs).
  2. Observe that any open VS Code window suddenly becomes nonfunctional - many button presses do nothing, tasks fail to launch.
  3. Observe that VS Code logs (e.g. user settings sync log) complain about missing .js files.
  4. Observe that starting new VS Code instances fails with the below error message.
Error: Cannot find module 'C:\Program Files\Microsoft VS Code\resources\app\out\main'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1055:15)
    at s._resolveFilename (node:electron/js2c/browser_init:2:115690)
    at node:electron/js2c/browser_init:2:121111
    at node:electron/js2c/browser_init:2:121360
    at node:electron/js2c/browser_init:2:121364
    at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:392:7)
    at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:328:10)
    at loadBuiltinModule (node:internal/modules/helpers:68:7)
    at Module._load (node:internal/modules/cjs/loader:923:17)
    at c._load (node:electron/js2c/node_init:2:13672)

Has happened twice so far (last time about a month ago, presumably with previous update).

VS code main.log has the following on recent startup before the event:

2024-08-02 07:04:09.468 [info] update#setState idle
2024-08-02 07:04:39.476 [info] update#setState checking for updates
2024-08-02 07:04:39.480 [info] update#setState downloading
2024-08-02 07:04:39.481 [info] update#setState downloaded 

The Application event log has some RestartManager entries at the time when the problem started:

  1. Starting session 0 - ‎2024‎-‎08‎-‎02T09:00:39.339256800Z.
  2. Application 'C:\Program Files\Microsoft VS Code\Code.exe' (pid 8852) cannot be restarted - Application SID does not match Conductor SID.. (repeated with different PIDs)
  3. Machine restart is required.
  4. Ending session 0 started ‎2024‎-‎08‎-‎02T09:00:39.339256800Z.

Next to the vanished resources/app/out directory is a directory resources/app/node_modules.asar.unpacked whose timestamp matches the event in the Application event log.

I surmise that VS Code tried to update itself but somehow messed up and left me with a broken installation. I will reinstall since I need to continue my work but I have made copies of relevant folders in case there may be something valuable in there (I was not able to find any other relevant logs, though).

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buginstall-updateVS Code installation and upgrade system issueswingetIssues related to winget packages

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions