Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

Status from job_id is empty #138

Open
KapustaB opened this issue Aug 14, 2018 · 5 comments
Open

Status from job_id is empty #138

KapustaB opened this issue Aug 14, 2018 · 5 comments

Comments

@KapustaB
Copy link

KapustaB commented Aug 14, 2018

Redis is up and running. Background process is working normal. On web monitor job is visible but statuses empty.
With simple sidekiq-status functions from docs I'm geting nil, empty or false results. Problem started when I changed my workstation to new one.

Please check my SO question about empty status for Sidekiq status in Redis.
#SO detailed question

Using:

  1. Ruby 2.5.1
  2. Rails 5.1.6
  3. Redis 4.0.1
  4. Sidekiq 5.1.3
  5. Sidekiq-status 1.0.2
@youjiuzidangge
Copy link

actually, ActiveJob has its own Job ID which means nothing to Sidekiq. As of Rails 5 you can get Sidekiq's JID by using provider_job_id.
you can check here:
https://github.com/mperham/sidekiq/wiki/Active-Job

@mayuresh-srivastava
Copy link

mayuresh-srivastava commented Nov 29, 2018

@youjiuzidangge Ok. But what in case of worker? I am not using Active Job. I am using workers and getting same issue.

@KapustaB Did you find any solution for it?

@ghost
Copy link

ghost commented Mar 5, 2019

Same issue here.

Ruby 2.6.1
Rails 5.1.6
Sidekiq 5.2.5
Sidekiq-status 1.1.1

Have tried as both ActiveJob implementation and just barebones Sidekiq, neither works. Have followed all of the wiki documentation. Jobs are queueing and running fine, but status is always nil.

Additionally, I've enabled the Sidekiq status web view, and nothing displays when jobs are queued/running.

--- Update: It appears the status worker does not honor the queue prefix, so everything is going into 'default' instead of my app prefix + '_default'. Removing my configured prefix for now and sending everything to default at least gets the web view to display statuses, however, now the status is always "queued" (even on the web page):

127.0.0.1:6379> hgetall "sidekiq:status:7a68ae1bcf949b3e96c36c12"

  1. "update_time"
  2. "1551807581"
  3. "jid"
  4. "7a68ae1bcf949b3e96c36c12"
  5. "status"
  6. "queued"
  7. "worker"
  8. "ReleaseNotesJob"
  9. "args"
  10. ""

@github0013
Copy link

@jenjenut233

For your case, where the status remained queued the whole time, is maybe your wrong config initializer.

Check if you follow the Readme

require 'sidekiq'
require 'sidekiq-status'

Sidekiq.configure_client do |config|
  # is this in configure_server?
  Sidekiq::Status.configure_client_middleware config, expiration: 30.minutes
end

Sidekiq.configure_server do |config|
  # is this in configure_server?
  Sidekiq::Status.configure_server_middleware config, expiration: 30.minutes

  # is this in configure_server?
  Sidekiq::Status.configure_client_middleware config, expiration: 30.minutes
end

@KapustaB
Copy link
Author

@mayureshmayur Unfortunately no, on the end I saved sidekiq status in the database. I didn't need a high-performance solution.

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

No branches or pull requests

4 participants