Giter Club home page Giter Club logo

Comments (20)

elpic avatar elpic commented on May 24, 2024

Hi @juanibiapina,

I will take a look at your issue.

from sidekiq-scheduler.

elpic avatar elpic commented on May 24, 2024

@juanibiapina,

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.

juanibiapina avatar juanibiapina commented on May 24, 2024

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.

Jesterovskiy avatar Jesterovskiy commented on May 24, 2024

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.

juanibiapina avatar juanibiapina commented on May 24, 2024

@Jesterovskiy awesome. Glad to know I'm not doing something crazy.

from sidekiq-scheduler.

elpic avatar elpic commented on May 24, 2024

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.

elpic avatar elpic commented on May 24, 2024

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.

elpic avatar elpic commented on May 24, 2024

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.

elpic avatar elpic commented on May 24, 2024

Please let me know if works for you. That way I can close the issue.

from sidekiq-scheduler.

juanibiapina avatar juanibiapina commented on May 24, 2024

Testing now.

from sidekiq-scheduler.

juanibiapina avatar juanibiapina commented on May 24, 2024

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.

elpic avatar elpic commented on May 24, 2024

Do you require 'sidekiq-scheduler/web' on the routes.rb?

from sidekiq-scheduler.

juanibiapina avatar juanibiapina commented on May 24, 2024

That fixed the web interface. Now to actually make them run.

Should we close this issue?

from sidekiq-scheduler.

elpic avatar elpic commented on May 24, 2024

Why are you sure there are not running?

from sidekiq-scheduler.

Jesterovskiy avatar Jesterovskiy commented on May 24, 2024

@elpic I used manual config - everything is deployed and work. Thank you =)

from sidekiq-scheduler.

juanibiapina avatar juanibiapina commented on May 24, 2024

It is working now. Thanks.

from sidekiq-scheduler.

elpic avatar elpic commented on May 24, 2024

NP

from sidekiq-scheduler.

elpic avatar elpic commented on May 24, 2024

Thank you for using this gem. :D

from sidekiq-scheduler.

Jesterovskiy avatar Jesterovskiy commented on May 24, 2024

@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.

elpic avatar elpic commented on May 24, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.