Comments (20)
Hi @juanibiapina,
I will take a look at your issue.
from sidekiq-scheduler.
I'm not being able to reproduce the issue.
Could you please add more details:
- Gemfile
- What is the rake task that have issues
Are you running the rake tasks locally or on a prod env?
Thanks
from sidekiq-scheduler.
The rake task is assets:precompile
. Running in qa env.
Gemfile:
source "https://artifactory.globoi.com/artifactory/api/gems/gem-repos/"
ruby "2.2.3"
# rails
gem "rails", "4.2.4"
# settings
gem "config"
# assets
gem "jquery-rails"
gem "bootstrap-sass"
gem "uglifier", ">= 1.3.0"
gem "therubyracer"
gem "puma"
# db
gem "mongoid"
gem "mongoid-uuid"
# api
gem "grape"
gem "grape-active_model_serializers"
gem "grape-swagger"
gem "active_model_serializers"
gem "hashie-forbidden_attributes"
gem "grape-middleware-logger"
# storage
gem "net-sftp", require: "net/sftp"
# client
gem "rest-client"
# background processing
gem "sidekiq", "3.4.1"
gem "sidekiq-pro"
gem "sidekiq-failures"
gem "sinatra", require: false
gem "smart_polling"
# pagination
gem "kaminari"
group :development, :test do
gem "byebug"
gem "web-console", "~> 2.0"
gem "spring"
gem "rspec-rails"
gem "rspec-nc"
gem "guard"
gem "guard-rspec"
gem "guard-bundler"
gem "fabrication"
gem "database_cleaner", "~> 1.4.1"
end
group :production, :qa do
# monitoring
gem "rails_12factor"
gem "newrelic_rpm"
gem "newrelic_moped"
end
from sidekiq-scheduler.
Have the same issue.
Log from capistrano:
DEBUG [f24b4296] Command: cd /apps/app_name/releases/20151211165312 && ( export RBENV_ROOT="/opt/rbenv" RBENV_VERSION="2.2.3" RAILS_ENV="qa" ; RBENV_ROOT=/opt/rbenv RBENV_VERSION=2.2.3 /opt/rbenv/bin/rbenv exec bundle exec rake assets:precompile )
DEBUG [f24b4296] rake aborted!
DEBUG [f24b4296] Redis::CannotConnectError: Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED)
/apps/app_name/shared/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:332:in `rescue in establish_connection'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:318:in `establish_connection'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:94:in `block in connect'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:280:in `with_reconnect'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:93:in `connect'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:351:in `ensure_connected'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:208:in `block in process'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:293:in `logging'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:207:in `process'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:113:in `call'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis.rb:1964:in `block in hget'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis.rb:57:in `block in synchronize'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis.rb:57:in `synchronize'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis.rb:1963:in `hget'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/sidekiq-scheduler-2.0.0/lib/sidekiq-scheduler/schedule.rb:67:in `block in get_schedule'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/sidekiq-4.0.1/lib/sidekiq.rb:84:in `block in redis'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/connection_pool-2.2.0/lib/connection_pool.rb:64:in `block (2 levels) in with'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/connection_pool-2.2.0/lib/connection_pool.rb:63:in `handle_interrupt'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/connection_pool-2.2.0/lib/connection_pool.rb:63:in `block in with'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/connection_pool-2.2.0/lib/connection_pool.rb:60:in `handle_interrupt'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/connection_pool-2.2.0/lib/connection_pool.rb:60:in `with'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/sidekiq-4.0.1/lib/sidekiq.rb:81:in `redis'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/sidekiq-scheduler-2.0.0/lib/sidekiq-scheduler/schedule.rb:67:in `get_schedule'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/sidekiq-scheduler-2.0.0/lib/sidekiq-scheduler/schedule.rb:98:in `set_schedule'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/sidekiq-scheduler-2.0.0/lib/sidekiq-scheduler/schedule.rb:42:in `block in schedule='
/apps/app_name/shared/bundle/ruby/2.2.0/gems/sidekiq-scheduler-2.0.0/lib/sidekiq-scheduler/schedule.rb:41:in `each'
/apps/app_name/shared/bundle/ruby/2.2.0/gems/sidekiq-scheduler-2.0.0/lib/sidekiq-scheduler/schedule.rb:41:in `schedule='
/apps/app_name/releases/20151211165312/config/initializers/scheduler.rb:3:in `<top (required)>'
scheduler.rb
unless Rails.env.development?
require 'sidekiq/scheduler'
Sidekiq.schedule = YAML.load_file(File.expand_path("../../../config/scheduler.yml",__FILE__))
end
sidekiq.rb
Sidekiq.configure_server do |config|
config.redis = {url: Settings.redis_url}
end
Sidekiq.configure_client do |config|
config.redis = {url: Settings.redis_url}
end
Gemfile.lock
sidekiq (4.0.1)
concurrent-ruby (~> 1.0)
connection_pool (~> 2.2, >= 2.2.0)
json (~> 1.0)
redis (~> 3.2, >= 3.2.1)
sidekiq-scheduler (2.0.0)
multi_json (~> 1)
redis (~> 3)
rufus-scheduler (~> 3.1.8)
sidekiq (>= 3)
from sidekiq-scheduler.
@Jesterovskiy awesome. Glad to know I'm not doing something crazy.
from sidekiq-scheduler.
Could you send me the Gemfile.lock because I getting the following error while trying to install the gems:
Bundler could not find compatible versions for gem "bson":
In Gemfile:
mongoid (>= 0) ruby depends on
mongo (~> 2.1) ruby depends on
bson (~> 4.0) ruby
mongoid-uuid (>= 0) ruby depends on
mongoid (<= 4.0, >= 3.0) ruby depends on
moped (~> 2.0.0) ruby depends on
bson (~> 2.2) ruby
Bundler could not find compatible versions for gem "activemodel":
In Gemfile:
rails (= 4.2.4) ruby depends on
activemodel (= 4.2.4) ruby
rails (= 4.2.4) ruby depends on
activemodel (= 4.2.4) ruby
web-console (~> 2.0) ruby depends on
activemodel (>= 4.0) ruby
active_model_serializers (>= 0) ruby depends on
activemodel (>= 3.2) ruby
mongoid (>= 0) ruby depends on
activemodel (~> 4.0) ruby
mongoid-uuid (>= 0) ruby depends on
mongoid (<= 4.0, >= 3.0) ruby depends on
activemodel (~> 3.1) ruby
from sidekiq-scheduler.
Hi I just found the issue is related with the way you load sidekiq-scheduler.
Instead of loading it manually you can specify the schedule key on sidekiq.yml like this:
---
:queues:
- priority_emails
- emails
- releases
- default
:schedule:
process_emails_due:
cron: "* * * * *"
queue: emails
class: "Testing"
This way the schedule will be loaded automatically when you load sidekiq.
Anyway I will keep investigating why this is happening and trying to solve it.
Sorry for the delay on the response.
from sidekiq-scheduler.
If you want to doing it manually you need to configure the sidekiq-scheduler.rb like this:
unless Rails.env.development?
require 'sidekiq/scheduler'
Sidekiq.configure_server do |config|
config.on(:startup) do
Sidekiq.schedule = YAML.load_file(File.expand_path("../../../config/schedule.yml",__FILE__))
end
end
end
from sidekiq-scheduler.
Please let me know if works for you. That way I can close the issue.
from sidekiq-scheduler.
Testing now.
from sidekiq-scheduler.
I added the 'schedule' key to sidekiq.yml. This solves the problem with the rake target.
I see on the log that the schedule was loaded, but I don't see them on the web interface and they don't actually run, but I guess this is a different issue.
from sidekiq-scheduler.
Do you require 'sidekiq-scheduler/web' on the routes.rb?
from sidekiq-scheduler.
That fixed the web interface. Now to actually make them run.
Should we close this issue?
from sidekiq-scheduler.
Why are you sure there are not running?
from sidekiq-scheduler.
@elpic I used manual config - everything is deployed and work. Thank you =)
from sidekiq-scheduler.
It is working now. Thanks.
from sidekiq-scheduler.
NP
from sidekiq-scheduler.
Thank you for using this gem. :D
from sidekiq-scheduler.
@elpic about manual config, after successful deploy I did not realise, that schedule not working. I didn't have much time to understand why and I move 'schedule' key to sidekiq.yml. Now I stay with this config.
from sidekiq-scheduler.
@Jesterovskiy that is strange, because the "manual config" is the same that does the gem. Maybe the file is not loading correctly or something like that.
from sidekiq-scheduler.
Related Issues (20)
- Did sidekiq-scheduler 5.0.0 add a Rails dependency? HOT 3
- Raises an exception when rufus_scheduler_options is nil by default HOT 3
- Could not find gem 'sidekiq-scheduler (= 5.0.1)' with platform 'arm64-darwin-21' HOT 1
- Sidekiq version requirement HOT 1
- Run job multiple times, but never at the same time HOT 3
- Uppercase character in header name: Cache-Control
- Sidekiq 7.1 warns when deprecated Redis commands are used
- Cron expression with day of month does not work HOT 4
- Support for Ruby 3.0 and deconstruct Hashes as keyword arguments. HOT 5
- Move away from deprecated Redis commands HOT 2
- undefined method `next_time' for nil:NilClass HOT 5
- re-use Sidekiq Rack::Static instance for assets
- RedisManager does not appear to be updating in test env HOT 6
- Sidekick (docker) deprecation warning HOT 1
- UI not loading on heroku HOT 7
- Error handler threw an error HOT 2
- [feature request] environment specific schedules HOT 1
- Recommend Sidekiq::Job instead of Sidekiq::Worker HOT 1
- How to test that sidekiq.yml is *correct*? HOT 3
- SidekiqScheduler::Manager enormous inspect output HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sidekiq-scheduler.