tijs
tijs

Reputation: 566

failed to find free socket port for process dispatcher when trying remote debug

Highlights:

The Issue:

I've tried to set up remote ruby debug following this guide and getting an error in IDE: "failed to find free socket port for process dispatcher". It looks this issue is not IntelliJ-specific, I was able to reproduce it with latest RubyMine as well.

From IDEA's log

2017-07-07 21:53:03,515 [8879188] INFO - tion.impl.ExecutionManagerImpl - Failed to find free socket port for process dispatcher 
com.intellij.execution.ExecutionException: Failed to find free socket port for process dispatcher 
at org.jetbrains.plugins.ruby.ruby.debugger.RubyProcessDispatcher.<init>(RubyProcessDispatcher.java:46) 
at org.jetbrains.plugins.ruby.ruby.debugger.RubyRemoteDebugRunner.doExecute(RubyRemoteDebugRunner.java:62)
... 
Caused by: java.net.BindException: Address already in use: JVM_Bind 
at java.net.TwoStacksPlainSocketImpl.socketBind(Native Method) 
at java.net.TwoStacksPlainSocketImpl.socketBind(TwoStacksPlainSocketImpl.java:137) 
...

I can understand it says Address already in use: JVM_Bind, but how remote debug supposed to work at all then? (I mean Is there any way to access guest vm port not forwarding it before? Clearly no) Any help to solve this issue is much appreciated.

Upvotes: 1

Views: 3609

Answers (1)

Perseids
Perseids

Reputation: 13250

For me the issue was due to another debug session that was open in the background. To prevent that from happening again (and also close all other currently open sessions, once you run the configuration again) select "Single instance only" in the Debug Configuration: enter image description here

Upvotes: 1

Related Questions