Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post Ruby and Rails upgrade: Shoryuken worker polling shows no messages even when messages are present in SQS queue #766

Open
avinash8200 opened this issue May 5, 2024 · 7 comments

Comments

@avinash8200
Copy link

Hi Team,
Post upgrading my Ruby from 3.0.4 to 3.3.0 and Rails from 7.0.8 to 7.1.3.2, Shoryuken gem version is same 6.0.0, SQS Workers are not processing any messages in the queue, even when messages are present in the queue.

Upon checking the shoryuken verbose mode, I can see it's triggerring dispatch about , seems like it couldn't find any messages in the queue:

2024-05-05T13:46:51Z 80 TID-5r94 DEBUG: Looking for new messages in sqs_queue_name 
2024-05-05T13:47:11Z 80 TID-5r94 DEBUG: Fetcher for sqs_queue_name completed in 20008.652933 ms 
2024-05-05T13:47:11Z 80 TID-5r94 DEBUG: Paused sqs_queue_name 
2024-05-05T13:47:11Z 80 TID-5r80 DEBUG: Unpaused sqs_queue_name 
2024-05-05T13:47:11Z 80 TID-5r80 DEBUG: Firing 'dispatch' lifecycle event 
2024-05-05T13:47:11Z 80 TID-5r80 DEBUG: Ready: 16, Busy: 0, Active Queues: [["sqs_queue_name", 1], ["sqs_queue_name-2", 1]] 

I've checked an other post which suggests to use long polling, I've tried that as well, but it didn't work.
This is my shoryuken.rb file

# frozen_string_literal: true

require 'shoryuken_custom_registry'
Shoryuken.configure_server do |config|
  config.sqs_client = Aws::SQS::Client.new(log_level: :debug)

  # Middleware Configs
  config.server_middleware do |chain|
    chain.add ClearWorkerThreadVariables
  end
end

Shoryuken.workerq_registry = ShoryukenCustomRegistry.new

I've tried with AWS CLI that my worker is able to connect to SQS and send and receive messages and when i downgrade the versions, it is working.

Can you please help me point in the direction where i should debug more?

@davidrichey
Copy link
Contributor

@avinash8200 I have ran into the same issue. I haven't figured out the root cause but I have determined that bumping the aws-sdk-core was part of the issue.

Downgrading to aws-sdk-core (3.191.6) seems to have fixed the issue

@avinash8200
Copy link
Author

@davidrichey I've tried the above, I'm still facing the same, shoryuken is not processing the messages.

@davidrichey
Copy link
Contributor

@avinash8200 could you post your shoryuken versions as well as the aws gem versions you are using?

FWIW, I debugged my situation from utilizing the SQS UI to view that a message was sent and added pry's in the queue to confirm I wasn't receiving any messages.

@avinash8200
Copy link
Author

@davidrichey
Shoryuken version: 6.0.0
aws-sdk-rails: 3.1.0
aws-sdk-sqs: 1.26.0
aws-sdk-core: 3.191.6

Yeah, I have verified in SQS dashboard and polled from aws cli to check if messages are present in SQS queue and they are present. I have enabled verbose while starting shoryuken and from logs i can see that shoryuken is not receiving it.

@davidrichey
Copy link
Contributor

Not sure this will help but here is what we are running:

aws-sdk-core (3.191.6)
aws-sdk-sqs (1.44.0)
shoryuken (5.3.2)

@avinash8200
Copy link
Author

avinash8200 commented May 9, 2024

Let me once try that, thanks for the help and time, David.

Update: Tried above, still the issue persists.

@JosueMerlos
Copy link

I ran into the same problem and found that one of the causes is that it is not getting the list of available queues.

Shoryuken::Client.sqs.list_queues

This should return the list of queues, but the answer is:

#<struct Aws::SQS::Types::ListQueuesResult queue_urls=[], next_token=nil>

At the moment I am using a version lower than (3.191.6) in aws-sdk-core where this still works fine.

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

No branches or pull requests

3 participants