vscode: Regression: Port forwarding fails while working with remote SSH
This is the 4th time this issue has occurred and fixed, then regressed within the last 4 months… Such frequent major bugs make VScode really unstable to use 😕
Does this issue occur when all extensions are disabled?: Yes
Version: 1.82.0 (user setup)
Commit: 8b617bd08fd9e3fc94d14adb8d358b56e3f72314
Date: 2023-09-06T22:07:07.438Z
Electron: 25.8.0
ElectronBuildId: 23503258
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.19045
Steps to Reproduce: (See https://github.com/microsoft/vscode/issues/192521#issuecomment-1714483320 )
- Connect to a remote ssh host via remote explorer
- Start a server on 0.0.0.0:3000
- Port forward it
- Try to access it on the current PC.
Error logs in Shared
window: (Could be irrelevant since I get the log below on both 1.81.2 and 1.81.1 but no issue is faced on 1.18.1)
2023-09-08 12:03:50.235 [error] [uncaught exception in sharedProcess]: Cannot read properties of undefined (reading 'then'): TypeError: Cannot read properties of undefined (reading 'then')
at v.s (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:26:4731)
at v.q (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:26:4161)
at c.value (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:26:3566)
at b.w (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:21:1902)
at b.x (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:21:1972)
at b.fire (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:21:2188)
at MessagePortMain.te (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:19:40559)
at MessagePortMain.emit (node:events:513:28)
at MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:367)
2023-09-08 12:03:51.522 [error] [uncaught exception in sharedProcess]: Cannot read properties of undefined (reading 'then'): TypeError: Cannot read properties of undefined (reading 'then')
at v.s (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:26:4731)
at v.q (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:26:4161)
at c.value (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:26:3566)
at b.w (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:21:1902)
at b.x (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:21:1972)
at b.fire (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:21:2188)
at MessagePortMain.te (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:19:40559)
at MessagePortMain.emit (node:events:513:28)
at MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:367)
2023-09-08 12:03:52.335 [error] [uncaught exception in sharedProcess]: Cannot read properties of undefined (reading 'then'): TypeError: Cannot read properties of undefined (reading 'then')
at v.s (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:26:4731)
at v.q (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:26:4161)
at c.value (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:26:3566)
at b.w (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:21:1902)
at b.x (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:21:1972)
at b.fire (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:21:2188)
at MessagePortMain.te (c:\Users\Ashesh\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\sharedProcess\sharedProcessMain.js:19:40559)
at MessagePortMain.emit (node:events:513:28)
at MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:367)
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev"
},
{
"name": "Next.js: debug client-side",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000"
},
{
"name": "Next.js: debug full stack",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev",
"serverReadyAction": {
"pattern": "started server on .+, url: (https?://.+)",
"uriFormat": "%s",
"action": "debugWithChrome"
},
"sourceMaps": true,
}
]
}
About this issue
- Original URL
- State: closed
- Created 10 months ago
- Reactions: 9
- Comments: 29 (6 by maintainers)
Commits related to this issue
- cli: propagate server closing Previously this was never needed since the connection was only used for the ext host, which never closed. Part 1 of fixing #192521 — committed to microsoft/vscode by connor4312 10 months ago
- cli: propagate server closing (#192824) Previously this was never needed since the connection was only used for the ext host, which never closed. Part 1 of fixing #192521 — committed to microsoft/vscode by connor4312 10 months ago
Can confirm. Facing the same issue on Mac (Client), Fedora (Remote).
Rolling back to
1.81.1
fixes it and everything works perfectly !@Ashesh3 the other parts were in the closed-source ssh extension
@LeonardoEmili your issue is unrelated, please open a new issue and share the complete Remote SSH output
@alexr00 I have only been able to reproduce it with real-word projects for now. I believe the difference lies in the size transferred, as requests start to hang only after the first few 100s of KB (or few MBs?) are transferred from the server. I can try to create a minimal reproducible example based on the repo you linked when I get back from work in a few hours.
Probably unnecessary, but reporting here in case any user comes across this issue. For me, vscode automatically updated to
1.81.2
and I was getting the following error, nothing worked (removing the local nor remote.vscode
directory, restarting the server, reinstalling vscode) but I had to manually downgrade to1.81.1
. The error I was getting below:@connor4312 I understand that you rolled back to the previous SSH behaviour since version
1.81.1
has been removed from the releases section.@connor4312 Your linked PR closed this issue even though the PR says, “Part 1 of fixing”, just checking if it was closed accidently.
@alexr00 I’m downgrading this from a candidate since we backed out the SSH change that exposed this issue.
Excellent, thanks for confirming. I will duplicate the other issue into this one.
@connor4312 Hey, apologies for the non-descriptive steps to replicate the issue. What @alexr00 mentioned above is exactly the steps that pertains to the issue I have and the case which @au2001 mentioned above is specifically relevant to me. Running the server node process, then changing the contents of the server file followed by restarting the server (it happens automatically in my case) causes the browser to get stuck in an infinite loading state.
(Note: The below is reported with
"remote.SSH.useExecServer": true
as per your suggestion)On my windows vscode client (connected to macOS host):
Setting
"remote.SSH.useExecServer": false
fixes the above issue for me. Everything loads up instant no matter how many times and when i restart my vite server.Can confirm this reproduces the exact problem I was having. Using
npx nodemon server.js
at step 3 and updating theserver.js
file instead of steps 5 & 6 also works, which is probably the most common scenario for this bug.Don’t know about @Ashesh3 & others, but with
"remote.SSH.useExecServer": false
in my user settings, all issues are fixed on my side. Thanks for this tip!Thanks @alexr00, I was able to repro a problem with those steps. THat looks the same as https://github.com/microsoft/vscode/issues/192627
However @ashesh3 it’s hard for me to tell just based on “Try to access it on the current PC” whether this is the same problem you’re hitting. Can you describe your problem in more detail, or grab a screencap of what you hit? https://gifcap.dev/ is useful
Note that we have rolled back the change that probably caused this issue, so to reproduce it again you may need to add
"remote.SSH.useExecServer": true
to your user settings. Thanks!I think I have a repro:
res.send
npm run start
npm run start
againSame happened to me on mac Ventura (client) and ubuntu (Remote)
any chance this get a hotfix/recovery? @alexr00
same issue here:
Everything works fine on the previous version:
I now have to backup my current vscode installer every single time before installing an update, just to be safe. It’s really unfortunate.