我是使用sidekiq&redis的新手,并试图让sidekiq在Heroku上运行,但每次部署Rails 4应用程序时似乎都崩溃了。 我在Papertrail中遇到这个错误:
May 03 11:16:37 myapp app/worker.1: No such file or directory @ rb_sysopen - ./log/sidekiq.log May 03 11:16:37 myapp app/worker.1: /app/vendor/ruby-2.2.0/lib/ruby/2.2.0/logger.rb:636:in `initialize' May 03 11:16:37 myapp app/worker.1: /app/vendor/ruby-2.2.0/lib/ruby/2.2.0/logger.rb:636:in `open' May 03 11:16:37 myapp app/worker.1: /app/vendor/ruby-2.2.0/lib/ruby/2.2.0/logger.rb:636:in `create_logfile' May 03 11:16:37 myapp app/worker.1: /app/vendor/ruby-2.2.0/lib/ruby/2.2.0/logger.rb:630:in `rescue in open_logfile' May 03 11:16:37 myapp app/worker.1: /app/vendor/ruby-2.2.0/lib/ruby/2.2.0/logger.rb:627:in `open_logfile' May 03 11:16:37 myapp app/worker.1: /app/vendor/ruby-2.2.0/lib/ruby/2.2.0/logger.rb:584:in `initialize' May 03 11:16:37 myapp app/worker.1: /app/vendor/ruby-2.2.0/lib/ruby/2.2.0/logger.rb:318:in `new' May 03 11:16:37 myapp app/worker.1: /app/vendor/ruby-2.2.0/lib/ruby/2.2.0/logger.rb:318:in `initialize' May 03 11:16:37 myapp app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/sidekiq-3.3.4/lib/sidekiq/logging.rb:31:in `new' May 03 11:16:37 myapp app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/sidekiq-3.3.4/lib/sidekiq/logging.rb:31:in `initialize_logger' May 03 11:16:37 myapp app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/sidekiq-3.3.4/lib/sidekiq/cli.rb:344:in `initialize_logger' May 03 11:16:37 myapp app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/sidekiq-3.3.4/lib/sidekiq/cli.rb:39:in `parse' May 03 11:16:37 myapp app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/sidekiq-3.3.4/bin/sidekiq:7:in `<top (required)>' May 03 11:16:37 myapp app/worker.1: /app/vendor/bundle/ruby/2.2.0/bin/sidekiq:23:in `load' May 03 11:16:37 myapp app/worker.1: /app/vendor/bundle/ruby/2.2.0/bin/sidekiq:23:in `<main>' May 03 11:16:38 myapp heroku/worker.1: State changed from up to crashed May 03 11:16:38 myapp heroku/worker.1: Process exited with status 1我正在使用RedisToGo添加。 这是我的配置:
sidekiq.yaml
--- development: :concurrency: 10 production: :concurrency: 20 :pidfile: ./tmp/pids/sidekiq.pid :logfile: ./log/sidekiq.log :queues: - default - mailers - [high_priority, 2]Procfile
worker: bundle exec sidekiq -c 2 -v config/sidekiq.yml web: bundle exec puma -p $PORTsidekiq.rb
require 'sidekiq' ENV["REDISTOGO_URL"] ||= "redis://localhost:6379" Sidekiq.configure_server do |config| config.redis = { url: ENV["REDISTOGO_URL"], :size => 4 } database_url = ENV['MYAPP_DATABASE_URL'] if database_url ENV['MYAPP_DATABASE_URL'] = "#{database_url}?pool=50" ActiveRecord::Base.establish_connection end end Sidekiq.configure_client do |config| config.redis = { url: ENV["REDISTOGO_URL"], :size => 1 } endmy_var.rb
ENV['REDISTOGO_URL'] = 'redis:/myredistogourl/' ENV['PROVIDER_URL'] = ENV['REDISTOGO_URL']我应该注意到,我有一个log / sidekiq.log文件。 另外,我之前一直在gitignoring日志文件,但现在我没有。 我仔细检查了他们正在检查我的其他gitrepo。 sidekiq.log文件在那里...它只是没有被发现。
I'm new to using sidekiq & redis and am trying to get sidekiq to run on Heroku, but it seems to crash each time I deploy my Rails 4 app. I get this error in Papertrail:
May 03 11:16:37 myapp app/worker.1: No such file or directory @ rb_sysopen - ./log/sidekiq.log May 03 11:16:37 myapp app/worker.1: /app/vendor/ruby-2.2.0/lib/ruby/2.2.0/logger.rb:636:in `initialize' May 03 11:16:37 myapp app/worker.1: /app/vendor/ruby-2.2.0/lib/ruby/2.2.0/logger.rb:636:in `open' May 03 11:16:37 myapp app/worker.1: /app/vendor/ruby-2.2.0/lib/ruby/2.2.0/logger.rb:636:in `create_logfile' May 03 11:16:37 myapp app/worker.1: /app/vendor/ruby-2.2.0/lib/ruby/2.2.0/logger.rb:630:in `rescue in open_logfile' May 03 11:16:37 myapp app/worker.1: /app/vendor/ruby-2.2.0/lib/ruby/2.2.0/logger.rb:627:in `open_logfile' May 03 11:16:37 myapp app/worker.1: /app/vendor/ruby-2.2.0/lib/ruby/2.2.0/logger.rb:584:in `initialize' May 03 11:16:37 myapp app/worker.1: /app/vendor/ruby-2.2.0/lib/ruby/2.2.0/logger.rb:318:in `new' May 03 11:16:37 myapp app/worker.1: /app/vendor/ruby-2.2.0/lib/ruby/2.2.0/logger.rb:318:in `initialize' May 03 11:16:37 myapp app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/sidekiq-3.3.4/lib/sidekiq/logging.rb:31:in `new' May 03 11:16:37 myapp app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/sidekiq-3.3.4/lib/sidekiq/logging.rb:31:in `initialize_logger' May 03 11:16:37 myapp app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/sidekiq-3.3.4/lib/sidekiq/cli.rb:344:in `initialize_logger' May 03 11:16:37 myapp app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/sidekiq-3.3.4/lib/sidekiq/cli.rb:39:in `parse' May 03 11:16:37 myapp app/worker.1: /app/vendor/bundle/ruby/2.2.0/gems/sidekiq-3.3.4/bin/sidekiq:7:in `<top (required)>' May 03 11:16:37 myapp app/worker.1: /app/vendor/bundle/ruby/2.2.0/bin/sidekiq:23:in `load' May 03 11:16:37 myapp app/worker.1: /app/vendor/bundle/ruby/2.2.0/bin/sidekiq:23:in `<main>' May 03 11:16:38 myapp heroku/worker.1: State changed from up to crashed May 03 11:16:38 myapp heroku/worker.1: Process exited with status 1I am using the RedisToGo add on. Here are my configurations:
sidekiq.yaml
--- development: :concurrency: 10 production: :concurrency: 20 :pidfile: ./tmp/pids/sidekiq.pid :logfile: ./log/sidekiq.log :queues: - default - mailers - [high_priority, 2]Procfile
worker: bundle exec sidekiq -c 2 -v config/sidekiq.yml web: bundle exec puma -p $PORTsidekiq.rb
require 'sidekiq' ENV["REDISTOGO_URL"] ||= "redis://localhost:6379" Sidekiq.configure_server do |config| config.redis = { url: ENV["REDISTOGO_URL"], :size => 4 } database_url = ENV['MYAPP_DATABASE_URL'] if database_url ENV['MYAPP_DATABASE_URL'] = "#{database_url}?pool=50" ActiveRecord::Base.establish_connection end end Sidekiq.configure_client do |config| config.redis = { url: ENV["REDISTOGO_URL"], :size => 1 } endmy_var.rb
ENV['REDISTOGO_URL'] = 'redis:/myredistogourl/' ENV['PROVIDER_URL'] = ENV['REDISTOGO_URL']I should note, I DO have a log/sidekiq.log file. Also, I had been gitignoring log files before, but now I'm not. I've double checked that they are checking into my other gitrepo. The sidekiq.log file is there...it's just not being found.
最满意答案
从config.yml中删除pidfile和logfile行。 你在Heroku上运行,他们没有任何意义。
Remove the pidfile and logfile lines from your config.yml. You're running on Heroku, they don't make any sense.
更多推荐
发布评论