airflow: Latest Botocore breaks SQS tests
Body
Our tests are broken in main due to latest botocore failing SQS tests.
Example here: https://github.com/apache/airflow/actions/runs/4887737387/jobs/8724954226
E botocore.exceptions.ClientError: An error occurred (400) when calling the SendMessage operation:
<ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><Error><Type>Sender</Type>
<Code>AWS.SimpleQueueService.NonExistentQueue</Code><Message>The specified queue does not exist for this wsdl version.</Message><Detail/></Error>
<RequestId>ETDUP0OoJOXmn0WS6yWmB0dOhgYtpdVJCVwFWA28lYLKLmGJLAGu</RequestId></ErrorResponse>
The problem seems to come from botocore not recognizing just added queue:
QUEUE_NAME = "test-queue"
QUEUE_URL = f"https://{QUEUE_NAME}"
Even if we replace it with the full queue name that gets returned by the “create_queue” API call to moto
, it still does not work with latest botocore:
QUEUE_URL = f"https://sqs.us-east-1.amazonaws.com/123456789012/{QUEUE_NAME}"
Which indicates this likely a real botocore issue.
How to reproduce:
- Get working venv with
[amazon]
extra of Airlow (or breeze). Should be (when constraints from main are used):
root@b0c430d9a328:/opt/airflow# pip list | grep botocore
aiobotocore 2.5.0
botocore 1.29.76
pip uninstall aiobotocore
pip install --upgrade botocore
root@b0c430d9a328:/opt/airflow# pip list | grep botocore
botocore 1.29.127
pytest tests/providers/amazon/aws/sensors/test_sqs.py
Result:
===== 4 failed, 7 passed in 2.43s ===
Comparing it to “success case”:
When you run it breeze (with the current constrained botocore):
root@b0c430d9a328:/opt/airflow# pip list | grep botocore
aiobotocore 2.5.0
botocore 1.29.76
1, pytest tests/providers/amazon/aws/sensors/test_sqs.py
Result:
============ 11 passed in 4.57s =======
Committer
- I acknowledge that I am a maintainer/committer of the Apache Airflow project.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 17 (16 by maintainers)
Commits related to this issue
- Revert "Temporarily limit botocore upgrades (#31098)" This reverts commit a6be96d92828a86e982b53646a9e2eeca00a5463. Fixes: #31087 — committed to potiuk/airflow by potiuk a year ago
- Revert "Temporarily limit botocore upgrades (#31098)" (#31103) This reverts commit a6be96d92828a86e982b53646a9e2eeca00a5463. Fixes: #31087 — committed to apache/airflow by potiuk a year ago
There is a new version of botocore 1.29.128 that resolves the issue.
PR reverting the workaround: https://github.com/apache/airflow/pull/31103
Those steps reproducibly failed for me @o-nikolas 😄… Maybe it is “if in amazon = works” 😄
I am subscribing to the issues to get notified when they are fixed
I separated now those two “fail/pass” scenario more visibly 😃
Actually looks like it’s just the new botocore does not play well with moto - https://github.com/boto/botocore/issues/2930 so it’s not as bad (for AWS).