Closed Awlter closed 6 years ago
Hey @Awlter, removing activejob_backport should fix the issues.
Hi, @ankane , it still doesn't seem to work after removing the gem. new backtrace
/gems/searchkick-3.1.0/lib/searchkick/process_queue_job.rb:5 in perform
/gems/activejob-4.2.5/lib/active_job/execution.rb:32 in block in perform_now
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:117 in call
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:555 in block (2 levels) in compile
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:505 in call
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:498 in block (2 levels) in around
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:343 in block (2 levels) in simple
/gems/sentry-raven-2.7.3/lib/raven/integrations/rails/active_job.rb:18 in capture_and_reraise_with_sentry
/gems/sentry-raven-2.7.3/lib/raven/integrations/rails/active_job.rb:12 in block (2 levels) in included
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:441 in instance_exec
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:441 in block in make_lambda
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:342 in block in simple
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:497 in block in around
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:505 in call
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:498 in block (2 levels) in around
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:343 in block (2 levels) in simple
/gems/i18n-0.8.6/lib/i18n.rb:257 in with_locale
/gems/activejob-4.2.5/lib/active_job/translation.rb:7 in block (2 levels) in <module:Translation>
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:441 in instance_exec
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:441 in block in make_lambda
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:342 in block in simple
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:497 in block in around
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:505 in call
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:498 in block (2 levels) in around
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:343 in block (2 levels) in simple
/gems/activejob-4.2.5/lib/active_job/logging.rb:23 in block (4 levels) in <module:Logging>
/gems/activesupport-4.2.5/lib/active_support/notifications.rb:164 in block in instrument
/gems/activesupport-4.2.5/lib/active_support/notifications/instrumenter.rb:20 in instrument
/gems/activesupport-4.2.5/lib/active_support/notifications.rb:164 in instrument
/gems/activejob-4.2.5/lib/active_job/logging.rb:22 in block (3 levels) in <module:Logging>
/gems/activejob-4.2.5/lib/active_job/logging.rb:43 in block in tag_logger
/gems/activesupport-4.2.5/lib/active_support/tagged_logging.rb:68 in block in tagged
/gems/activesupport-4.2.5/lib/active_support/tagged_logging.rb:26 in tagged
/gems/activesupport-4.2.5/lib/active_support/tagged_logging.rb:68 in tagged
/gems/activejob-4.2.5/lib/active_job/logging.rb:43 in tag_logger
/gems/activejob-4.2.5/lib/active_job/logging.rb:19 in block (2 levels) in <module:Logging>
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:441 in instance_exec
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:441 in block in make_lambda
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:342 in block in simple
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:497 in block in around
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:505 in call
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:92 in __run_callbacks__
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:778 in _run_perform_callbacks
/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:81 in run_callbacks
/gems/activejob-4.2.5/lib/active_job/execution.rb:31 in perform_now
/gems/activejob-4.2.5/lib/active_job/execution.rb:21 in execute
/gems/activejob-4.2.5/lib/active_job/queue_adapters/sidekiq_adapter.rb:42 in perform
/gems/sidekiq-5.2.1/lib/sidekiq/processor.rb:185 in execute_job
/gems/sidekiq-5.2.1/lib/sidekiq/processor.rb:167 in block (2 levels) in process
/gems/sidekiq-5.2.1/lib/sidekiq/middleware/chain.rb:128 in block in invoke
/gems/sentry-raven-2.7.3/lib/raven/integrations/sidekiq.rb:9 in call
/gems/sidekiq-5.2.1/lib/sidekiq/middleware/chain.rb:130 in block in invoke
/gems/sidekiq-5.2.1/lib/sidekiq/middleware/chain.rb:133 in invoke
/gems/sidekiq-5.2.1/lib/sidekiq/processor.rb:166 in block in process
/gems/sidekiq-5.2.1/lib/sidekiq/processor.rb:137 in block (6 levels) in dispatch
/gems/sidekiq-5.2.1/lib/sidekiq/job_retry.rb:98 in local
/gems/sidekiq-5.2.1/lib/sidekiq/processor.rb:136 in block (5 levels) in dispatch
/gems/sidekiq-5.2.1/lib/sidekiq.rb:36 in block in <module:Sidekiq>
/gems/sidekiq-5.2.1/lib/sidekiq/processor.rb:132 in block (4 levels) in dispatch
/gems/sidekiq-5.2.1/lib/sidekiq/processor.rb:217 in stats
/gems/sidekiq-5.2.1/lib/sidekiq/processor.rb:127 in block (3 levels) in dispatch
/gems/sidekiq-5.2.1/lib/sidekiq/job_logger.rb:8 in call
/gems/sidekiq-5.2.1/lib/sidekiq/processor.rb:126 in block (2 levels) in dispatch
/gems/sidekiq-5.2.1/lib/sidekiq/job_retry.rb:73 in global
/gems/sidekiq-5.2.1/lib/sidekiq/processor.rb:125 in block in dispatch
/gems/sidekiq-5.2.1/lib/sidekiq/logging.rb:48 in with_context
/gems/sidekiq-5.2.1/lib/sidekiq/logging.rb:42 in with_job_hash_context
/gems/sidekiq-5.2.1/lib/sidekiq/processor.rb:124 in dispatch
/gems/sidekiq-5.2.1/lib/sidekiq/processor.rb:165 in process
/gems/sidekiq-5.2.1/lib/sidekiq/processor.rb:83 in process_one
/gems/sidekiq-5.2.1/lib/sidekiq/processor.rb:71 in run
/gems/sidekiq-5.2.1/lib/sidekiq/util.rb:16 in watchdog
/gems/sidekiq-5.2.1/lib/sidekiq/util.rb:25 in block in safe_thread
Here are the params info
{
"context": "Job raised exception",
"job": {
"args": [
{
"arguments": [
{
"class_name": "Accession"
}
],
"job_class": "Searchkick::ProcessQueueJob",
"job_id": "e7538b38-6051-4393-8369-bbc096e9c6d2",
"queue_name": "staging_searchkick"
}
],
"class": "ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper",
"created_at": "1539614680.3025355",
"enqueued_at": "1539617606.9180486",
"error_class": "ArgumentError",
"error_message": "wrong number of arguments (given 1, expected 0)",
"failed_at": "1539614680.3152027",
"jid": "88009ea307456e89d6049ceb",
"queue": "staging_searchkick",
"retried_at": "1539616160.852264",
"retry": true,
"retry_count": "6"
},
"jobstr": "{\"class\":\"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper\",\"queue\":\"staging_searchkick\",\"args\":[{\"job_class\":\"Searchkick::ProcessQueueJob\",\"job_id\":\"e7538b38-6051-4393-8369-bbc096e9c6d2\",\"queue_name\":\"staging_searchkick\",\"arguments\":[{\"class_name\":\"Accession\"}]}],\"retry\":true,\"jid\":\"88009ea307456e89d6049ceb\",\"created_at\":1539614680.3025355,\"enqueued_at\":1539617606.9180486,\"error_message\":\"wrong number of arguments (given 1, expected 0)\",\"error_class\":\"ArgumentError\",\"failed_at\":1539614680.3152027,\"retry_count\":6,\"retried_at\":1539616160.852264}",
"thread": {
"fiber_variables": {
"ActiveSupport::Notifications::InstrumentationRegistry": "#<ActiveSupport::Notifications::InstrumentationRegistry:0x0000000ff21f70>",
"ActiveSupport::SubscriberQueueRegistry": "#<ActiveSupport::SubscriberQueueRegistry:0x0000000ff21d90>",
"activesupport_tagged_logging_tags": [],
"current-60201360-count": "1",
"i18n_config": "#<I18n::Config:0x0000000ff22df8>",
"sidekiq_context": [],
"sidekiq_label": "processor",
"sidekiq_tid": "ox9ov4xrc"
},
"group": [
"#<Thread:0x000000023da1b0 sleep>",
"#<Thread:0x0000000f755080@/home/deploy/rails/magnet/shared/bundle/ruby/2.3.0/gems/sidekiq-5.2.1/lib/sidekiq/util.rb:23 sleep>",
"#<Thread:0x0000000f754ef0@/home/deploy/rails/magnet/shared/bundle/ruby/2.3.0/gems/sidekiq-5.2.1/lib/sidekiq/util.rb:23 sleep>",
"#<Thread:0x0000000eb4de90@/home/deploy/rails/magnet/shared/bundle/ruby/2.3.0/gems/sidekiq-5.2.1/lib/sidekiq/util.rb:23 sleep>",
"#<Thread:0x0000000e3e8998@/home/deploy/rails/magnet/shared/bundle/ruby/2.3.0/gems/mongo-2.6.2/lib/mongo/server/monitor.rb:136 sleep>",
"#<Thread:0x007fe668223ac0@/home/deploy/rails/magnet/shared/bundle/ruby/2.3.0/gems/mongo-2.6.2/lib/mongo/server/monitor.rb:136 sleep>",
"#<Thread:0x007fe6682234f8@/home/deploy/rails/magnet/shared/bundle/ruby/2.3.0/gems/mongo-2.6.2/lib/mongo/server/monitor.rb:136 sleep>",
"#<Thread:0x007fe6682226c0@/home/deploy/rails/magnet/shared/bundle/ruby/2.3.0/gems/mongo-2.6.2/lib/mongo/cluster/periodic_executor.rb:97 sleep>",
"#<Thread:0x007fe658090538@/home/deploy/rails/magnet/shared/bundle/ruby/2.3.0/gems/mongo-2.6.2/lib/mongo/server/monitor.rb:136 sleep>",
"#<Thread:0x0000000e3b3a90@/home/deploy/rails/magnet/shared/bundle/ruby/2.3.0/gems/mongo-2.6.2/lib/mongo/server/monitor.rb:136 sleep>",
"#<Thread:0x0000000e3b31f8@/home/deploy/rails/magnet/shared/bundle/ruby/2.3.0/gems/mongo-2.6.2/lib/mongo/server/monitor.rb:136 sleep>",
"#<Thread:0x0000000e3b1a10@/home/deploy/rails/magnet/shared/bundle/ruby/2.3.0/gems/mongo-2.6.2/lib/mongo/cluster/periodic_executor.rb:97 sleep>",
"#<Thread:0x007fe66426f708@/home/deploy/rails/magnet/shared/bundle/ruby/2.3.0/gems/sidekiq-5.2.1/lib/sidekiq/util.rb:23 run>",
"#<Thread:0x007fe6646ad310@/home/deploy/rails/magnet/shared/bundle/ruby/2.3.0/gems/sidekiq-5.2.1/lib/sidekiq/util.rb:23 sleep>"
],
"priority": "0",
"safe_level": "0",
"self": "#<Thread:0x007fe66426f708@/home/deploy/rails/magnet/shared/bundle/ruby/2.3.0/gems/sidekiq-5.2.1/lib/sidekiq/util.rb:23 run>"
}
}
It seems like something is interfering with keyword arguments in jobs. Are you able to create a background job in your app that uses them? ActiveJob should support keyword arguments as of Rails 4.2.1: https://github.com/rails/rails/issues/18741
Hey, @ankane , it did resolve the problem by removing the gem. I have been observing for a whole day.
I think the reason why it seemed it didn't fix it immediately after removing is that there are still some incorrect jobs being executed at the moment. My bad.
Thanks a lot! It really saves me a lot of time.
👍
Hi searchkick team, I am facing two weird problems after making one of my model to reindex using queuing.
I use sidekiq-cron to call
Searchkick::ProcessQueueJob.perform_later(class_name: "MyModel")
periodically with an activejob.Reindexing MyModel with queueing throws
ArgumentError: wrong number of arguments (given 1, expected 0)
:My other model are still using async to reindex, and the job throws
ArgumentError: wrong number of arguments (given 4, expected 2..3)
Here is my Gemfile.lock: