Failed to find free socket port for process dispatcher

Answered

My scenario is pretty much this one.

There's a Docker Compose running rails with:

ports:
- "3000:3000"
- "1234:1234"
- "26162:26162"

With gems:

Using debase 0.2.2.beta10
Using ruby-debug-ide 0.6.1

The command:

bundle exec rdebug-ide --host 0.0.0.0 --port 1234 --dispatcher-port 26162 -- \
/app/bin/rails server -b 0.0.0.0 -p 3000 -e development'

That yelds:

Fast Debugger (ruby-debug-ide 0.6.1, debase 0.2.2.beta10, file filtering is supported) listens on 0.0.0.0:1234

The configuration for remote debug on RubyMine:

Remote host: 127.0.0.1
Remote port: 1234
Remote root folder: /app
Local port: 26162
Local root folder: /path/to/src

The result of Ctrl+Shift+F9:

Error running 'develop': Failed to find free socket port for process dispatcher

The very same configuration on VSCode just works flawlessly:

{
"version": "0.2.0",
"configurations": [
{
"name": "rdebug-ide",
"type": "Ruby",
"request": "attach",
"cwd": "${workspaceRoot}/src",
"remoteHost": "127.0.0.1",
"remotePort": "1234",
"remoteWorkspaceRoot": "/app"
},
]
}

This is frustrating.

3 comments
Comment actions Permalink

I'm running into the same scenario. If I launch my app without docker, my remote debugger can connect fine. But when I launch with Docker, it runs into the "failed to find... port..." error. I have the correct ports opened up in my docker compose file like so:

command: sh -c 'rm -rf ./tmp && bundle exec rdebug-ide --host 0.0.0.0 --port 1234 --dispatcher-port 26162 -- bin/rails s -b 0.0.0.0'
ports:
- 3000:3000
- 1234:1234
- 26162:26162
0
Comment actions Permalink

Hello,

it's possible to add docker-compose Ruby SDK and launch debugging session using it (that is, without remote debug). Have you tried that?

0
Comment actions Permalink

I'll try to experiment with that some time (sorry for not giving it a shot right now).

I was able to track this down - https://github.com/ruby-debug/ruby-debug-ide/issues/107 It seems that something around the combination of docker and Rubymine causes a random port (in the ephemeral range, I think) to be used for the actual debugging, but the docker container doesn't have that port opened. Without digging into it further, I can't say whether the issue is with that gem or with Rubymine, but it looks like the gem maintainers are trying to implement a workaround/fix.

0

Please sign in to leave a comment.