Debug: Puma Restart

Published on May 13, 2020

When I deploy the first time, the puma restart command is seemingly sent. However, my application is dead.

A subsequent deploy (or using cap production puma:restart) alleviates the problem and my app is alive again.

--- Review code snippets below ---

On the initial deploy, puma is alive and working, so the restart command is correctly sent: ~/.rvm/bin/rvm default do bundle exec pumactl -S /home/rails/apps/app-name/shared/tmp/pids/puma.state -F /home/rails/apps/app-name/shared/puma.rb restart

However, on the following command, because puma is dead is (as expected with the restart command) calls puma:start

~/.rvm/bin/rvm default do bundle exec puma -C /home/rails/apps/app-name/shared/puma.rb --daemon

Very interesting...

Next to look into resolving this problem...


Initial deploy

01:04 puma:restart

      01 ~/.rvm/bin/rvm default do bundle exec pumactl -S /home/rails/apps/app-name/shared/tmp/pids/puma.state -F /home/rails/apps/app-name/shared/puma.rb restart

      01 Command restart sent success


    ✔ 01 [email protected]<ip> 1.203s

Subsequent deploy / cap production puma:restart

00:00 puma:start

      using conf file /home/rails/apps/app-name/shared/puma.rb

      01 ~/.rvm/bin/rvm default do bundle exec puma -C /home/rails/apps/app-name/shared/puma.rb --daemon

      01 Puma starting in single mode...


      01 * Version 4.3.3 (ruby 2.6.5-p114), codename: Mysterious Traveller


      01 * Min threads: 4, max threads: 16


      01 * Environment: production


      01 * Daemonizing...


    ✔ 01 [email protected]<ip> 1.264s