remote debugging docker
Hello,
I am trying to setup remote debugging to connect to my rails app running in a docker container. I followed the tutorial found here. Everything works fine (debugger connects and loads the rails app) until the set breakpoint is hit. When that happens, the debugger shows a "Frame is not available" message and I am unable to do anything other than resume program or stop the debugger. The rails 4.1 app is using ruby 2.2.3 and I am installing rdebug-ide in the docker container using "gem install ruby-debug-ide". I am using Rubymine 8 and any help would be greatly appricated. Please let me know if more details are needed.
Please sign in to leave a comment.
Can you try adding --debug to the command line and attach full output of the process
Hello Dennis,
The result of adding debug is:
Hello Dennis,
Did anything stick out in the debug? Also, can you confirm what gems/libs are necessary for the remote debugging to work. I have installed ruby-debug-ide and debase, both result in the issue as shown in the debug.
Thanks!
Can you attach contents of your Gemfile as well?
Gemfile:
Also, I am installing ruby-debug-ide in the docker container to ensure it is excutable from the cli.
So you're running passenger server? Can you try with some other one (e.g. default WEBrick)?
Passenger is only being used in production. I should actually move that gem to the production group. The app server was starting with WEBrick. I also just tried it with Thin and am experiencing the same result.
Did either of you find a resolution to this? I have a very similar situation (rails app in docker container with remote debugging on RubyMine 8) and am experiencing the exact problem. All frames show up as "Stack frame is not available" except the first, even though the output from the debugger indicates that it is sending frame info. Any info to point me in the right direction to fixing this would be much appreciated!
Sorry Henry,
I never found a solution to the issue, though it will still be very nice to have.
Sorry for the delayed reply.
We were able to reproduce this problem and it seems to be caused by current limitation of remote debugging - you're able to specify only one mapping for configuration, so only app files are properly mapped. There is another problem that we're not loading variables if we're unable to determine mapped file.
I can suggest to bundle gems into vendor/gems as a workaround and on our side I'll try to load variables even if mapping is missing
Thanks, Dennis. This is info is very helpful. I'll try bundling to vendor/gems, or maybe I can try to match the environments with some clever symlinking. I'll post back here if either of those approaches work. Thanks again.
Hey JD, Dennis, I just wanted to leave a note that symlinking (on my local dev) the gems directory to a path that is the same as where the gems are in the container worked.
e.g.
ln -s /somewhere/on/my/local/lib/ruby/gems/2.2.2 /same/path/as/gems/directory/in/container
It's not the cleanest solution, and might not be possible in certain environments, but it does work. I hope this helps you guys.
Just FYI, I posted the details of how I got it running here:
http://bzzt.io/posts/running-the-rails-debugger-in-a-docker-container-using-rubymine
However your post does not solve the problem for us poor Windows users. We can't mirror the locations on our local FS.
Hello,
I am another new RubyMine/Docker Windows user, any news will this "Stack Frame not available on Docker/Ruby IDE" solved in future versions?
Thanks Pekka
https://youtrack.jetbrains.com/issue/RUBY-19702
2017.3 EAP2
Yay! (y)