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

Issue with v3.3.0, The property 'args' is not defined for Que::Scheduler::EnqueuedJobType #175

Closed
Sylphias opened this issue Apr 28, 2020 · 5 comments

Comments

@Sylphias
Copy link

Hello,

I've been trying to run que-scheduler and I ran into this issue

NoMethodError: The property 'args' is not defined for Que::Scheduler::EnqueuedJobType.

This is following the same instructions on the Readme.

I've tried adding arguments purposely to the jobs and inside que_schedule.yml

I dug into the code and noticed this

 class EnqueuedJobType < Hashie::Dash
      property :args
      property :queue
      property :priority
      property :run_at, required: true
      property :job_class, required: true
      property :job_id, required: true
    end

Args are defined but somehow the scheduler when creating the job, cant seem to add the arguments to the class. Possibly from args: data.fetch(:arguments) (to_enqueue.rb)

The fix I've done was to revert back to 3.2.8 and then everything was working again.

@hlascelles
Copy link
Owner

hlascelles commented Apr 29, 2020

Interesting. Agreed, it looks like it should work as args is defined. Can you:

  1. Tell me if you are using ActiveJob
  2. Share the PG, Rails and Ruby version
  3. Post an example of the section of the que-schedule.yaml file that shows the error

More of the stack trace might help too...

I am going to guess this is a serialisation issue where the tests are using symbols, but a roundtrip to the DB is returning strings. That area of code has changed in multiple places over the years, both inside que-scheduler and outside areas including que and the pg gem.

Thank you for raising this.

@Sylphias
Copy link
Author

Ah, unfortunately. I dont have the stack trace anymore and I'm rushing a project right now to help revert the project to the previous state in which I found the bug in.

  1. I was not using activejob
  2. PG : 11.6 (running on docker alpine), rails 5.2.4.2, ruby 2.6.5
DailyReportJob:
  cron: "15 0 * * *"

I've also tried the custom name method with class and args defined. (even purposely putting an args to the job)

Off the top of my head, the tracestack I remember pointed to Hashie::Dash. I assume that there might be some issue with the parsing there.

I'll try to see if I can find some time to dig deeper into this. Thank a lot mate!

@hlascelles
Copy link
Owner

The way args are handled has been changed very slightly in 3.4.0 (support for hashes and nils was added). I'd be interested to hear if you see any difference or improvement.

@redscode
Copy link
Contributor

redscode commented Jul 8, 2020

I've ran into this issue as well when upgrading to v3.4.0 with que v0.14.3
This is my stack trace:

NoMethodError: The property 'args' is not defined for Que::Scheduler::EnqueuedJobType.
/usr/local/bundle/gems/hashie-3.6.0/lib/hashie/dash.rb:226:in `fail_no_property_error!'
/usr/local/bundle/gems/hashie-3.6.0/lib/hashie/dash.rb:204:in `assert_property_exists!'
/usr/local/bundle/gems/hashie-3.6.0/lib/hashie/dash.rb:146:in `[]='
/usr/local/bundle/gems/hashie-3.6.0/lib/hashie/dash.rb:199:in `block in update_attributes'
/usr/local/bundle/gems/hashie-3.6.0/lib/hashie/dash.rb:198:in `each_pair'
/usr/local/bundle/gems/hashie-3.6.0/lib/hashie/dash.rb:198:in `update_attributes'
/usr/local/bundle/gems/hashie-3.6.0/lib/hashie/dash.rb:192:in `initialize_attributes'
/usr/local/bundle/gems/hashie-3.6.0/lib/hashie/dash.rb:120:in `initialize'
/usr/local/bundle/gems/que-scheduler-3.4.0/lib/que/scheduler/to_enqueue.rb:84:in `new'
/usr/local/bundle/gems/que-scheduler-3.4.0/lib/que/scheduler/to_enqueue.rb:84:in `enqueue'
/usr/local/bundle/gems/que-scheduler-3.4.0/lib/que/scheduler/scheduler_job.rb:39:in `block in enqueue_required_jobs'
/usr/local/bundle/gems/que-scheduler-3.4.0/lib/que/scheduler/scheduler_job.rb:38:in `map'
/usr/local/bundle/gems/que-scheduler-3.4.0/lib/que/scheduler/scheduler_job.rb:38:in `enqueue_required_jobs'
/usr/local/bundle/gems/que-scheduler-3.4.0/lib/que/scheduler/scheduler_job.rb:27:in `block in run'
/usr/local/bundle/gems/que-scheduler-3.4.0/lib/que/scheduler/db.rb:22:in `block in transaction'
/usr/local/bundle/gems/que-0.14.3/lib/que.rb:174:in `block in transaction'
/usr/local/bundle/gems/que-0.14.3/lib/que/adapters/active_record.rb:7:in `block in checkout'
/usr/local/bundle/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:471:in `with_connection'
/usr/local/bundle/gems/que-0.14.3/lib/que/adapters/active_record.rb:32:in `block in checkout_activerecord_adapter'
/usr/local/bundle/gems/activesupport-6.0.3.1/lib/active_support/execution_wrapper.rb:84:in `wrap'
/usr/local/bundle/gems/que-0.14.3/lib/que/adapters/active_record.rb:31:in `checkout_activerecord_adapter'
/usr/local/bundle/gems/que-0.14.3/lib/que/adapters/active_record.rb:7:in `checkout'
/usr/local/bundle/gems/que-0.14.3/lib/que.rb:168:in `transaction'
/usr/local/bundle/gems/que-scheduler-3.4.0/lib/que/scheduler/db.rb:22:in `call'
/usr/local/bundle/gems/que-scheduler-3.4.0/lib/que/scheduler/db.rb:22:in `transaction'
/usr/local/bundle/gems/que-scheduler-3.4.0/lib/que/scheduler/scheduler_job.rb:21:in `run'
/usr/local/bundle/gems/que-0.14.3/lib/que/job.rb:17:in `_run'
/usr/local/bundle/gems/que-0.14.3/lib/que/job.rb:132:in `block in work'
/usr/local/bundle/gems/que-0.14.3/lib/que/adapters/active_record.rb:7:in `block in checkout'
/usr/local/bundle/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:471:in `with_connection'
/usr/local/bundle/gems/que-0.14.3/lib/que/adapters/active_record.rb:32:in `block in checkout_activerecord_adapter'
/usr/local/bundle/gems/activesupport-6.0.3.1/lib/active_support/execution_wrapper.rb:88:in `wrap'
/usr/local/bundle/gems/que-0.14.3/lib/que/adapters/active_record.rb:31:in `checkout_activerecord_adapter'
/usr/local/bundle/gems/que-0.14.3/lib/que/adapters/active_record.rb:7:in `checkout'
/usr/local/bundle/gems/que-0.14.3/lib/que/job.rb:114:in `work'
/usr/local/bundle/gems/que-0.14.3/lib/que/worker.rb:80:in `block in work_loop'
/usr/local/bundle/gems/que-0.14.3/lib/que/worker.rb:75:in `loop'
/usr/local/bundle/gems/que-0.14.3/lib/que/worker.rb:75:in `work_loop'
/usr/local/bundle/gems/que-0.14.3/lib/que/worker.rb:19:in `block in initialize'

@hlascelles
Copy link
Owner

Closed via #205 and #206

Gem 3.4.1 released.

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

No branches or pull requests

3 participants