JetBrains/intellij-community · error · CantRunException
The port to attach to unspecified
Error message
The port to attach to unspecified
What it means
Error "The port to attach to unspecified" thrown in JetBrains/intellij-community.
Source
Thrown at java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java:752
setConnectorArgument("pid", pid);
}
else if (myConnection.isServerMode()) {
if (port == null) {
throw new CantRunException(JavaDebuggerBundle.message("error.no.debug.listen.port"));
}
String debuggerHostName = myConnection.getDebuggerHostName();
if (debuggerHostName != null) {
setConnectorArgument("localAddress", debuggerHostName);
}
}
else { // is client mode, should attach to already running process
if (myConnection.isUseSockets()) {
String debuggerHostName = myConnection.getDebuggerHostName();
if (debuggerHostName != null) {
setConnectorArgument("hostname", debuggerHostName);
}
if (port == null) {
throw new CantRunException(JavaDebuggerBundle.message("error.no.debug.attach.port"));
}
setConnectorArgument("port", port);
}
else {
if (port == null) {
throw new CantRunException(JavaDebuggerBundle.message("error.no.shmem.address"));
}
setConnectorArgument("name", port);
}
setConnectorArgument("timeout", "0"); // wait forever
}
return connector instanceof AttachingConnector
? attachConnector((AttachingConnector)connector)
: connectorListen(port, (ListeningConnector)connector);
}
catch (IOException e) {
throw new ExecutionException(processIOException(e, JavaDebuggerBundle.getAddressDisplayName(myConnection)), e);
}View on GitHub (pinned to be881553f2)
Solutions
- Enter the port of the target JVM to attach to in the debug configuration.
- Make sure the target JVM was started with -agentlib:jdwp=transport=dt_socket,server=y,address=<port> and use that port.
Example fix
Target started with address=*:5005 -> set Host: localhost, Port: 5005 in the Remote JVM Debug configuration.
When it happens
Trigger: An attach-mode (socket attach) debug session is started with an empty port.
Common situations: The Port field of an Attach to remote JVM configuration is blank.
AI-assisted analysis of JetBrains/intellij-community@be881553f2 (2026-08-14).
Data as JSON: /api/errors/0406d34a278d67ad.
Report an issue: GitHub.