boto / botocore

The low-level, core functionality of boto3 and the AWS CLI.
Apache License 2.0
1.44k stars 1.06k forks source link

sqs create_queue does not return `QueueUrl` since v1.34.90 #3169

Closed zodiac403 closed 2 months ago

zodiac403 commented 2 months ago

Describe the bug

Sample code to reproduce the issue:]

sqs = boto3.client("sqs")
queue = sqs.create_queue(QueueName="name.fifo", Attributes={"FifoQueue": "true"})
queue_url = queue["QueueUrl"]

According to boto docs, create_queue() should return a dict like { 'QueueUrl': 'string' } https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sqs/client/create_queue.html

With version botocore==1.34.89 this is still the behavior I can observe

Expected Behavior

Resolve URL with queue_url = queue["QueueUrl"]

Current Behavior

queue_url = queue["QueueUrl"] results in a KeyError as the the result of create_queue() does not have an entry "QueueUrl".

Reproduction Steps

Code sample above

Possible Solution

No response

Additional Information/Context

No response

SDK version used

Observed the issue in 1.34.90, could not reproduce the issue in 1.34.89

Environment details (OS name and version, etc.)

MacOs Sonoma 14.4

tim-finnigan commented 2 months ago

Hi @zodiac403 thanks for reaching out. There was a recent change in 1.34.90 related to SQS:

  • api-change:sqs: This release enables customers to call SQS using AWS JSON-1.0 protocol

However, the response syntax should be the same. I just tested your snippet in both 1.34.89 and 1.34.90 and confirmed that QueueUrl was returned as expected. Are you by chance using moto or some other third-party package? If so please try updating to see if that resolves the issue.

It looks like in moto version 4.2.10 is where support for the SQS change was added.

zodiac403 commented 2 months ago

Hi @tim-finnigan ,

thanks for the very quick response. I will check that out on my side.

github-actions[bot] commented 2 months ago

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.

zodiac403 commented 2 months ago

Hi @tim-finnigan ,

indeed, there was moto pinned to an old version in this project. Appreciate your support here!

vbhjckfd commented 3 weeks ago

I have same error, although no moto package installed. 1.34.89 works good, 90+ returns no QueueUrl in response I had to pin botocore==1.34.89 😢