I am using Sidekiq for job management with a Rails APP. I would like to know how do you get the arguments of the failed jobs (Ids, Objects, error message, etc...)? On the WebUI, all you get is the nr of failed jobs. And if I understand correctly, the default is to add up all the times a given job failed. I have deployed my app and it is running on several workers. It is difficult to have to go over every single worker and try to find out, especially when you have a sidekiq.log that is many days old.
I search for an answer here and on the web. One of the closest was described on the folowing links.
How to find failed jobs list in sidekiq?
This allows to find out how many failed jobs I have over a period of time. However, I still do not know how to know exaclty what job failed and why.
Basically, I would like to somehow collect the job_ids and check periodically which ones have failed or if there is an easier way, just query Sidekiq/Redis and see what are the arguments and errors of the failed jobs.
I also visited this link: Get error message out of Sidekiq job
Here is an example job I am using
class ClassificationJob < ActiveJob::Base
queue_as :default
def perform(entity)
entity.preprocess!
entity.classify!
end
end
I tried to modify to 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 it spits the following error:
ArgumentError: You cannot include Sidekiq::Worker in an ActiveJob: ClassificationJob
Thanks,
Yannick