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

Support for Rails 6.1 / Ruby 3.2 #785

Closed
Timmitry opened this issue Jan 5, 2023 · 8 comments
Closed

Support for Rails 6.1 / Ruby 3.2 #785

Timmitry opened this issue Jan 5, 2023 · 8 comments

Comments

@Timmitry
Copy link
Contributor

Timmitry commented Jan 5, 2023

Hello and a happy new year!

I just tried to start GoodJob with the newly released Ruby 3.2 for my application, and it raises an error:

[GoodJob] Notifier errored: ArgumentError: wrong number of arguments (given 1, expected 0)

The error originates from this line:

scope :joins_advisory_locks, (lambda do |column: _advisory_lockable_column|

Not really urgent, but just wanted to share this 🙂

@bensheldon
Copy link
Owner

@Timmitry happy new year! thanks for reporting! What version of Rails are you running? I'm curious because I upgraded my Rails 7.0 app and it went ok.

@Timmitry
Copy link
Contributor Author

Timmitry commented Jan 5, 2023

We are using Rails 6.1.7. Hope that helps to find the issue, if not, I'm glad to provide more information 🙂

@bensheldon
Copy link
Owner

@Timmitry thank you, that's helpful. There is some incompatibility with earlier versions of Rails 6.0.x, but if you're on 6.1.7 🤔

Could you share your complete backtrace of the error? I'm curious why the Notifier is calling down into joins_advisory_locks.

@bensheldon
Copy link
Owner

Hmm, this might be an issue with Rails. This looks very similar: rails/rails#46883

@bensheldon
Copy link
Owner

I think this PR will fix it: rails/rails#46895

@Timmitry
Copy link
Contributor Author

Timmitry commented Jan 6, 2023

Oh, that does indeed look like the problem. So it's not good job but rather the combination of Ruby 3.2 and Rails 6.1 that causes problems. Let's see if they fix it for Rails 6.1, otherwise we will just delay the Ruby update and first do the Rails update 🙂

Here's the stackrace, even though that should probably not be an issue anymore:

Stacktrace
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/good_job-3.7.2/app/models/good_job/lockable.rb:75:in `block (2 levels) in <module:Lockable>'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation.rb:411:in `instance_exec'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation.rb:411:in `block in _exec_scope'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation.rb:804:in `_scoping'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation.rb:411:in `_exec_scope'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/scoping/named.rb:176:in `block in scope'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation/delegation.rb:67:in `block in joins_advisory_locks'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation.rb:406:in `block in scoping'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation.rb:804:in `_scoping'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation.rb:406:in `scoping'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation/delegation.rb:67:in `joins_advisory_locks'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/good_job-3.7.2/app/models/good_job/lockable.rb:101:in `block (2 levels) in <module:Lockable>'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation.rb:411:in `instance_exec'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation.rb:411:in `block in _exec_scope'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation.rb:804:in `_scoping'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation.rb:411:in `_exec_scope'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/scoping/named.rb:176:in `block in scope'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation/delegation.rb:67:in `block in advisory_unlocked'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation.rb:406:in `block in scoping'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation.rb:804:in `_scoping'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation.rb:406:in `scoping'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation/delegation.rb:67:in `advisory_unlocked'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/good_job-3.7.2/app/models/good_job/process.rb:26:in `block in <class:Process>'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation.rb:411:in `instance_exec'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation.rb:411:in `block in _exec_scope'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation.rb:804:in `_scoping'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/relation.rb:411:in `_exec_scope'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activerecord-6.1.7/lib/active_record/scoping/named.rb:176:in `block in scope'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/good_job-3.7.2/app/models/good_job/process.rb:57:in `cleanup'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/good_job-3.7.2/lib/good_job/notifier/process_registration.rb:17:in `block in register_process'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/good_job-3.7.2/lib/good_job/assignable_connection.rb:32:in `with_connection'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/good_job-3.7.2/lib/good_job/notifier/process_registration.rb:16:in `register_process'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:427:in `block in make_lambda'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:270:in `block in simple'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:516:in `block in invoke_after'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:516:in `each'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:516:in `invoke_after'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:107:in `run_callbacks'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/good_job-3.7.2/lib/good_job/notifier.rb:171:in `block (2 levels) in listen'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/good_job-3.7.2/lib/good_job/notifier.rb:215:in `with_connection'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/good_job-3.7.2/lib/good_job/notifier.rb:169:in `block in listen'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:24:in `block in execute'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:47:in `block in synchronize'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:47:in `synchronize'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:47:in `synchronize'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:22:in `execute'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/ivar.rb:169:in `safe_execute'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/scheduled_task.rb:298:in `process_task'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/timer_set.rb:98:in `block in ns_post_task'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:352:in `run_task'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:343:in `block (3 levels) in create_worker'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:334:in `loop'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:334:in `block (2 levels) in create_worker'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:333:in `catch'"
"/Users/tim.landwerth/.asdf/installs/ruby/3.2.0/lib/ruby/gems/3.2.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:333:in `block in create_worker'"

@morgoth
Copy link
Collaborator

morgoth commented Jan 31, 2023

@Timmitry Can this issue be closed, as it's Rails related?
FYI: I'm using GJ on Ruby 3.2 without a problem with latest stable Rails release

@Timmitry
Copy link
Contributor Author

Timmitry commented Feb 1, 2023

@morgoth Yes, I think so, for people using Rails 6.1, the corresponding issue is linked, and as you said, it works with Ruby 3.2, so all good, thanks 👍

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

No branches or pull requests

3 participants