Skip to content

Debug session never starts: TransportTimeoutException in launch and attach modes (TCP connection established) #1733

Open

Description

@its-rajive

Title: Debug session never starts: TransportTimeoutException in both launch and attach modes (TCP connection established)

vscode-TransportTimeoutException_issue.txt

Environment

  • OS: Windows 11 x64
  • VS Code: [version from Help → About]
  • Language Support for Java (redhat.java): 1.58.0 (also seen on pre-release 1.59.2026111308)
  • Debugger for Java: [version]
  • Language server runtime: bundled JRE 25.0.4.1 (also 25.0.5 on the pre-release)
  • Debuggee JDKs: Temurin 8u482 and 17.0.20 (same result with both)
  • Debugger for Java: latest available as of 2026-11-18 (auto-updated; exact version not captured before uninstalling)

Problem
Debugging stopped working after an extension update; it previously worked on the same project and machine.
Run works fine. Debug never hits breakpoints and fails with:

  • Launch: "Failed to launch debuggee in terminal. Reason: com.sun.jdi.connect.TransportTimeoutException"
  • Attach: "Failed to attach to 127.0.0.1:5005 (attach timeout 30000, handshake timeout 0)"

What I verified

  • The debuggee starts with -agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:<port> and hangs before main.
  • During the hang, netstat shows the TCP connection is ESTABLISHED between the language server process (listening on 0.0.0.0/[::]) and the debuggee, so the socket connects but the JDWP handshake or VM init never completes.
  • Same result with console: internalConsole (launched via -Xrunjdwp).
  • Same result in a clean VS Code profile with freshly installed extensions.
  • Outside VS Code, jdb from JDK 17 (-connect com.sun.jdi.SocketListen) accepts the same debuggee connection immediately ("VM Started").
  • IntelliJ IDEA debugs the same project on the same machine without issues.
  • Ruled out: firewall, WSL (shut down), IPv6/localhost resolution, Winsock catalog (clean), environment variables (no JAVA_TOOL_OPTIONS etc.).
  • java.jdt.ls.java.home pointing to JDK 21 was not applied (language server still started on bundled JRE 25), so I couldn't test with a different runtime.

Project type
Unmanaged folder project (java.project.sourcePaths + java.project.referencedLibraries), Java 8 target.

Logs
[paste the relevant part of the language server log here]

Activity

  1. wenytang-ms commented on Nov 23, 2026

    @wenytang-ms
    Contributor

    Hi its-rajive, thanks for the detailed report!

    I tried to reproduce this on Windows 11 with the exact same setup (redhat.java 1.58.0 running on the bundled JRE 25.0.4.1-win32-x86_64, unmanaged folder project, and JDK 8 / JDK 17 debuggees), and all three modes (integratedTerminal, internalConsole, and attach) connected and hit breakpoints as expected.

    Since the TCP connection reaches ESTABLISHED and external tools (jdb / IntelliJ) work on your machine, this strongly points to something on the host intercepting or blocking the JDWP handshake specifically for the newly updated bundled JRE executable under .vscode\extensions\redhat.java-...\jre\....

    Could you help us collect a bit more information to narrow this down?

    1. Language Server logs:
      Set "java.debug.logLevel": "fine" in your settings, reproduce the timeout, and share the logs from Output -> Language Support for Java (or run the command Java: Open Java Language Server Log File). We'd like to see the full stack trace and root Caused by exception.

    2. Test java.jdt.ls.java.home in User Settings:
      Note that for security reasons, java.jdt.ls.java.home is only applied when set in User Settings (Preferences: Open User Settings (JSON)) and is ignored if placed in workspace .vscode/settings.json (and redhat.java 1.58+ requires JDK 21 or newer). Could you try setting java.jdt.ls.java.home to your external JDK 21+ in User Settings, reload VS Code, and check if debugging works when JDT LS runs outside the .vscode\extensions folder?

    3. Thread dump of the JDT LS process during the hang:
      While the debug session is hanging (during the 20–30s timeout window where netstat shows ESTABLISHED), could you run jstack <JDT_LS_PID> using your JDK's jstack.exe and share the output? That will show whether the debugger thread is blocked inside ServerSocket.accept(), SocketTransportService.readHandshake(), or post-handshake JDWP initialization.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions