Sidekiq Rails 4.2 Use Active Job or Worker? What’s the difference

Short answer is they are the same thing. ActiveJob calls it a Job whereas Sidekiq calls it a Worker. I’ve decided to keep the terminology different so that people can distinguish the two. You can use either one. Note that ActiveJob does not provide access to the full set of Sidekiq options so if you … Read more

Redis raises “NOAUTH Authentication required” error but there is no password setting

We also faced a similar issue. Looks like someone scanned AWS, connected to all public redis servers, and possibly ran “CONFIG SET REQUIREPASS ””, thus locking down the running instance of redis. Once you restart redis, the config is restored to normal. Best thing would be to use AWS security group policy and block port … Read more

how to delete a job in sidekiq

According to this Sidekiq documentation page to delete a job with a single id you need to iterate the queue and call .delete on it. queue = Sidekiq::Queue.new(“mailer”) queue.each do |job| job.klass # => ‘MyWorker’ job.args # => [1, 2, 3] job.delete if job.jid == ‘abcdef1234567890’ end There is also a plugin called sidekiq-status that … Read more

How do I reset my sidekiq counters?

To reset statistics: Sidekiq::Stats.new.reset ref: Add reset stats to Web UI summary box and method to API Also, you can now clear specific stats: single stat by Sidekiq::Stats.new.reset(‘failed’) or multiple stats by Sidekiq::Stats.new.reset(‘failed’, ‘processed’) (Thanks https://stackoverflow.com/users/2475008/tmr08c for update)

How can I password-protect my /sidekiq route (i.e. require authentication for the Sidekiq::Web tool)?

Put the following into your sidekiq initializer require ‘sidekiq’ require ‘sidekiq/web’ Sidekiq::Web.use(Rack::Auth::Basic) do |user, password| # Protect against timing attacks: # – See https://codahale.com/a-lesson-in-timing-attacks/ # – See https://thisdata.com/blog/timing-attacks-against-string-comparison/ # – Use & (do not use &&) so that it doesn’t short circuit. # – Use digests to stop length information leaking Rack::Utils.secure_compare(::Digest::SHA256.hexdigest(user), ::Digest::SHA256.hexdigest(ENV[“SIDEKIQ_USER”])) & Rack::Utils.secure_compare(::Digest::SHA256.hexdigest(password), … Read more

Sidekiq not processing queue

The reason was in our case: Sidekiq may look for the wrong queue. By default Sidekiq uses a queue named “default”. We used two different queue names, and defined them in config/sidekiq.yml # configuration file for Sidekiq :queues: – queue_name_1 – queue_name_2 The problem is that this config file is not automatically loaded by default … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)