Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with newer versions of rufus-scheduler #199

Closed
JamesChevalier opened this issue May 16, 2018 · 16 comments
Closed

Incompatible with newer versions of rufus-scheduler #199

JamesChevalier opened this issue May 16, 2018 · 16 comments

Comments

@JamesChevalier
Copy link

This gem works with rufus-scheduler version 3.4.2 but does not work with version 3.5.0

While using version 3.5.0, attempting Sidekiq::Cron::Job.create calls returns false, and the job is not added.

My only guess to the cause is that according to the changelog, rufus-scheduler now uses fugit to parse durations and cronlines.
I looked for instances of parse_time_string and parse_duration_string in this repository, and didn't find any - so it doesn't appear that their removal is playing a part here.

ledermann added a commit to ledermann/docker-rails that referenced this issue May 16, 2018
Current version 3.5.0 has issues with sidekiq-cron

sidekiq-cron/sidekiq-cron#199
@tommyalvarez
Copy link

+1 this is urgent

@jmettraux
Copy link
Contributor

@jmettraux
Copy link
Contributor

Hello @JamesChevalier,

I am the author of rufus-scheduler.

While using version 3.5.0, attempting Sidekiq::Cron::Job.create calls returns false, and the job is not added.

Would you have time to instrument a bit the following method in Sidekiq-Cron and tell me why it returns false?

https://github.com/ondrejbartas/sidekiq-cron/blob/master/lib/sidekiq/cron/job.rb#L393-L412

I'm particulary interested in what gets stuffed into @errors and what Exception gets intercepted (stacktrace and all).

I don't have any Sidekiq (nor Redis) instance at hand, thanks in advance!

@brianstien
Copy link

@jmettraux This problem is affecting us as well. I was able to track down the error you were looking for

jruby-9.1.12.0 :018 > j = ::Sidekiq::Cron::Job.new(:name => "foo", :cron => "* * * * *", :klass => "Foo", :queue => "foo")
 => #<Sidekiq::Cron::Job:0xd332ebc @active_job=false, @active_job_queue_name_prefix=nil, @active_job_queue_name_delimiter=nil, @klass="Foo", @args=[], @status="enabled", @last_enqueue_time=nil, @fetch_missing_args=true, @message={"queue"=>"foo", "class"=>"Foo", "args"=>[]}, @name="foo", @queue="foo", @queue_name_with_prefix="foo", @cron="* * * * *"> 
jruby-9.1.12.0 :019 > j.valid?
 => false 
jruby-9.1.12.0 :020 > j.errors
 => ["'cron' -> * * * * *: uninitialized constant Rufus::Scheduler::CronLine"]

jmettraux added a commit to jmettraux/sidekiq-cron that referenced this issue May 18, 2018
Addresses sidekiq-cron#199

Sidekiq-cron is not using rufus-scheduler itself but rather its cron logic which recently got spun off in the fugit gem (https://github.com/floraison/fugit).

This patch makes Sidekiq-cron depend directly on fugit instead of rufus-scheduler.

A refinement would be to cache the parsed cron line in the Sidekiq-cron Job instance so that there is no need to reparse each time.
@jmettraux
Copy link
Contributor

@brianstien Thanks a lot!

I submitted a pull request that aligns Sidekiq-cron on fugit (the parsing lib behind rufus-scheduler >= 3.5 instead of rufus-scheduler).

http://jmettraux.skepti.ch/20180515.html?t=rufus_scheduler_3_5_0_released

@vanitu vanitu mentioned this issue May 21, 2018
jhjguxin added a commit to old-guys/nazgrel that referenced this issue May 23, 2018
@wvidana
Copy link

wvidana commented May 24, 2018

This also happened to us with:

  • Rails 5.1.5
  • Sidekiq 5.1.3
  • Sidekiq-cron 3.5.0
  • rufus-scheduler 3.5.0

Suddenly all of our cron jobs were not being enqueued anymore

@tataihono
Copy link

tataihono commented May 27, 2018

I got around this by adding this to my Gemfile

gem 'rufus-scheduler', '~> 3.4.0'

@jmettraux
Copy link
Contributor

jmettraux commented May 28, 2018

Yet another reminder: https://bundler.io/v1.16/guides/updating_gems.html

Updating your dependency gem versions is something you do deliberately, with your back covered by your test suite. http://jmettraux.skepti.ch/20180601.html?t=Gemfile_lock&f=gh

moonavw added a commit to moonavw/labman that referenced this issue May 28, 2018
it stopped working due to incompatible new version of rufus-scheduler, see sidekiq-cron/sidekiq-cron#199
moonavw added a commit to moonavw/labman that referenced this issue May 28, 2018
it stopped working due to incompatible new version of rufus-scheduler, see sidekiq-cron/sidekiq-cron#199
@giedriusr
Copy link

Any news?

@dcdieci
Copy link

dcdieci commented Jul 9, 2018

I just installed version 1.0.0 and it fixed the mentioned error for me

@davidhrbac
Copy link

Upgraded to 1.0.0 and it seems to fix the issue.

@jmettraux
Copy link
Contributor

@ondrejbartas Could you please close this issue and also its duplicates: gh-201 and gh-206?

@lucascaton
Copy link

After upgrading to version 1.0.0, although it solved the problem, Last enqueued column got stuck and always displays 10 hours ago. However, the logs show that it's running every hour as expected.

Is anyone else having this issue?

image

@jmettraux
Copy link
Contributor

@lucascaton Yes, people are giving feedback and coming with suggestions at gh-202, gh-209, gh-210, and gh-213. Since it's not related to "Incompatible with newer versions of rufus-scheduler" (this issue), the conversation is happening elsewhere.

@lucascaton
Copy link

Thanks :)

@taki
Copy link

taki commented Mar 20, 2019

If it seems to be corrected, could you please close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests