SQS worker errors our when Rejected
See original GitHub issueI get the following error when I raise a Reject exception
‘str’ object has no attribute ‘headers’
full stacktrace:
[2021-07-22 16:01:04,309: CRITICAL/MainProcess] Unrecoverable error: AttributeError("'str' object has no attribute 'headers'")
Traceback (most recent call last):
File "/home/shreyas/.local/share/virtualenvs/inai-backend-mwrd66wz/lib/python3.8/site-packages/celery/worker/worker.py", line 203, in start
self.blueprint.start(self)
File "/home/shreyas/.local/share/virtualenvs/inai-backend-mwrd66wz/lib/python3.8/site-packages/celery/bootsteps.py", line 116, in start
step.start(parent)
File "/home/shreyas/.local/share/virtualenvs/inai-backend-mwrd66wz/lib/python3.8/site-packages/celery/bootsteps.py", line 365, in start
return self.obj.start()
File "/home/shreyas/.local/share/virtualenvs/inai-backend-mwrd66wz/lib/python3.8/site-packages/celery/worker/consumer/consumer.py", line 326, in start
blueprint.start(self)
File "/home/shreyas/.local/share/virtualenvs/inai-backend-mwrd66wz/lib/python3.8/site-packages/celery/bootsteps.py", line 116, in start
step.start(parent)
File "/home/shreyas/.local/share/virtualenvs/inai-backend-mwrd66wz/lib/python3.8/site-packages/celery/worker/consumer/consumer.py", line 618, in start
c.loop(*c.loop_args())
File "/home/shreyas/.local/share/virtualenvs/inai-backend-mwrd66wz/lib/python3.8/site-packages/celery/worker/loops.py", line 81, in asynloop
next(loop)
File "/home/shreyas/.local/share/virtualenvs/inai-backend-mwrd66wz/lib/python3.8/site-packages/kombu/asynchronous/hub.py", line 298, in create_loop
item()
File "/home/shreyas/.local/share/virtualenvs/inai-backend-mwrd66wz/lib/python3.8/site-packages/vine/promises.py", line 160, in __call__
return self.throw()
File "/home/shreyas/.local/share/virtualenvs/inai-backend-mwrd66wz/lib/python3.8/site-packages/vine/promises.py", line 157, in __call__
retval = fun(*final_args, **final_kwargs)
File "/home/shreyas/.local/share/virtualenvs/inai-backend-mwrd66wz/lib/python3.8/site-packages/kombu/message.py", line 135, in reject_log_error
self.reject(requeue=requeue)
File "/home/shreyas/.local/share/virtualenvs/inai-backend-mwrd66wz/lib/python3.8/site-packages/kombu/message.py", line 156, in reject
self.channel.basic_reject(self.delivery_tag, requeue=requeue)
File "/home/shreyas/.local/share/virtualenvs/inai-backend-mwrd66wz/lib/python3.8/site-packages/kombu/transport/virtual/base.py", line 671, in basic_reject
self.qos.reject(delivery_tag, requeue=requeue)
File "/home/shreyas/.local/share/virtualenvs/inai-backend-mwrd66wz/lib/python3.8/site-packages/kombu/transport/SQS.py", line 179, in reject
self.apply_backoff_policy(
File "/home/shreyas/.local/share/virtualenvs/inai-backend-mwrd66wz/lib/python3.8/site-packages/kombu/transport/SQS.py", line 199, in apply_backoff_policy
self.extract_task_name_and_number_of_retries(delivery_tag)
File "/home/shreyas/.local/share/virtualenvs/inai-backend-mwrd66wz/lib/python3.8/site-packages/kombu/transport/SQS.py", line 213, in extract_task_name_and_number_of_retries
message_headers = message.headers
AttributeError: 'str' object has no attribute 'headers'
When I fetched the actual message from SQS I found that some of the attributes were missing in the delivery tag. However in this case it fails even before it reaches that part.
Please help.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Troubleshoot AccessDenied errors on Amazon SQS API calls
“An error occurred (AccessDenied ) when calling the SendMessage operation: Access to the resource https://sqs.us-east-1.amazonaws.com/ is denied.
Read more >Reject doesn't un-ack SQS messages · Issue #697 - GitHub
The Reject documentation states: For inputs that support propagating nacks upstream such as AMQP or NATS the message will be nacked.
Read more >5 Common Amazon SQS Issues - Dashbird
5 Common Amazon SQS Issues · 1. Java SDK – Cannot Receive Message Attributes · 2. SNS Topic Not Publishing to SQS ·...
Read more >Amazon SQS Access Denied Exception - AWS re:Post
I am trying to send messages to an SQS queue. ... The tests run fine locally but in my dev environment, I am...
Read more >Amazon ElasticBeanStalk Worker Tier cannot connect to SQS
Oddly enough, a plain vanilla Worker-Tier with a sample Queue also get these access denied errors. – Pepster. Jul 22, 2014 at 4:59....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is now fixed! Thanks for the bug report.
We’d gladly accept a contribution to fix this issue.