aws-cfn-resource-bridge icon indicating copy to clipboard operation
aws-cfn-resource-bridge copied to clipboard

remove extra check for non-existant messages array in aws response

Open Jason-Crowe opened this issue 9 years ago • 2 comments

we found that the latest aws sqs api does not return an empty Messages[] block when there are no messages in the queue. instead it returns no message body with http response code 200. we were getting errors in the log as such: 2015-04-02 21:22:37,574 [ERROR] Failed to retrieve messages from queue https://sqs.us-east-1.amazonaws.com/01234567890/AbcQueue-1ABCDEFQ with status_code 200: {'ResponseMetadata': {'HTTPStatusCode': 200, 'RequestId': '3b3ca2a8-5f14-5ac1-8b1f-ef3fea5dc376'}}

we validated the differences by querying via the aws cli v1.1.0: AWS_DEFAULT_REGION=us-east-1 aws sqs receive-message --queue-url https://sqs.us-east-1.amazonaws.com/01234567890/AbcQueue-1ABCDEFQ --wait-time-seconds 2 --max-number-of-messages 1 --output json {
"Messages": [] }

for comparison here is part of the debug response from the latest aws cli (v1.7.18): AWS_DEFAULT_REGION=us-east-1 aws sqs receive-message --queue-url https://sqs.us-east-1.amazonaws.com/01234567890/AbcQueue-1ABCDEFQ --wait-time-seconds 2 --max-number-of-messages 1 --output json --debug ... 2015-04-03 22:52:55,722 - MainThread - botocore.parsers - DEBUG - Response body:

99c90e95-aa76-5c97-9983-430cb6736cf6

...

our propsed change is just to remove the additional check, the code should proceed normally and return an empty result.

Jason-Crowe avatar Apr 03 '15 22:04 Jason-Crowe

+1

edsplunk avatar Aug 07 '15 18:08 edsplunk

This project has been archived. Please use CloudFormation’s native support for Custom Resources as documented at https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html

hyandell avatar Feb 01 '18 20:02 hyandell