Debug adapter process has terminated unexpectedly (read ECONNRESET)
Java debugger randomly terminates when debug attach with the following error: Debug adapter process has terminated unexpectedly (read ECONNRESET)
Environment
- Operating System: Windows 7 Enterprise 64-bit
- JDK version: 1.8.0_66
- Visual Studio Code version: 1.30.0-insider (user setup)
- Java extension version: Java Extension Pack 0.4.0
- Java Debugger extension version: 0.15.0 - 2018-11-01
Steps To Reproduce
- Configure launch.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug (Launch)",
"request": "launch",
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopOnEntry": false,
"mainClass": "",
"args": ""
},
{
"type": "java",
"name": "Debug (Attach)",
"request": "attach",
"hostName": "localhost",
"port": 5005
}
]
}
- Run java app using gradle appRunDebug
gradlew clean appRunDebug --stacktrace
The following is the logs from the chrome dev tools console:
notificationsAlerts.ts:40 Debug adapter process has terminated unexpectedly (read ECONNRESET)
t.onDidNotificationChange @ notificationsAlerts.ts:40
(anonymous) @ notificationsAlerts.ts:26
e.fire @ event.ts:223
t.notify @ notifications.ts:113
t.error @ notificationService.ts:48
(anonymous) @ debugService.ts:511
e.fire @ event.ts:223
(anonymous) @ debugSession.ts:749
e.fire @ event.ts:223
t.fireAdapterExitEvent @ rawDebugSession.ts:460
(anonymous) @ rawDebugSession.ts:439
Promise resolved (async)
t.stopAdapter @ rawDebugSession.ts:438
(anonymous) @ rawDebugSession.ts:426
Promise rejected (async)
t.shutdown @ rawDebugSession.ts:422
(anonymous) @ rawDebugSession.ts:79
e.fire @ event.ts:223
(anonymous) @ debugAdapter.ts:281
emitOne @ events.js:116
emit @ events.js:211
emitErrorNT @ internal/streams/destroy.js:64
_combinedTickCallback @ internal/process/next_tick.js:138
_tickCallback @ internal/process/next_tick.js:180
console.ts:134 [Extension Host] rejected promise not handled within 1 second (at Timeout. (c:\Users\user_name\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:760:9))
t.log @ console.ts:134
t._logExtensionHostMessage @ extensionHost.ts:451
(anonymous) @ extensionHost.ts:244
emitTwo @ events.js:126
emit @ events.js:214
emit @ internal/child_process.js:772
_combinedTickCallback @ internal/process/next_tick.js:141
_tickCallback @ internal/process/next_tick.js:180
log.ts:169 ERR Running the contributed command:'java.execute.workspaceCommand' failed.: Error: Running the contributed command:'java.execute.workspaceCommand' failed.
at e._executeContributedCommand (c:\Users\user_name\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:497:869)
at e.executeCommand (c:\Users\user_name\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:497:95)
at Object.executeCommand (c:\Users\user_name\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:727:659)
at Object.executeJavaLanguageServerCommand (C:\Users\user_name.vscode-insiders\extensions\vscjava.vscode-java-debug-0.15.0\out\src\commands.js:19:28)
at fetchUsageData (C:\Users\user_name.vscode-insiders\extensions\vscjava.vscode-java-debug-0.15.0\out\src\extension.js:98:21)
at vscode.debug.onDidTerminateDebugSession (C:\Users\user_name.vscode-insiders\extensions\vscjava.vscode-java-debug-0.15.0\out\src\extension.js:37:9)
at e.fire (c:\Users\user_name\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:133:218)
at e.$acceptDebugSessionTerminated (c:\Users\user_name\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:515:765)
at t._doInvokeHandler (c:\Users\user_name\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:652:708)
at t._invokeHandler (c:\Users\user_name\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:652:380)
at t._receiveRequest (c:\Users\user_name\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:650:971)
at t._receiveOneMessage (c:\Users\user_name\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:649:900)
at c:\Users\user_name\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:647:733
at c:\Users\user_name\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:130:793
at e.fire (c:\Users\user_name\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:133:218)
at a (c:\Users\user_name\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:185:760)
at Socket.n._socketDataListener (c:\Users\user_name\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:185:981)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at Pipe.onread (net.js:594:20)
After enabling the java extension logging (Java › Trace: Server = verbose) I got this when the error happened:
[Trace - 10:42:02] Received notification 'window/logMessage'.
Params: {
"type": 2,
"message": "13-Dec-2018 10:42:02 Could not load Gradle version information\nCannot download published Gradle versions.\norg.gradle.api.UncheckedIOException: Cannot download published Gradle versions.\r\n\tat com.gradleware.tooling.toolingutils.distribution.PublishedGradleVersions.downloadVersionInformation(PublishedGradleVersions.java:175)\r\n\tat com.gradleware.tooling.toolingutils.distribution.PublishedGradleVersions.tryToDownloadAndCacheVersions(PublishedGradleVersions.java:159)\r\n\tat com.gradleware.tooling.toolingutils.distribution.PublishedGradleVersions.create(PublishedGradleVersions.java:119)\r\n\tat org.eclipse.buildship.core.util.gradle.PublishedGradleVersionsWrapper$LoadVersionsJob.run(PublishedGradleVersionsWrapper.java:66)\r\n\tat org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)\r\nCaused by: java.net.SocketTimeoutException: connect timed out\r\n\tat java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)\r\n\tat java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)\r\n\tat java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)\r\n\tat java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)\r\n\tat java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)\r\n\tat java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)\r\n\tat java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)\r\n\tat java.net.Socket.connect(Socket.java:589)\r\n\tat sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668)\r\n\tat sun.net.NetworkClient.doConnect(NetworkClient.java:175)\r\n\tat sun.net.www.http.HttpClient.openServer(HttpClient.java:432)\r\n\tat sun.net.www.http.HttpClient.openServer(HttpClient.java:527)\r\n\tat sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)\r\n\tat sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)\r\n\tat sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)\r\n\tat sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1105)\r\n\tat sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:999)\r\n\tat sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)\r\n\tat sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1513)\r\n\tat sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)\r\n\tat sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)\r\n\tat com.gradleware.tooling.toolingutils.distribution.PublishedGradleVersions.downloadVersionInformation(PublishedGradleVersions.java:172)\r\n\t... 4 more\r\n"
}
[Warn - 10:42:02] 13-Dec-2018 10:42:02 Could not load Gradle version information
Cannot download published Gradle versions.
org.gradle.api.UncheckedIOException: Cannot download published Gradle versions.
at com.gradleware.tooling.toolingutils.distribution.PublishedGradleVersions.downloadVersionInformation(PublishedGradleVersions.java:175)
at com.gradleware.tooling.toolingutils.distribution.PublishedGradleVersions.tryToDownloadAndCacheVersions(PublishedGradleVersions.java:159)
at com.gradleware.tooling.toolingutils.distribution.PublishedGradleVersions.create(PublishedGradleVersions.java:119)
at org.eclipse.buildship.core.util.gradle.PublishedGradleVersionsWrapper$LoadVersionsJob.run(PublishedGradleVersionsWrapper.java:66)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668)
at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1105)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:999)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1513)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at com.gradleware.tooling.toolingutils.distribution.PublishedGradleVersions.downloadVersionInformation(PublishedGradleVersions.java:172)
... 4 more
Current Result
vscode stopped debugging with this error message Debug adapter process has terminated unexpectedly (read ECONNRESET)
Expected Result
Debugging should still continue as the same scenario works fine with any other IDE (eclipse, intellij)
Hi @googlomooglo, I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.
Suggestions to investigate and work around the ECONNRESET error:
• Enable full Java extension and debug logs and inspect for errors: – Set "java.trace.server": "verbose" and "debug.trace.internal": true in your VS Code settings. See the troubleshooting guide: https://github.com/redhat-developer/vscode-java/wiki/Troubleshooting#enable-logging
• Check network/proxy settings for Gradle metadata download failures (your logs show SocketTimeoutException). Either:
– Configure VS Code HTTP proxy settings (http.proxy, http.proxyStrictSSL).
– Enable Gradle offline mode or use a local wrapper distribution:
• Add java.import.gradle.wrapper.enabled": true in settings to force use of gradlew.
• In your gradle-wrapper.properties, ensure distributionUrl points to a cached/local Gradle.
• Try launching your app with the standard JDWP agent args and then attaching manually:
- Run
gradlew --no-daemon appRunDebug --debug-jvm(or add-agentlib:jdwp=transport=dt_socket,server=y,address=5005,suspend=nto your JVM args). - Use the existing “Debug (Attach)” VS Code config.
• Upgrade to the latest Java Debugger extension or use the stable VS Code release—Insiders builds sometimes introduce adapter instability.
Other references with low confidence:
Offline install failed (ECONNRESET when installing debugger extension)
• Title: Offline install failed
• Context: Error read ECONNRESET when installing the debugger offline via code --install-extension.
• URL: https://github.com/microsoft/vscode-java-debug/issues/528
The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!