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

Open
JamesChevalier opened this Issue May 16, 2018 · 15 comments

Comments

Projects
None yet
@JamesChevalier

JamesChevalier commented May 16, 2018

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

⬇️ Downgrade gem "rufus-scheduler" to 3.4.2
Current version 3.5.0 has issues with sidekiq-cron

ondrejbartas/sidekiq-cron#199
@tommyalvarez

This comment has been minimized.

tommyalvarez commented May 16, 2018

+1 this is urgent

@jmettraux

This comment has been minimized.

Contributor

jmettraux commented May 17, 2018

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

This comment has been minimized.

brianstien commented May 17, 2018

@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

Use directly fugit instead of rufus-scheduler
Addresses ondrejbartas#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

This comment has been minimized.

Contributor

jmettraux commented May 18, 2018

@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

@woqer

This comment has been minimized.

woqer 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

@ardation

This comment has been minimized.

ardation commented May 27, 2018

I got around this by adding this to my Gemfile

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

This comment has been minimized.

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

fix sidekiq-cron issue
it stopped working due to incompatible new version of rufus-scheduler, see ondrejbartas/sidekiq-cron#199

moonavw added a commit to moonavw/labman that referenced this issue May 28, 2018

fix sidekiq-cron issue
it stopped working due to incompatible new version of rufus-scheduler, see ondrejbartas/sidekiq-cron#199
@giedriusr

This comment has been minimized.

giedriusr commented Jun 7, 2018

Any news?

@dcdieci

This comment has been minimized.

dcdieci commented Jul 9, 2018

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

@davidhrbac

This comment has been minimized.

davidhrbac commented Jul 19, 2018

Upgraded to 1.0.0 and it seems to fix the issue.

@jmettraux

This comment has been minimized.

Contributor

jmettraux commented Jul 19, 2018

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

@lucascaton

This comment has been minimized.

lucascaton commented Jul 19, 2018

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

This comment has been minimized.

Contributor

jmettraux commented Jul 19, 2018

@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

This comment has been minimized.

lucascaton commented Jul 20, 2018

Thanks :)

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