Failed to find free socket port for process dispatcher


My scenario is pretty much this one.

There's a Docker Compose running rails with:

- "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 --port 1234 --dispatcher-port 26162 -- \
/app/bin/rails server -b -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

The configuration for remote debug on RubyMine:

Remote host:
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": "",
"remotePort": "1234",
"remoteWorkspaceRoot": "/app"

This is frustrating.

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 --port 1234 --dispatcher-port 26162 -- bin/rails s -b'
- 3000:3000
- 1234:1234
- 26162:26162
Comment actions Permalink


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

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 - 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.

Comment actions Permalink

Same exact issue for me with PyCharm.  I have to start the app then start the server (container).  If I want to restart the app then I need to stop the container before restarting the app.


Please sign in to leave a comment.