VS Code Remote Server Update: Incomplete node_modules Installation
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
Type: Bug
### Environment
- VS Code Remote-SSH connecting to a remote host (Linux)
- Updated VS Code client triggered server update to commit `5264f2156cbcd7aea5fd004d29eaa10209155d66`
### Summary
After updating VS Code, the remote server's update mechanism downloaded the new server version completely into a staging directory (`Stable-5264f2156cbcd7aea5fd004d29eaa10209155d66.staging/`) but only partially copied `node_modules` into the live server directory. The result was 73 of 93 expected modules present, with critical dependencies missing. The server marked itself as ready and began accepting connections despite being broken.
### Symptoms
- Extension Host process crashes immediately on launch with exit code 1
- VS Code windows repeatedly disconnect and reconnect in a loop (~25-second cycle)
- Errors in server log: `Cannot find module 'socks-proxy-agent'`, `Cannot find module 'bindings'`, `Cannot find module 'uuid'`, `Cannot find module '@microsoft/applicationinsights-shims'`
- Server eventually shuts down: "all consumers inactive"
### Root Cause
The CLI agent's staging-to-live finalization step was incomplete. Evidence:
| Location | `node_modules` count |
|----------|---------------------|
| Previous working server (`fc3def...`) | 93 |
| New server staging dir (`5264f2...staging/server/`) | 93 |
| New server live dir (`5264f2.../server/`) | **73** ← 20 modules missing |
The download/extraction into staging succeeded, but the move/copy from staging to the live path lost 20 packages. No integrity check was performed before the server was activated.
### Impact
- Complete inability to use VS Code Remote-SSH until manually resolved
- No automatic fallback to the previous working server version
- No user-visible error message indicating what went wrong — just repeated "Reconnecting..." in the VS Code UI
### Workaround
Manually replaced the broken live server directory with the complete staging copy:
```bash
rm -rf ~/.vscode-server/cli/servers/Stable-5264f2156cbcd7aea5fd004d29eaa10209155d66/server
cp -a ~/.vscode-server/cli/servers/Stable-5264f2156cbcd7aea5fd004d29eaa10209155d66.staging/server \
~/.vscode-server/cli/servers/Stable-5264f2156cbcd7aea5fd004d29eaa10209155d66/server
```
### Suggested Improvements
1. Use atomic directory rename (`rename()` syscall) for staging → live transition instead of incremental copy
2. Verify installation integrity (module count or checksum) before marking the server active
3. Fall back to the previous working server version if the new one fails to start the Extension Host
4. Surface a clear error to the user rather than silently looping reconnection attempts
VS Code version: Code 1.128.1 (Universal) (5264f2156cbcd7aea5fd004d29eaa10209155d66, 2026-07-14T07:19:31-07:00)
OS version: Darwin arm64 25.5.0
Modes:
Remote OS version: Linux x64 6.12.94-123.180.amzn2023.x86_64
System Info
|Item|Value|
|---|---|
|CPUs|Apple M2 Pro (12 x 2400)|
|GPU Status|2d_canvas: enabled
GPU0: VENDOR= 0x106b [Google Inc. (Apple)], DEVICE=0x0000 [ANGLE (Apple, ANGLE Metal Renderer: Apple M2 Pro, Version 26.5.2 (Build 25F84))], DRIVER_VENDOR=Apple, DRIVER_VERSION=26.5.2 *ACTIVE*
Machine model name: Mac
Machine model version: 14.9
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: enabled_on
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgpu: enabled
webnn: disabled_off|
|Load (avg)|2, 3, 3|
|Memory (System)|32.00GB (0.40GB free)|
|Process Argv||
|Screen Reader|no|
|VM|0%|
|Item|Value|
|---|---|
|Remote|SSH: devdesk-x86-64|
|OS|Linux x64 6.12.94-123.180.amzn2023.x86_64|
|CPUs|Intel(R) Xeon(R) Platinum 8488C (32 x 0)|
|Memory (System)|61.77GB (53.75GB free)|
|VM|0%|
Extensions (15)
Name|Identifier|Author|Version
---|---|---|---
Dev Containers|ms-vscode-remote.remote-containers|ms-vscode-remote|0.463.0
Remote - SSH|ms-vscode-remote.remote-ssh|ms-vscode-remote|0.124.0
Remote - SSH: Editing Configuration Files|ms-vscode-remote.remote-ssh-edit|ms-vscode-remote|0.87.0
Remote Explorer|ms-vscode.remote-explorer|ms-vscode|0.5.0
vscode-base64|adamhartford.vscode-base64|adamhartford|0.1.0
Ion Format Support|avin.ion-format-support|Avin|1.0.4
XML Tools|dotjoshjohnson.xml|DotJoshJohnson|2.5.1
JSON Tools|eriklynd.json-tools|eriklynd|1.0.2
Viceroy|marklel.vscode-brazil|marklel|0.53.203059
Python Debugger|ms-python.debugpy|ms-python|2026.6.0
Python|ms-python.python|ms-python|2026.4.0
Pylance|ms-python.vscode-pylance|ms-python|2026.2.1
Python Environments|ms-python.vscode-python-envs|ms-python|1.36.0
C/C++|ms-vscode.cpptools|ms-vscode|1.32.2
Sort lines|tyriar.sort-lines|Tyriar|1.12.0
Contributor guide
Research direction
Start with the CLI agent's staging-to-live finalization step and the paths shown under ~/.vscode-server/cli/servers/, comparing the complete staging server with the live server. Reproduce or inspect the update flow and its activation checks; done means an incomplete installation cannot be marked ready, and the previous working server or a clear failure path remains available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- backend, devtools, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100