question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SQS polling fails with Signature expired after a while

See original GitHub issue

Hi. 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:closed
  • Created 8 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Vasile-Ciornacommented, Mar 3, 2020

docker restart solved this issue for me

1reaction
stanislavbcommented, Jul 29, 2015

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found