{"record":{"id":"0406d34a278d67ad","repo":"JetBrains/intellij-community","slug":"the-port-to-attach-to-unspecified","errorCode":null,"errorMessage":"The port to attach to unspecified","messagePattern":"The port to attach to unspecified","errorType":"exception","errorClass":"CantRunException","httpStatus":null,"severity":"error","filePath":"java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java","lineNumber":752,"sourceCode":"        setConnectorArgument(\"pid\", pid);\n      }\n      else if (myConnection.isServerMode()) {\n        if (port == null) {\n          throw new CantRunException(JavaDebuggerBundle.message(\"error.no.debug.listen.port\"));\n        }\n        String debuggerHostName = myConnection.getDebuggerHostName();\n        if (debuggerHostName != null) {\n          setConnectorArgument(\"localAddress\", debuggerHostName);\n        }\n      }\n      else { // is client mode, should attach to already running process\n        if (myConnection.isUseSockets()) {\n          String debuggerHostName = myConnection.getDebuggerHostName();\n          if (debuggerHostName != null) {\n            setConnectorArgument(\"hostname\", debuggerHostName);\n          }\n          if (port == null) {\n            throw new CantRunException(JavaDebuggerBundle.message(\"error.no.debug.attach.port\"));\n          }\n          setConnectorArgument(\"port\", port);\n        }\n        else {\n          if (port == null) {\n            throw new CantRunException(JavaDebuggerBundle.message(\"error.no.shmem.address\"));\n          }\n          setConnectorArgument(\"name\", port);\n        }\n        setConnectorArgument(\"timeout\", \"0\"); // wait forever\n      }\n      return connector instanceof AttachingConnector\n             ? attachConnector((AttachingConnector)connector)\n             : connectorListen(port, (ListeningConnector)connector);\n    }\n    catch (IOException e) {\n      throw new ExecutionException(processIOException(e, JavaDebuggerBundle.getAddressDisplayName(myConnection)), e);\n    }","sourceCodeStart":734,"sourceCodeEnd":770,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java#L734-L770","documentation":"Error \"The port to attach to unspecified\" thrown in JetBrains/intellij-community.","triggerScenarios":"An attach-mode (socket attach) debug session is started with an empty port.","commonSituations":"The Port field of an Attach to remote JVM configuration is blank.","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."],"exampleFix":"Target started with address=*:5005 -> set Host: localhost, Port: 5005 in the Remote JVM Debug configuration.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}