Rails4.2 heroku環境でSidekiqにプロセスが入らない
Heroku環境でmailerをSidekiqで非同期処理したいのです。
キューは入るのですがプロセスが入りません、開発環境ではプロセスも入り非同期処理を行うことが可能です。
ma$ heroku ps
=== web (Free): bin/rails server -p $PORT -e $RAILS_ENV
web.1: up 2015/07/18 17:47:02 (~ 6m ago)
=== worker (Free): bundle exec sidekiq -q carrierwave
worker.1: crashed 2015/07/18 17:46:52 (~ 6m ago)
#config/initializers/sidkiq.rb
Sidekiq.configure_server do |config|
case Rails.env
when 'production' then
config.redis = { url: ENV['REDISCLOUD_URL'], namespace: 'sidekiq' }
when 'staging' then
config.redis = { url: 'redis://stg.redis-example.com:6379', namespace: 'sidekiq' }
else
config.redis = { url: 'redis://localhost:6379', namespace: 'sidekiq' }
end
end
Sidekiq.configure_client do |config|
case Rails.env
when 'production' then
config.redis = { url: ENV['REDISCLOUD_URL'], namespace: 'sidekiq' }
when 'staging' then
config.redis = { url: 'redis://stg.redis-example.com:6379', namespace: 'sidekiq' }
else
config.redis = { url: 'redis://localhost:6379', namespace: 'sidekiq' }
end
end
#Procfile
worker: bundle exec sidekiq -C config/sidekiq.yml
#sidekiq.yml
:verbose: false
:concurrency: 25
:queues:
- default
- mailers
- carrierwave
:daemon: true
#heroku restart後
#heroku logs --tail
2015-07-19T03:48:03.145504+00:00 heroku[web.1]: State changed from up to starting
2015-07-19T03:48:03.199847+00:00 heroku[worker.1]: State changed from crashed to starting
2015-07-19T03:48:06.146853+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2015-07-19T03:48:06.902735+00:00 app[web.1]: [2015-07-19 03:48:06] FATAL SignalException: SIGTERM
2015-07-19T03:48:06.902740+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `select'
2015-07-19T03:48:06.902742+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `block in start'
2015-07-19T03:48:06.902745+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:32:in `start'
2015-07-19T03:48:06.902746+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:160:in `start'
2015-07-19T03:48:06.902748+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:34:in `run'
2015-07-19T03:48:06.902749+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/server.rb:286:in `start'
2015-07-19T03:48:06.902750+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/commands/server.rb:80:in `start'
2015-07-19T03:48:06.902752+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:80:in `block in server'
2015-07-19T03:48:06.902754+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
2015-07-19T03:48:06.902756+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
2015-07-19T03:48:06.902757+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
2015-07-19T03:48:06.902759+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
2015-07-19T03:48:06.902760+00:00 app[web.1]: bin/rails:4:in `require'
2015-07-19T03:48:06.902762+00:00 app[web.1]: bin/rails:4:in `<main>'
2015-07-19T03:48:06.903091+00:00 app[web.1]: [2015-07-19 03:48:06] INFO going to shutdown ...
2015-07-19T03:48:06.903167+00:00 app[web.1]: [2015-07-19 03:48:06] INFO WEBrick::HTTPServer#start done.
2015-07-19T03:48:06.903215+00:00 app[web.1]: => Booting WEBrick
2015-07-19T03:48:06.903217+00:00 app[web.1]: => Rails 4.2.0 application starting in production on http://0.0.0.0:10714
2015-07-19T03:48:06.903218+00:00 app[web.1]: => Run `rails server -h` for more startup options
2015-07-19T03:48:06.903220+00:00 app[web.1]: => Ctrl-C to shutdown server
2015-07-19T03:48:06.903251+00:00 app[web.1]: Exiting
2015-07-19T03:48:08.219896+00:00 heroku[web.1]: Process exited with status 143
2015-07-19T03:48:08.348078+00:00 heroku[worker.1]: Starting process with command `bundle exec sidekiq -C config/sidekiq.yml`
2015-07-19T03:48:08.776837+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 18578 -e production`
2015-07-19T03:48:08.989739+00:00 heroku[worker.1]: State changed from starting to up
2015-07-19T03:48:10.819431+00:00 app[worker.1]: You really should set a logfile if you're going to daemonize
2015-07-19T03:48:10.819468+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.0.0/gems/sidekiq-3.3.4/lib/sidekiq/cli.rb:173:in `daemonize'
2015-07-19T03:48:10.819470+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.0.0/gems/sidekiq-3.3.4/lib/sidekiq/cli.rb:41:in `parse'
2015-07-19T03:48:10.819471+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.0.0/gems/sidekiq-3.3.4/bin/sidekiq:7:in `<top (required)>'
2015-07-19T03:48:10.819472+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.0.0/bin/sidekiq:23:in `load'
2015-07-19T03:48:10.819474+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.0.0/bin/sidekiq:23:in `<main>'
2015-07-19T03:48:11.573789+00:00 heroku[worker.1]: State changed from up to crashed
2015-07-19T03:48:11.560084+00:00 heroku[worker.1]: Process exited with status 1
2015-07-19T03:48:21.789930+00:00 app[web.1]: [2015-07-19 03:48:21] INFO WEBrick 1.3.1
2015-07-19T03:48:21.794994+00:00 app[web.1]: [2015-07-19 03:48:21] INFO WEBrick::HTTPServer#start: pid=3 port=18578
2015-07-19T03:48:21.794295+00:00 app[web.1]: [2015-07-19 03:48:21] INFO ruby 2.0.0 (2015-04-13) [x86_64-linux]
2015-07-19T03:48:21.959680+00:00 heroku[web.1]: State changed from starting to up