SQS polling fails with Signature expired after a while
See original GitHub issueHi. My entire python code:
#!/usr/bin/env python3
import boto3
sqs = boto3.resource('sqs')
queue = sqs.get_queue_by_name(QueueName='my-queue-name')
print(queue.url)
while True:
for message in queue.receive_messages(WaitTimeSeconds=20):
print(message.body)
message.delete()
At first it works beautifully:
{"Service":"Amazon S3","Event":"s3:TestEvent","Time":"2015-07-23T08:20:16.700Z","Bucket":"my-bucket","RequestId":"1A77AE35967318B6","HostId":"Y3X<shortened>kK2"}
After a while it fails and cannot be started again with same credentials.
Traceback (most recent call last):
File "./app.py", line 6, in <module>
queue = sqs.get_queue_by_name(QueueName='my-queue-name')
File "/usr/local/lib/python3.4/site-packages/boto3/resources/factory.py", line 343, in do_action
response = action(self, *args, **kwargs)
File "/usr/local/lib/python3.4/site-packages/boto3/resources/action.py", line 77, in __call__
response = getattr(parent.meta.client, operation_name)(**params)
File "/usr/local/lib/python3.4/site-packages/botocore/client.py", line 269, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/local/lib/python3.4/site-packages/botocore/client.py", line 323, in _make_api_call
raise ClientError(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (SignatureDoesNotMatch) when calling the GetQueueUrl operation: Signature expired: 20150723T103511Z is now earlier than 20150723T130218Z (20150723T131718Z - 15 min.)
This is right from the tutorial at http://boto3.readthedocs.org/en/latest/guide/sqs.html#processing-messages
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
ReceiveMessage - Amazon Simple Queue Service
Retrieves one or more messages (up to 10), from the specified queue. Using the WaitTimeSeconds parameter enables long-poll support.
Read more >AWS API gateway error: "message": "Signature expired ...
Everything works fine from inside API gateway's test method but when I access the API from Postman, I get the following error "message":...
Read more >receive-message — AWS CLI 2.9.6 Command Reference
Retrieves one or more messages (up to 10), from the specified queue. Using the WaitTimeSeconds parameter enables long-poll support. For more information, see ......
Read more >AWS Simple Queue Service (SQS) - Apache Camel
Name Description Default
amazonAWSHost (common) The hostname of the Amazon AWS cloud. amazonaws.com
amazonSQSClient (common) Autowired To use the AmazonSQS as client.
autoCreateQueue (common) Setting the...
Read more >Amazon SQS Connector 5.11 Reference - Mule 4
Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.
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
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
docker restart solved this issue for me
Hi. It is a quite obscure situation since I was running boto code in a docker container running in a boot2docker VM using Virtualbox on Mac OSX on a laptop which went to sleep. It’s really hard to know what combination went wrong here, so let’s close this ticket.