I use Sidekiq to manage jobs using the Rails APP. I would like to know how you get the arguments of failed jobs (identifiers, objects, error message, etc.)? In WebUI, all you get is nr failed jobs. And if I understand correctly, the default value is to add up all the time when this task failed. I deployed my application and it works on several workers. It is difficult to go through each employee and try to find out, especially if you have sidekiq.log that is many days old.
I am looking for an answer here and on the Internet. One of the closest was described on the following links.
How to find a list of failed jobs in sidekiq?
This allows you to find out how many unsuccessful tasks I have during a certain period of time. However, I still do not know how to find out how the work ended and why.
Basically, I would like to somehow collect job_ids ids and periodically check which ones were unsuccessful, or, if there is an easier way, just query Sidekiq / Redis and see what arguments and errors of unsuccessful jobs are.
I also visited this link: Get error message from Sidekiq job
Here is an example of the work that I use
class ClassificationJob < ActiveJob::Base queue_as :default def perform(entity) entity.preprocess! entity.classify! end end
I tried to change this
class ClassificationJob < ActiveJob::Base queue_as :default def perform(entity) entity.preprocess! entity.classify! store entity_id: entity.id.to_s entity_id = retrieve :entity_id end end
But this leads to the following error:
ArgumentError: You cannot include Sidekiq::Worker in an ActiveJob: ClassificationJob
Thanks,
Yannik
source share