inventionlabsSydney / capistrano-sneakers

Sneakers support for Capistrano
MIT License
15 stars 42 forks source link

Wont go beyond sneakers:start #28

Open silva96 opened 5 years ago

silva96 commented 5 years ago

Host OS: Ubuntu 14.04.4 Rails Version: 5.0.2 Gem version: a7d2fbcba2d9c6fbe762883021ec4e5836b7f5ff gem 'capistrano-sneakers', github: 'inventionlabsSydney/capistrano-sneakers', ref: 'a7d2fbcba2d9c6fbe762883021ec4e5836b7f5ff'

Never passes next steps after sneakers:start

Here is ps aux | grep sneakers

my_user   25384  0.0  0.0  11116  1436 ?        Ss   15:06   0:00 bash -c cd /mnt/ebs-dev/www/my_app_demo/releases/20190109150457 && ( export RAILS_ENV="production" WORKERS="EndWorker,SearchResultsWorker" ; ~/.rvm/bin/rvm 2.4.0 do bundle exec rake sneakers:run )
my_user   25385  0.0  0.0  11116   640 ?        S    15:06   0:00 bash -c cd /mnt/ebs-dev/www/my_app_demo/releases/20190109150457 && ( export RAILS_ENV="production" WORKERS="EndWorker,SearchResultsWorker" ; ~/.rvm/bin/rvm 2.4.0 do bundle exec rake sneakers:run )
my_user   25386  1.1  9.4 670248 193668 ?       Sl   15:06   0:09 /mnt/ebs-dev/www/my_app_demo/shared/bundle/ruby/2.4.0/bin/rake sneakers:run
my_user   25609  0.0  9.3 945728 192408 ?       Sl   15:06   0:00 /mnt/ebs-dev/www/my_app_demo/shared/bundle/ruby/2.4.0/bin/rake sneakers:run
my_user   25628  0.0  9.3 944700 192384 ?       Sl   15:06   0:00 /mnt/ebs-dev/www/my_app_demo/shared/bundle/ruby/2.4.0/bin/rake sneakers:run
my_user   25630  0.0  9.0 944700 186292 ?       Sl   15:06   0:00 /mnt/ebs-dev/www/my_app_demo/shared/bundle/ruby/2.4.0/bin/rake sneakers:run
my_user   25666  0.0  9.0 945728 186252 ?       Sl   15:06   0:00 /mnt/ebs-dev/www/my_app_demo/shared/bundle/ruby/2.4.0/bin/rake sneakers:run

It looks like it doesn't launch it as daemon, so the command keeps waiting for response (sneakers are launched but not detached)

Here is part of the capistrano log

** Invoke deploy:assets:backup_manifest (first_time)
** Execute deploy:assets:backup_manifest
** Invoke deploy:cleanup_assets (first_time)
** Invoke deploy:set_rails_env 
** Execute deploy:cleanup_assets
** Invoke deploy:normalize_assets (first_time)
** Invoke deploy:set_rails_env 
** Execute deploy:normalize_assets
** Invoke deploy:migrate (first_time)
** Invoke deploy:set_rails_env 
** Execute deploy:migrate
** Invoke deploy:migrating (first_time)
** Invoke deploy:set_rails_env 
** Execute deploy:migrating
 DEBUG [4a1b30b5]   info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
 DEBUG [4a1b30b5]   [3/4] Linking dependencies...
 DEBUG [4a1b30b5]   warning "@rails/webpacker > postcss-cssnext@3.1.0" has unmet peer dependency "caniuse-lite@^1.0.30000697".
 DEBUG [4a1b30b5]   warning " > vue-datetime@1.0.0-beta.3" has incorrect peer dependency "luxon@^0.3.1".
 DEBUG [4a1b30b5]   warning " > vue-loader@14.2.2" has unmet peer dependency "css-loader@*".
 DEBUG [4a1b30b5]   warning " > webpack-dev-server@2.11.2" has unmet peer dependency "webpack@^2.2.0 || ^3.0.0".
 DEBUG [4a1b30b5]   warning "webpack-dev-server > webpack-dev-middleware@1.12.2" has unmet peer dependency "webpack@^1.0.0 || ^2.0.0 || ^3.0.0".
 DEBUG [4a1b30b5]   [4/4] Building fresh packages...
 DEBUG [4a1b30b5]   success Saved lockfile.
 DEBUG [4a1b30b5]   Done in 9.27s.
 DEBUG [4a1b30b5]   Webpacker is installed 🎉 🍰
 DEBUG [4a1b30b5]   
 DEBUG [4a1b30b5]   Using /mnt/ebs-dev/www/my_app_demo/releases/20190109150457/config/webpacker.yml file for setting up webpack paths
 DEBUG [4a1b30b5]   
 DEBUG [4a1b30b5]   Compiling…
 DEBUG [4a1b30b5]   Compiled all packs in /mnt/ebs-dev/www/my_app_demo/releases/20190109150457/public/packs
 DEBUG [4a1b30b5]   2.0: 32 processed / 61 skipped
 DEBUG [4a1b30b5]   
  INFO [4a1b30b5] Finished in 38.519 seconds with exit status 0 (successful).
 DEBUG [6786eefd] Running if test ! -d /mnt/ebs-dev/www/my_app_demo/releases/20190109150457; then echo "Directory does not exist '/mnt/ebs-dev/www/my_app_demo/releases/20190109150457'" 1>&2; false; fi as myuser@host-ip
 DEBUG [6786eefd] Command: if test ! -d /mnt/ebs-dev/www/my_app_demo/releases/20190109150457; then echo "Directory does not exist '/mnt/ebs-dev/www/my_app_demo/releases/20190109150457'" 1>&2; false; fi
 DEBUG [c765635e] Finished in 0.042 seconds with exit status 0 (successful).
  INFO [7f90e619] Running /usr/bin/env mkdir -p /mnt/ebs-dev/www/my_app_demo/releases/20190109150457/assets_manifest_backup as myuser@host-ip
 DEBUG [7f90e619] Command: cd /mnt/ebs-dev/www/my_app_demo/releases/20190109150457 && /usr/bin/env mkdir -p /mnt/ebs-dev/www/my_app_demo/releases/20190109150457/assets_manifest_backup
  INFO [b1ecafda] Finished in 0.041 seconds with exit status 0 (successful).
 DEBUG [1882c932] Running /usr/bin/env ls /mnt/ebs-dev/www/my_app_demo/releases/20190109150457/public/assets/.sprockets-manifest* as myuser@host-ip
 DEBUG [1882c932] Command: cd /mnt/ebs-dev/www/my_app_demo/releases/20190109150457 && /usr/bin/env ls /mnt/ebs-dev/www/my_app_demo/releases/20190109150457/public/assets/.sprockets-manifest*
 DEBUG [4b8554d1]   /mnt/ebs-dev/www/my_app_demo/releases/20190109150457/public/assets/.sprockets-manifest-4c48591c815369cbcc380ef4fbb6fca8.json
 DEBUG [4b8554d1] Finished in 0.044 seconds with exit status 0 (successful).
 DEBUG [0f76df90] Running /usr/bin/env ls /mnt/ebs-dev/www/my_app_demo/releases/20190109150457/public/assets/.sprockets-manifest* as myuser@host-ip
 DEBUG [0f76df90] Command: cd /mnt/ebs-dev/www/my_app_demo/releases/20190109150457 && /usr/bin/env ls /mnt/ebs-dev/www/my_app_demo/releases/20190109150457/public/assets/.sprockets-manifest*
 DEBUG [56b82c2b]   /mnt/ebs-dev/www/my_app_demo/releases/20190109150457/public/assets/.sprockets-manifest-4c48591c815369cbcc380ef4fbb6fca8.json
 DEBUG [56b82c2b] Finished in 0.044 seconds with exit status 0 (successful).
  INFO [7d227836] Running /usr/bin/env cp /mnt/ebs-dev/www/my_app_demo/releases/20190109150457/public/assets/.sprockets-manifest-4c48591c815369cbcc380ef4fbb6fca8.json /mnt/ebs-dev/www/my_app_demo/releases/20190109150457/assets_manifest_backup as myuser@host-ip
 DEBUG [7d227836] Command: cd /mnt/ebs-dev/www/my_app_demo/releases/20190109150457 && /usr/bin/env cp /mnt/ebs-dev/www/my_app_demo/releases/20190109150457/public/assets/.sprockets-manifest-4c48591c815369cbcc380ef4fbb6fca8.json /mnt/ebs-dev/www/my_app_demo/releases/20190109150457/assets_manifest_backup
  INFO [3bf6d4e2] Finished in 0.044 seconds with exit status 0 (successful).
 DEBUG [2d7641ee] Running if test ! -d /mnt/ebs-dev/www/my_app_demo/releases/20190109150457; then echo "Directory does not exist '/mnt/ebs-dev/www/my_app_demo/releases/20190109150457'" 1>&2; false; fi as myuser@host-ip
 DEBUG [2d7641ee] Command: if test ! -d /mnt/ebs-dev/www/my_app_demo/releases/20190109150457; then echo "Directory does not exist '/mnt/ebs-dev/www/my_app_demo/releases/20190109150457'" 1>&2; false; fi
 DEBUG [4d4a8bdb] Finished in 0.041 seconds with exit status 0 (successful).
  INFO [c573b576] Running ~/.rvm/bin/rvm 2.4.0 do bundle exec rake 'assets:clean[3]' as myuser@host-ip
 DEBUG [c573b576] Command: cd /mnt/ebs-dev/www/my_app_demo/releases/20190109150457 && ( export RAILS_ENV="production" ; ~/.rvm/bin/rvm 2.4.0 do bundle exec rake 'assets:clean[3]' )
  INFO [1287c314] Finished in 8.374 seconds with exit status 0 (successful).
  INFO [deploy:migrate] Run `rake db:migrate`
 DEBUG [552f2de1] Running if test ! -d /mnt/ebs-dev/www/my_app_demo/releases/20190109150457; then echo "Directory does not exist '/mnt/ebs-dev/www/my_app_demo/releases/20190109150457'" 1>&2; false; fi as myuser@host-ip
 DEBUG [552f2de1] Command: if test ! -d /mnt/ebs-dev/www/my_app_demo/releases/20190109150457; then echo "Directory does not exist '/mnt/ebs-dev/www/my_app_demo/releases/20190109150457'" 1>&2; false; fi
 DEBUG [4572b96e] Finished in 0.040 seconds with exit status 0 (successful).
  INFO [a662387f] Running ~/.rvm/bin/rvm 2.4.0 do bundle exec rake db:migrate as myuser@host-ip
 DEBUG [a662387f] Command: cd /mnt/ebs-dev/www/my_app_demo/releases/20190109150457 && ( export RAILS_ENV="production" ; ~/.rvm/bin/rvm 2.4.0 do bundle exec rake db:migrate )
  INFO [543be831] Finished in 9.085 seconds with exit status 0 (successful).
** Invoke whenever:update_crontab (first_time)
** Execute whenever:update_crontab
** Invoke sidekiq:quiet (first_time)
** Execute sidekiq:quiet
** Invoke sidekiq:stop (first_time)
** Invoke deploy:deregister_instances_from_load_balancer (first_time)
** Execute deploy:deregister_instances_from_load_balancer
** Execute sidekiq:stop
** Invoke sneakers:stop (first_time)
** Execute sneakers:stop
** Invoke deploy:publishing (first_time)
** Execute deploy:publishing
** Invoke deploy:symlink:release (first_time)
** Execute deploy:symlink:release
 DEBUG [6e43aa8f] Running if test ! -d /mnt/ebs-dev/www/my_app_demo/releases/20190109150457; then echo "Directory does not exist '/mnt/ebs-dev/www/my_app_demo/releases/20190109150457'" 1>&2; false; fi as myuser@host-ip
 DEBUG [6e43aa8f] Command: if test ! -d /mnt/ebs-dev/www/my_app_demo/releases/20190109150457; then echo "Directory does not exist '/mnt/ebs-dev/www/my_app_demo/releases/20190109150457'" 1>&2; false; fi
 DEBUG [e8a80e11] Finished in 0.042 seconds with exit status 0 (successful).
  INFO [dffc7b1e] Running ~/.rvm/bin/rvm 2.4.0 do bundle exec whenever --update-crontab my_app_demo_staging --set environment=production --roles=web,app,db as myuser@host-ip
 DEBUG [dffc7b1e] Command: cd /mnt/ebs-dev/www/my_app_demo/releases/20190109150457 && ( export RAILS_ENV="production" ; ~/.rvm/bin/rvm 2.4.0 do bundle exec whenever --update-crontab my_app_demo_staging --set environment=production --roles=web,app,db )
 DEBUG [2251e835]   [write] crontab file updated
  INFO [2251e835] Finished in 1.732 seconds with exit status 0 (successful).
 DEBUG [318963df] Running [ -d /mnt/ebs-dev/www/my_app_demo/releases/20190109150457 ] as myuser@host-ip
 DEBUG [318963df] Command: [ -d /mnt/ebs-dev/www/my_app_demo/releases/20190109150457 ]
 DEBUG [7a938f1d] Finished in 0.039 seconds with exit status 0 (successful).
 DEBUG [75fadb52] Running if test ! -d /mnt/ebs-dev/www/my_app_demo/releases/20190109150457; then echo "Directory does not exist '/mnt/ebs-dev/www/my_app_demo/releases/20190109150457'" 1>&2; false; fi as myuser@host-ip
 DEBUG [75fadb52] Command: if test ! -d /mnt/ebs-dev/www/my_app_demo/releases/20190109150457; then echo "Directory does not exist '/mnt/ebs-dev/www/my_app_demo/releases/20190109150457'" 1>&2; false; fi
 DEBUG [e67fa16d] Finished in 0.040 seconds with exit status 0 (successful).
 DEBUG [ce1caf8c] Running /usr/bin/env [ -f /mnt/ebs-dev/www/my_app_demo/shared/tmp/pids/sidekiq-0.pid ] as myuser@host-ip
 DEBUG [ce1caf8c] Command: cd /mnt/ebs-dev/www/my_app_demo/releases/20190109150457 && /usr/bin/env [ -f /mnt/ebs-dev/www/my_app_demo/shared/tmp/pids/sidekiq-0.pid ]
 DEBUG [7d26e125] Finished in 0.041 seconds with exit status 1 (failed).
 DEBUG [529e61f7] Running if test ! -d /mnt/ebs-dev/www/my_app_demo/releases/20190109150457; then echo "Directory does not exist '/mnt/ebs-dev/www/my_app_demo/releases/20190109150457'" 1>&2; false; fi as myuser@host-ip
 DEBUG [529e61f7] Command: if test ! -d /mnt/ebs-dev/www/my_app_demo/releases/20190109150457; then echo "Directory does not exist '/mnt/ebs-dev/www/my_app_demo/releases/20190109150457'" 1>&2; false; fi
 DEBUG [e1fb427d] Finished in 0.042 seconds with exit status 0 (successful).
  INFO Removing instances [{:id=>"i-085d3f490ee2cdf0d"}]
 DEBUG [3970da95] Running [ -d /mnt/ebs-dev/www/my_app_demo/releases/20190109150457 ] as myuser@host-ip
 DEBUG [3970da95] Command: [ -d /mnt/ebs-dev/www/my_app_demo/releases/20190109150457 ]
 DEBUG [1be6b351] Finished in 0.004 seconds with exit status 0 (successful).
 DEBUG [6ffe43d8] Running if test ! -d /mnt/ebs-dev/www/my_app_demo/releases/20190109150457; then echo "Directory does not exist '/mnt/ebs-dev/www/my_app_demo/releases/20190109150457'" 1>&2; false; fi as myuser@host-ip
 DEBUG [6ffe43d8] Command: if test ! -d /mnt/ebs-dev/www/my_app_demo/releases/20190109150457; then echo "Directory does not exist '/mnt/ebs-dev/www/my_app_demo/releases/20190109150457'" 1>&2; false; fi
 DEBUG [6bbc8116] Finished in 0.042 seconds with exit status 0 (successful).
 DEBUG [69ad3c20] Running /usr/bin/env [ -f /mnt/ebs-dev/www/my_app_demo/shared/tmp/pids/sidekiq-0.pid ] as myuser@host-ip
 DEBUG [69ad3c20] Command: cd /mnt/ebs-dev/www/my_app_demo/releases/20190109150457 && /usr/bin/env [ -f /mnt/ebs-dev/www/my_app_demo/shared/tmp/pids/sidekiq-0.pid ]
 DEBUG [782209a9] Finished in 0.041 seconds with exit status 1 (failed).
 DEBUG [50e999bd] Running [ -d /mnt/ebs-dev/www/my_app_demo/current ] as myuser@host-ip
 DEBUG [50e999bd] Command: [ -d /mnt/ebs-dev/www/my_app_demo/current ]
 DEBUG [64de7664] Finished in 0.043 seconds with exit status 0 (successful).
 DEBUG [f49a0530] Running if test ! -d /mnt/ebs-dev/www/my_app_demo/releases/20190109150457; then echo "Directory does not exist '/mnt/ebs-dev/www/my_app_demo/releases/20190109150457'" 1>&2; false; fi as myuser@host-ip
 DEBUG [f49a0530] Command: if test ! -d /mnt/ebs-dev/www/my_app_demo/releases/20190109150457; then echo "Directory does not exist '/mnt/ebs-dev/www/my_app_demo/releases/20190109150457'" 1>&2; false; fi
 DEBUG [dfc82a4d] Finished in 0.044 seconds with exit status 0 (successful).
 DEBUG [c2b16570] Running /usr/bin/env [ -f /mnt/ebs-dev/www/my_app_demo/shared/tmp/pids/sneakers.pid ] as myuser@host-ip
 DEBUG [c2b16570] Command: cd /mnt/ebs-dev/www/my_app_demo/releases/20190109150457 && /usr/bin/env [ -f /mnt/ebs-dev/www/my_app_demo/shared/tmp/pids/sneakers.pid ]
 DEBUG [33745032] Finished in 0.044 seconds with exit status 0 (successful).
 DEBUG [ee2033ec] Running /usr/bin/env kill -0 $( cat /mnt/ebs-dev/www/my_app_demo/shared/tmp/pids/sneakers.pid ) as myuser@host-ip
 DEBUG [ee2033ec] Command: cd /mnt/ebs-dev/www/my_app_demo/releases/20190109150457 && /usr/bin/env kill -0 $( cat /mnt/ebs-dev/www/my_app_demo/shared/tmp/pids/sneakers.pid )
 DEBUG [18924b7f] Finished in 0.045 seconds with exit status 1 (failed).
  INFO [bc5259dc] Running /usr/bin/env ln -s /mnt/ebs-dev/www/my_app_demo/releases/20190109150457 /mnt/ebs-dev/www/my_app_demo/releases/current as myuser@host-ip
 DEBUG [bc5259dc] Command: /usr/bin/env ln -s /mnt/ebs-dev/www/my_app_demo/releases/20190109150457 /mnt/ebs-dev/www/my_app_demo/releases/current
  INFO [55edcad5] Finished in 0.042 seconds with exit status 0 (successful).
  INFO [e241dd4d] Running /usr/bin/env mv /mnt/ebs-dev/www/my_app_demo/releases/current /mnt/ebs-dev/www/my_app_demo as myuser@host-ip
** Invoke deploy:restart_sidekiq (first_time)
** Execute deploy:restart_sidekiq
** Invoke deploy:restart_sneakers (first_time)
** Execute deploy:restart_sneakers
** Invoke sneakers:restart (first_time)
** Execute sneakers:restart
** Invoke sneakers:stop (first_time)
** Execute sneakers:stop
** Invoke sneakers:start (first_time)
** Execute sneakers:start
silva96 commented 5 years ago

adding daemonize option in the initializers/sneakers.rb does the trick

Sneakers.configure(
  amqp: "amqp://#{ENV['RABBITMQ_USER']}:#{ENV['RABBITMQ_PASSWORD']}@#{ENV['RABBITMQ_HOST']}:#{ENV['RABBITMQ_PORT']}",
  workers: 4,
  timeout_job_after: 10,
  daemonize: Rails.env.production?
)
Sneakers.logger.level = Logger::INFO