ruby-debug / ruby-debug-ide

An interface which glues ruby-debug to IDEs like Eclipse (RDT), NetBeans and RubyMine.
https://www.jetbrains.com/ruby/features/ruby_debugger.html
Other
370 stars 83 forks source link

RubyMine: Termination timed out worker: #182

Closed chuenniger closed 4 years ago

chuenniger commented 4 years ago

Hi

I´ve a problem to debug my application in docker. My setup is correct I think because without debugger everything works fine.

Ports

command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
    volumes:
      - .:/usr/src/app
    ports:
      - "3000:3000"
      - "1234:1234"
      - "26162:26162"
      - "26168:26168"

The error: (The site is not responding)

Fast Debugger (ruby-debug-ide 0.7.0, debase 0.2.4.1, file filtering is supported) listens on 0.0.0.0:1234
=> Booting Puma
=> Rails 5.2.3 application starting in development 
=> Run `rails server -h` for more startup options
[8] Puma starting in cluster mode...
[8] * Version 4.0.1 (ruby 2.6.2-p47), codename: 4 Fast 4 Furious
[8] * Min threads: 5, max threads: 5
[8] * Environment: development
[8] * Process workers: 2
[8] * Preloading application
[8] * Listening on tcp://0.0.0.0:3000
[8] Use Ctrl-C to stop
[8] ! Terminating timed out worker: 16
[8] ! Terminating timed out worker: 18
[8] ! Terminating timed out worker: 20
[8] ! Terminating timed out worker: 21
[8] ! Terminating timed out worker: 24
[8] ! Terminating timed out worker: 25
[8] ! Terminating timed out worker: 28
[8] ! Terminating timed out worker: 29

Screenshot 2019-11-26 at 09 12 34 Screenshot 2019-11-26 at 09 12 58

chuenniger commented 4 years ago

If I deny the port 26168 in my docker-compose.yaml file I get this message:

Shouldn't the IP be 127.0.0.1 ?

Fast Debugger (ruby-debug-ide 0.7.0, debase 0.2.4.1, file filtering is supported) listens on 0.0.0.0:1234
=> Booting Puma
=> Rails 5.2.3 application starting in development 
=> Run `rails server -h` for more startup options
[8] Puma starting in cluster mode...
[8] * Version 4.0.1 (ruby 2.6.2-p47), codename: 4 Fast 4 Furious
[8] * Min threads: 5, max threads: 5
[8] * Environment: development
[8] * Process workers: 2
[8] * Preloading application
[8] * Listening on tcp://0.0.0.0:3000
[8] Use Ctrl-C to stop
16: connection failed(1)
Exception: Connection refused - connect(2) for "192.168.176.1" port 26168
        /usr/local/bundle/gems/ruby-debug-ide-0.7.0/lib/ruby-debug-ide.rb:168:in `initialize'
        /usr/local/bundle/gems/ruby-debug-ide-0.7.0/lib/ruby-debug-ide.rb:168:in `open'
        /usr/local/bundle/gems/ruby-debug-ide-0.7.0/lib/ruby-debug-ide.rb:168:in `block in notify_dispatcher_if_needed'
        /usr/local/bundle/gems/ruby-debug-ide-0.7.0/lib/ruby-debug-ide.rb:166:in `times'
        /usr/local/bundle/gems/ruby-debug-ide-0.7.0/lib/ruby-debug-ide.rb:166:in `notify_dispatcher_if_needed'
        /usr/local/bundle/gems/ruby-debug-ide-0.7.0/lib/ruby-debug-ide.rb:123:in `block in start_control'
avokin commented 4 years ago

Hi, at the moment RubyMine doesn't support debug docker-compose with workers. We are investigating how it would be possible to implement this. So as workaround consider to turn off workers during debug

chuenniger commented 4 years ago

Hi @avokin ,

Yes this is correct, I just figured it out, too.

My solution is set WEB_CONCURRENCY to 0 (config/puma.rb)

workers ENV.fetch("WEB_CONCURRENCY") { 0 }

For the production system I change the value in the .env file.

WEB_CONCURRENCY=2

Source:

# Note that workers are not supported for JRuby or Windows
#workers ENV.fetch("WEB_CONCURRENCY") { 2 }

THNQ @avokin