Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting 'ERROR: transport error 202: recv error: Connection reset by peer' while debugging #1269

Open
tarekahf opened this issue Nov 28, 2022 · 6 comments

Comments

@tarekahf
Copy link

Environment:

  • VS Code Version: 1.73.1
  • Extension Version: Language Support for Java(TM) by Red Hat v1.13.2022111603
  • JDK Type & Version: Oracle jdk1.8.0_351 - 32bit
  • OS Type & Version: Windows 10 Enterprise

Step to Reproduce:

  • Open an existing multi-module maven project in VS Code and wait until it is fully loaded. This project is relatively huge.
  • Setup launch.json with attach and launch for Java Project
  • The launch config is working fine. Still, after a couple of minutes, I get ERROR: transport error 202: recv error: Connection reset by peer in the terminal, and the debugger is disconnected.
  • The same happens with the attach config.
  • I am able to debug successfully as long as the debugger is not disconnected.
  • When debugging in the attach config, the debugger keeps on listening, and I can attach again, but it will disconnect after a couple of minutes.
  • Even after the debugger is disconnected, the application is still active.
  • The command used to start the debugger in attach mode is:
C:\apps\jdk1.8.0_271\bin\java.exe "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:60082" '-Xincgc -Xms64m -Xmx950m' '-Dsun.security.ssl.allowUnsafeRenegotiation="true"' '-Djava.security.policy="policy.all"' '-Dpython.home=".."' '-Dcom.ibm.mq.cfg.useIBMCipherMappings="false"' '-Xbootclasspath/p:class1 class2 ...' '-cp' '.\classpath.jar' 'mainClassName'

Note: The command above to start the debugger is mostly provided as it is the same one used to launch the actual application.

Launch Config for attach:

        {
            "type": "java",
            "name": "Attach to java debug port 60082",
            "projectName": "sarora",
            "request": "attach",
            "hostName": "localhost",
            "port": "60082"
        }

Expected Behavior:

  • The debugger should remain active and should not disconnect

Actual Behavior:

  • The debugger is disconnecting after a couple of minutes.

Related Issues:
I found this report to be similar:
#164
and I followed the instructions to do the needed troubleshooting but it is not working.

@testforstephen
Copy link
Contributor

Did you try a newer JDK (e.g. JDK 17) on this?

@tarekahf
Copy link
Author

tarekahf commented Dec 3, 2022

Did you try a newer JDK (e.g. JDK 17) on this?

I didn't as the project requires jdk 1.8.

@jcrben
Copy link

jcrben commented Nov 1, 2023

A coworker of mine is getting the same problem in a highly-secured corporate environment. Seems that it making a call out to the internet somewhere @testforstephen ?

But he's only getting it for a specific complex project and not a simple minimal one. I'm asking him to add things from the complex project to a simple one until it breaks.

@tarekahf fyi if you just need java 8 you can use jdk 11 as it's backwards compatible. My coworker is using jdk 11 and gets the same problem, didn't try jdk 17

@testforstephen
Copy link
Contributor

Please try this command in the terminal to see if you can use the jdk debug tool:

jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=<port>

@tarekahf
Copy link
Author

tarekahf commented Nov 2, 2023

@jcrben @testforstephen thank you for the reply. It's too late now, as I switched to Eclipse, and not facing such issues at all. I will try again using vscode (because it has other cool features not in eclipse) when I have the chance.

@jcrben
Copy link

jcrben commented Nov 6, 2023

@testforstephen mysteriously it started working for my coworker now. there may have been some firewall configuration behind the scenes that addressed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants