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

Notifier errored: ArgumentError: wrong number of arguments (given 1, expected 0) #1280

Open
wbharding opened this issue Mar 10, 2024 · 8 comments

Comments

@wbharding
Copy link
Sponsor

wbharding commented Mar 10, 2024

Hey @bensheldon, long time supporter of the project 👋 Thanks for all the great work you've done over the last couple years since I first subscribed.

Today I upgraded my Rails site that uses good_job to Ruby 3.2 (I am on Rails 6.1.7.7), and I used the upgrading occasion to upgrade my good_job from 2.7.4 to 3.26.1. Unfortunately, now when I run rails s, I get an endless loop of failure that prevents me from using my app:

   (0.1ms)  SET application_name = 'GoodJob::Notifier'
   (0.1ms)  LISTEN good_job
[GoodJob] Notifier subscribed with LISTEN
   (0.1ms)  UNLISTEN *
[GoodJob] Notifier unsubscribed with UNLISTEN
[GoodJob] Notifier errored: ArgumentError: wrong number of arguments (given 1, expected 0)
 ["/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/good_job-3.26.1/app/models/concerns/good_job/advisory_lockable.rb:76:in `block (2 levels) in <module:AdvisoryLockable>'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation.rb:411:in `instance_exec'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation.rb:411:in `block in _exec_scope'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation.rb:804:in `_scoping'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation.rb:411:in `_exec_scope'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/scoping/named.rb:176:in `block in scope'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation/delegation.rb:67:in `block in joins_advisory_locks'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation.rb:406:in `block in scoping'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation.rb:804:in `_scoping'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation.rb:406:in `scoping'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation/delegation.rb:67:in `joins_advisory_locks'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/good_job-3.26.1/app/models/concerns/good_job/advisory_lockable.rb:100:in `block (2 levels) in <module:AdvisoryLockable>'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation.rb:411:in `instance_exec'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation.rb:411:in `block in _exec_scope'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation.rb:804:in `_scoping'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation.rb:411:in `_exec_scope'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/scoping/named.rb:176:in `block in scope'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation/delegation.rb:67:in `block in advisory_unlocked'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation.rb:406:in `block in scoping'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation.rb:804:in `_scoping'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation.rb:406:in `scoping'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation/delegation.rb:67:in `advisory_unloc^Cked'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/good_job-3.26.1/app/models/good_job/process.rb:32:in `block in <class:Process>'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation.rb:411:in `instance_exec'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation.rb:411:in `block in _exec_scope'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation.rb:804:in `_scoping'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/relation.rb:411:in `_exec_scope'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activerecord-6.1.7.7/lib/active_record/scoping/named.rb:176:in `block in scope'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/good_job-3.26.1/app/models/good_job/process.rb:81:in `cleanup'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/good_job-3.26.1/lib/good_job/notifier/process_heartbeat.rb:18:in `block in register_process'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/good_job-3.26.1/lib/good_job/overridable_connection.rb:26:in `override_connection'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/good_job-3.26.1/lib/good_job/notifier/process_heartbeat.rb:17:in `register_process'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activesupport-6.1.7.7/lib/active_support/callbacks.rb:427:in `block in make_lambda'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activesupport-6.1.7.7/lib/active_support/callbacks.rb:270:in `block in simple'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activesupport-6.1.7.7/lib/active_support/callbacks.rb:516:in `block in invoke_after'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activesupport-6.1.7.7/lib/active_support/callbacks.rb:516:in `each'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activesupport-6.1.7.7/lib/active_support/callbacks.rb:516:in `invoke_after'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activesupport-6.1.7.7/lib/active_support/callbacks.rb:107:in `run_callbacks'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/good_job-3.26.1/lib/good_job/notifier.rb:203:in `block (3 levels) in create_listen_task'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/activesupport-6.1.7.7/lib/active_support/execution_wrapper.rb:91:in `wrap'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/good_job-3.26.1/lib/good_job/notifier.rb:202:in `block (2 levels) in create_listen_task'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/good_job-3.26.1/lib/good_job/notifier.rb:257:in `with_connection'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/good_job-3.26.1/lib/good_job/notifier.rb:198:in `block in create_listen_task'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:24:in `block in execute'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:in `block in synchronize'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:in `synchronize'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:in `synchronize'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:22:in `execute'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/ivar.rb:170:in `safe_execute'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/scheduled_task.rb:298:in `process_task'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/timer_set.rb:98:in `block in ns_post_task'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:359:in `run_task'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:350:in `block (3 levels) in create_worker'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:341:in `loop'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:341:in `block (2 levels) in create_worker'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:340:in `catch'", "/Users/bill/.rvm/gems/ruby-3.2.3@noteappsinfo/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:340:in `block in create_worker'"]

I've attached a file that shows the full output of starting my development server.
image
After the screenshot, the message just repeats in an endless loop several times per second.

I took a look at the code in question:
image

But it's not clear to me where the exception is coming from, or what aspect of the Rails startup process is triggering the exception, but I can't claim to understand the answer to either Q. Hopefully you have ideas, such that I can run my project again soon? I would normally try to move back to older gem versions to diagnose what version this started at, but part of my upgrade process was that good_job generated ~10 new migration files that I ran, which gives me the impression that if I tried to move to an older gem version, I would probably generate errors from schema mismatch, so I'm kind of at a dead end on how I might proceed. Thanks for any help!

@bensheldon
Copy link
Owner

bensheldon commented Mar 10, 2024

You're hitting a bug in Rails described here: #785 (comment)

Solution is to upgrade to Rails 6.1.8 👍

@wbharding
Copy link
Sponsor Author

wbharding commented Mar 10, 2024

Aha, thanks for the tip! Unfortunately, per the discussion in the Rails PR,

No we are not going to release a 6.1.8, you can point your application at the 6-1-stable branch or upgrade to 7.0.x.

Sounds like 6.1.8 might not be coming to the rescue, so it sounds like myself (and others who encounter this) will need to either monkey patch or figure out how to point Rails at an unreleased branch. 😬

And actually, as I look at the 6-1 stable branch, I don't see any commits since 6.1.7.7. And the PR that fixes the issue touches several files, so making a monkey patch would be pretty painful. Not sure how to proceed.

@bensheldon
Copy link
Owner

bensheldon commented Mar 10, 2024 via email

@wbharding
Copy link
Sponsor Author

wbharding commented Mar 10, 2024

Fortunately a version has been released since that comment was made.

Hmm, yes, it looks like they did release 6.1.7.7 temporally subsequent to that discussion, but looking at a file like rescuable.rb, Rails 6.1.7.7 doesn't include include the code from the fix, so one has to figure out how to adapt their Gemfile to point to the Rails 6-1-stable branch

No releases have happened after 6.1.7.7:
image

@bensheldon
Copy link
Owner

Oh bummer! I misread the version list.

@pattersonc
Copy link

@bensheldon We are looking to migrate from DelayedJob to GoodJob. We are running Rails 6.1 / Ruby 3.2. Is there a recommended path forward to resolved this compatibility issue? I attempted pulling rails from the 6-1-stable branch but that didn't seem to work either. Thanks for your efforts here.

@bensheldon
Copy link
Owner

@pattersonc that's a bummer 😞 Also strange that's it's not working even when you directly use the branch, I'm assuming via something like this: https://github.com/samvera/hyku/pull/2125/files

It's a bit of a bind because I won't change those method signatures without a major version deprecation cycle. Are you able to update Rails to a more recent version while still staying on Delayed Job, and then migrate to GoodJob?

@pattersonc
Copy link

@bensheldon My issue was unrelated. I had an older version of listen gem pinned. Everything seems to be working with the 6-1-stable branched pinned.

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

No branches or pull requests

3 participants