debug with docker-compose doesn't work

Answered

Hi,

I'm struggling with following this tutorial(https://www.jetbrains.com/help/ruby/2019.1/using-docker-as-a-remote-interpreter.html)

I could've succeed to debug with docker however not good with 'docker-compose'.

I followed exactly same that the tutorial said. Except the way of adding gems 'debase' and 'ruby-debug-ide', because adding them into built 'docker image' produced LoadError. So I added them first into Gemfile and then built 'docker image'. And then I could debug with docker.

I could execute 'Development: sample_rails_app_docker' as debug mode with 'docker-compose', but it doesn't hit break point.

Could you give me any hints what I should look into?

Logs in console window are below.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

/usr/local/bin/docker-compose -f /Users/genki98/Workspace/sample_rails_app_docker/docker-compose.yml exec -e RM_INFO=RM-191.6707.59 -e TEAMCITY_RAKE_RUNNER_MODE=idea -e "TEAMCITY_RAKE_RUNNER_USED_FRAMEWORKS=:test_unit :shoulda " -e RUBYMINE_TESTUNIT_REPORTER=/opt/.rubymine_helpers/rb/testing/patch/testunit -e TEAMCIY_RAKE_TU_AUTORUNNER_PATH=/usr/local/lib/ruby/gems/2.6.0/gems/test-unit-3.2.9/lib/test/unit/autorunner.rb -e LANG=ko_KR.UTF-8 -e ANSICON= -e RUBYLIB=/opt/.rubymine_helpers/rb/testing/patch/common:/opt/.rubymine_helpers/rb/testing/patch/testunit:/usr/local/bundle/gems/debase-0.2.2/lib:/usr/local/bundle/gems/ruby-debug-ide-0.7.0/lib -e TEAMCITY_RAKE_TU_TESTRUNNERMADIATOR_PATH=/usr/local/lib/ruby/gems/2.6.0/gems/test-unit-3.2.9/lib/test/unit/ui/testrunnermediator.rb web sh -c "/usr/local/bin/ruby /usr/local/bundle/gems/ruby-debug-ide-0.7.0/bin/rdebug-ide --key-value --disable-int-handler --evaluation-timeout 10 --evaluation-control --time-limit 100 --memory-limit 0 --rubymine-protocol-extensions --port 1234 --host 0.0.0.0 --dispatcher-port 26168 -- /opt/project/bin/rails server -b 0.0.0.0 -p 3000 -e development"
Fast Debugger (ruby-debug-ide 0.7.0, debase 0.2.2, file filtering is supported) listens on 0.0.0.0:1234
=> Booting Puma
=> Rails 5.1.6 application starting in development
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.9.1 (ruby 2.6.3-p62), codename: Private Caller
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop

3 comments
Comment actions Permalink

Hello,

could you please check how it goes in RubyMine 2019.2 EAP4 and if you specify debug gems versions (debase 0.2.3.beta5 and ruby-debug-ide 0.7.0)?

0
Comment actions Permalink

Oh upgrading RubyMine to 2019.1.2 solved the problem. It works now.

0
Comment actions Permalink

I'm getting a similar issue (Not sure if it's the same) - But I'm convinced I've not set something up properly.

 

I'm unable to right click and run (I only get regular run), and when I create a custom config, I can only specify the compose files location, which doesn't give me any dice.

 

In the LOG area of the Docker tab it's all good
```

LOG: database system is ready to accept connections
LOG: autovacuum launcher started
LOG: received smart shutdown request
LOG: autovacuum launcher shutting down
LOG: shutting down
LOG: database system is shut down
LOG: database system was shut down at 2019-09-10 15:02:49 UTC
LOG: MultiXact member wraparound protections are now enabled
LOG: database system is ready to accept connections
LOG: autovacuum launcher started

```

 

but in the console window when I try run a test (Not even trying to debug yet), I get the following

```

Step 13/13 : EXPOSE 3000
---> Using cache
---> b9355fdfa9ab
Successfully built b9355fdfa9ab
Successfully tagged thing-service_app:latest
thing-service_db_1 is up-to-date
Starting thing-service_app_1 ...
Starting thing-service_app_1 ... error
ERROR: for thing-service_app_1 Cannot start service app: driver failed programming external connectivity on endpoint thing-service_app_1 (c23b9a7de968ef48ebf6d12568f854aafa5bb77af6acfb49ea3b55d99579c583): Error starting userland proxy: listen tcp 0.0.0.0:3000: bind: address already in use

ERROR: for app Cannot start service app: driver failed programming external connectivity on endpoint thing-service_app_1 (c23b9a7de968ef48ebf6d12568f854aafa5bb77af6acfb49ea3b55d99579c583): Error starting userland proxy: listen tcp 0.0.0.0:3000: bind: address already in use
ERROR: Encountered errors while bringing up the project.
Failed to deploy 'Compose: docker-compose.yml': `docker-compose` process finished with exit code 1

```

I've tried to kill processes e.t.c. and can't see any issue.

EDIT: Using RubyMine 2019.1, Ubuntu bionic and running from the program directly.

0

Please sign in to leave a comment.