Debugging won't go away when stopping sometimes
See original GitHub issueI’m debugging vscode using the Debug VS Code Main, Renderer & Extension Host
launch config. When I stop debugging (using the stop button), the debug toolbar ends up like below and won’t go away. And I can’t start another debugging session – I have to restart vscode.
Here is what I see in the devtools too:
Could not connect to debug target at http://localhost:5870: Cancelled GET http://localhost:5870/json/version: timeout after 10000ms
onDidChangeNotification @ /C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:2892
/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261 [Extension Host] Writing to a closed connection (at t.StreamDapTransport.send (c:\Users\Eric\.vscode-insiders\extensions\ms-vscode.js-debug-nightly-2020.3.917\src\extension.js:68:157578))
t.log @ /C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261
/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:4092 Extension Host
/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:4092 ERROR: The process with PID 22732 (child process of PID 22656) could not be terminated.
Reason: There is no running instance of the task.
3/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261 [Extension Host] Writing to a closed connection (at t.StreamDapTransport.send (c:\Users\Eric\.vscode-insiders\extensions\ms-vscode.js-debug-nightly-2020.3.917\src\extension.js:68:157578))
t.log @ /C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261
/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:2892 Could not connect to debug target at http://localhost:5870: Cancelled GET http://localhost:5870/json/version: timeout after 10000ms
onDidChangeNotification @ /C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:2892
12/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261 [Extension Host] Writing to a closed connection (at t.StreamDapTransport.send (c:\Users\Eric\.vscode-insiders\extensions\ms-vscode.js-debug-nightly-2020.3.917\src\extension.js:68:157578))
t.log @ /C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261
/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1683 ERR TreeError [CallStackView] Data tree node not found: [object Object]: Error: TreeError [CallStackView] Data tree node not found: [object Object]
at e.getDataNode (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1118:66)
at expand (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1116:206)
at file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6083:49
at Set.forEach (<anonymous>)
at file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6083:28
10/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261 [Extension Host] Writing to a closed connection (at t.StreamDapTransport.send (c:\Users\Eric\.vscode-insiders\extensions\ms-vscode.js-debug-nightly-2020.3.917\src\extension.js:68:157578))
t.log @ /C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261
/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1683 ERR TreeError [CallStackView] Data tree node not found: [object Object]: Error: TreeError [CallStackView] Data tree node not found: [object Object]
at e.getDataNode (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1118:66)
at expand (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1116:206)
at file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6083:49
at Set.forEach (<anonymous>)
at file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6083:28
2/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1683 ERR no debug adapter: Error: no debug adapter
at e.terminate (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6154:20)
at e.stopSession (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6181:458)
at handler (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6075:51)
at d.invokeFunction (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1664:794)
at e._tryExecuteCommand (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:3559:844)
at file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:3559:578
at async run (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:140:287)
4/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261 [Extension Host] Writing to a closed connection (at t.StreamDapTransport.send (c:\Users\Eric\.vscode-insiders\extensions\ms-vscode.js-debug-nightly-2020.3.917\src\extension.js:68:157578))
t.log @ /C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261
2/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1683 ERR no debug adapter: Error: no debug adapter
at e.terminate (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6154:20)
at e.stopSession (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6181:458)
at handler (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6075:51)
at d.invokeFunction (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1664:794)
at e._tryExecuteCommand (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:3559:844)
at file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:3559:578
at async run (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:140:287)
3/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261 [Extension Host] Writing to a closed connection (at t.StreamDapTransport.send (c:\Users\Eric\.vscode-insiders\extensions\ms-vscode.js-debug-nightly-2020.3.917\src\extension.js:68:157578))
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
"Debugging is being stopped" but is not yet complete
There is nothing to complete, only a debug session to get rid of. Clicking the "Stop Now" button will not immediately stop the...
Read more >"Stop Debugging" stops debugging but does not terminate ...
Once the breakpoint is hit, if I "Stop Debugging" (Shift F5), debugging stops as normal but the execution window does not terminate and...
Read more >Process remains after stop debug command - MSDN - Microsoft
Sometimes when I stop debugging, the process I was debugging remains in the process list. The debugger has stopped and the output window ......
Read more >dbquit (or click "quit debugging") doesn't always seem to exit ...
I noticed that, when trying to exit debugmode, it takes a while before it stops being "busy" and is again in debug mode,...
Read more >Stop Debugging Error - Visual Studio Feedback
Many times when I close the debug window, VS will not stop debugging. When I click on the Stop Debugging button, I get...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The issue was this:
https://github.com/microsoft/vscode-js-debug/blob/fd711a56f980804db23339be16b795167fd0ef72/src/targets/node/nodeTarget.ts#L159
https://github.com/microsoft/vscode-js-debug/blob/fd711a56f980804db23339be16b795167fd0ef72/src/targets/node/watchdog.ts#L63
(the “retry forever” behavior is probably good in general because it gives the caller control over when they want to give up, they can kill the watchdog at that point, and in top-level sessions this is what happens…)
attachToTarget
to return an empty response. However, we didn’t check that it was actually successful before continuing to attach. This eventually causes us to yield back to the launch request and say we ‘sucessfully’ launched a child session after its parent terminated. So this returns…https://github.com/microsoft/vscode/blob/2d85caa55586161faad7ce7c54e7335d3f14ac97/src/vs/workbench/contrib/debug/browser/debugService.ts#L531
https://github.com/microsoft/vscode/blob/52df5961f3e8bb669de34fd32ab1f9df25bec5e2/src/vs/workbench/contrib/debug/browser/callStackView.ts#L302
https://github.com/microsoft/vscode/blob/52df5961f3e8bb669de34fd32ab1f9df25bec5e2/src/vs/workbench/contrib/debug/browser/callStackView.ts#L136
I’ll fix 1-3 in here, and open an issue in vscode for 3-5.
To verify: reliable repro for me was running “Debug VS Code Main, Renderer & Extension Host”, then selecting the extension host in the call stack view and using the disconnect action in the debug toolbar to stop the session. Then after stopping the other two sessions the debug toolbar should disappear and you should be able to restart debugging as usual.
@connor4312 No debug adapter means that vs code tried to send some requests but the debug adapter went down in the meantime. It is coming from ths file
I am not a fan of those errors as they should at least report what request was being sent. I have improved that via https://github.com/microsoft/vscode/commit/d2d9498c730482bfbabbf466c428b5ebc1be6855
So hopefully from tomorrow’s vscode insiders we will have more preceise errors.
fyi @weinand