-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add NotFound retries when tagging a new RouteTable #616
Merged
ansible-zuul
merged 3 commits into
ansible-collections:main
from
tremble:stability/tags/ec2_vpc_route_table
Jun 29, 2021
Merged
Add NotFound retries when tagging a new RouteTable #616
ansible-zuul
merged 3 commits into
ansible-collections:main
from
tremble:stability/tags/ec2_vpc_route_table
Jun 29, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ansibullbot
added
bug
This issue/PR relates to a bug
community_review
module
module
needs_triage
owner_pr
PR created by owner/maintainer
plugins
plugin (any type)
python3
traceback
labels
Jun 29, 2021
tremble
force-pushed
the
stability/tags/ec2_vpc_route_table
branch
from
June 29, 2021 14:16
667aa41
to
c298dca
Compare
recheck |
jillr
approved these changes
Jun 29, 2021
alinabuzachis
approved these changes
Jun 29, 2021
Looks like ec2_vpc_endpoint also has the same issue, (hence the need for the recheck), I'll get something submitted once the migration to amazon.aws is completed |
alinabuzachis
pushed a commit
to alinabuzachis/community.aws
that referenced
this pull request
Jul 16, 2021
…bility/tags/ec2_vpc_route_table Add NotFound retries when tagging a new RouteTable SUMMARY Prior to botocore 1.17.24 it wasn't possible to tag the route tables as a part of the creation call. As such a separate create tags call is performed after the creation. However, Amazon being 'Eventually consistent" we sometimes see NotFound errors just after creating a route table. Rather than adding hard to test logic, add InvalidRouteTableID.NotFound retries. The tests for RouteTable existing uses its own decorator, we can safely retry on InvalidRouteTableID.NotFound Also move from custom tag handling code over to the shared code in ansible_collections.amazon.aws.plugins.module_utils.ec2 ISSUE TYPE Bugfix Pull Request COMPONENT NAME ec2_vpc_route_table ADDITIONAL INFORMATION TASK [ec2_vpc_endpoint : Create a minimal route table (with IGW)] ************** task path: /home/zuul/.ansible/collections/ansible_collections/community/aws/tests/integration/targets/ec2_vpc_endpoint/tasks/main.yml:54 <testhost> ESTABLISH LOCAL CONNECTION FOR USER: zuul <testhost> EXEC /bin/sh -c 'echo ~zuul && sleep 0' <testhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/zuul/.ansible/tmp `"&& mkdir "` echo /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036 `" && echo ansible-tmp-1624964310.5067005-7213-234903855964036="` echo /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036 `" ) && sleep 0' Using module file /home/zuul/.ansible/collections/ansible_collections/community/aws/plugins/modules/ec2_vpc_route_table.py <testhost> PUT /home/zuul/.ansible/tmp/ansible-local-7051vh18nelt/tmpdx500zwb TO /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036/AnsiballZ_ec2_vpc_route_table.py <testhost> EXEC /bin/sh -c 'chmod u+x /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036/ /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036/AnsiballZ_ec2_vpc_route_table.py && sleep 0' <testhost> EXEC /bin/sh -c 'ANSIBLE_DEBUG_BOTOCORE_LOGS=True /home/zuul/venv/bin/python3.6 /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036/AnsiballZ_ec2_vpc_route_table.py && sleep 0' <testhost> EXEC /bin/sh -c 'rm -f -r /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036/ > /dev/null 2>&1 && sleep 0' The full traceback is: Traceback (most recent call last): File "/tmp/ansible_ec2_vpc_route_table_payload_y_h0b0in/ansible_ec2_vpc_route_table_payload.zip/ansible_collections/community/aws/plugins/modules/ec2_vpc_route_table.py", line 380, in ensure_tags File "/tmp/ansible_ec2_vpc_route_table_payload_y_h0b0in/ansible_ec2_vpc_route_table_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/core.py", line 288, in deciding_wrapper return retrying_wrapper(*args, **kwargs) File "/tmp/ansible_ec2_vpc_route_table_payload_y_h0b0in/ansible_ec2_vpc_route_table_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/cloud.py", line 154, in retry_func raise e File "/tmp/ansible_ec2_vpc_route_table_payload_y_h0b0in/ansible_ec2_vpc_route_table_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/cloud.py", line 144, in retry_func return f(*args, **kwargs) File "/home/zuul/venv/lib/python3.6/site-packages/botocore/client.py", line 386, in _api_call return self._make_api_call(operation_name, kwargs) File "/home/zuul/venv/lib/python3.6/site-packages/botocore/client.py", line 705, in _make_api_call raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (InvalidRouteTableID.NotFound) when calling the CreateTags operation: The routeTable ID 'rtb-08ce2a0fac35f2cc3' does not exist fatal: [testhost]: FAILED! => { "boto3_version": "1.17.102", "botocore_version": "1.20.102", "changed": false, "error": { "code": "InvalidRouteTableID.NotFound", "message": "The routeTable ID 'rtb-08ce2a0fac35f2cc3' does not exist" }, "invocation": { "module_args": { "aws_access_key": "ASIA6CCDWXDOL3X5ZIJP", "aws_ca_bundle": null, "aws_config": null, "aws_secret_key": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "debug_botocore_endpoint_logs": true, "ec2_url": null, "lookup": "tag", "profile": null, "propagating_vgw_ids": null, "purge_routes": true, "purge_subnets": true, "purge_tags": false, "region": "us-east-1", "route_table_id": null, "routes": [ { "destination_cidr_block": "0.0.0.0/0", "gateway_id": "igw-0c6e113ca6c5d9a2c" } ], "security_token": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "state": "present", "subnets": [], "tags": { "AnsibleRun": "ansible-test-56393648-centos-8-1vcpu-vexxhost-ca-ymq-1-00016024", "AnsibleTest": "ec2_vpc_endpoint", "Name": "ansible-test-56393648-centos-8-1vcpu-vexxhost-ca-ymq-1-00016024-igw" }, "validate_certs": true, "vpc_id": "vpc-055d3d6ce9bec0dc3" } }, "msg": "Couldn't create tags: An error occurred (InvalidRouteTableID.NotFound) when calling the CreateTags operation: The routeTable ID 'rtb-08ce2a0fac35f2cc3' does not exist", "resource_actions": [ "ec2:CreateRouteTable", "ec2:CreateRoute", "ec2:CreateTags", "ec2:DescribeRouteTables", "ec2:DescribeTags" ], "response_metadata": { "http_headers": { "cache-control": "no-cache, no-store", "connection": "close", "content-type": "text/xml;charset=UTF-8", "date": "Tue, 29 Jun 2021 10:58:31 GMT", "server": "AmazonEC2", "strict-transport-security": "max-age=31536000; includeSubDomains", "transfer-encoding": "chunked", "vary": "accept-encoding", "x-amzn-requestid": "fbefb890-4384-4001-a374-cb13db9e0d6c" }, "http_status_code": 400, "request_id": "fbefb890-4384-4001-a374-cb13db9e0d6c", "retry_attempts": 0 } } Reviewed-by: Jill R <None> Reviewed-by: Alina Buzachis <None> This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections@a2bbdea
alinabuzachis
pushed a commit
to alinabuzachis/community.aws
that referenced
this pull request
Jul 19, 2021
…s/ec2_vpc_route_table Add NotFound retries when tagging a new RouteTable SUMMARY Prior to botocore 1.17.24 it wasn't possible to tag the route tables as a part of the creation call. As such a separate create tags call is performed after the creation. However, Amazon being 'Eventually consistent" we sometimes see NotFound errors just after creating a route table. Rather than adding hard to test logic, add InvalidRouteTableID.NotFound retries. The tests for RouteTable existing uses its own decorator, we can safely retry on InvalidRouteTableID.NotFound Also move from custom tag handling code over to the shared code in ansible_collections.amazon.aws.plugins.module_utils.ec2 ISSUE TYPE Bugfix Pull Request COMPONENT NAME ec2_vpc_route_table ADDITIONAL INFORMATION TASK [ec2_vpc_endpoint : Create a minimal route table (with IGW)] ************** task path: /home/zuul/.ansible/collections/ansible_collections/community/aws/tests/integration/targets/ec2_vpc_endpoint/tasks/main.yml:54 <testhost> ESTABLISH LOCAL CONNECTION FOR USER: zuul <testhost> EXEC /bin/sh -c 'echo ~zuul && sleep 0' <testhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/zuul/.ansible/tmp `"&& mkdir "` echo /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036 `" && echo ansible-tmp-1624964310.5067005-7213-234903855964036="` echo /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036 `" ) && sleep 0' Using module file /home/zuul/.ansible/collections/ansible_collections/community/aws/plugins/modules/ec2_vpc_route_table.py <testhost> PUT /home/zuul/.ansible/tmp/ansible-local-7051vh18nelt/tmpdx500zwb TO /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036/AnsiballZ_ec2_vpc_route_table.py <testhost> EXEC /bin/sh -c 'chmod u+x /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036/ /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036/AnsiballZ_ec2_vpc_route_table.py && sleep 0' <testhost> EXEC /bin/sh -c 'ANSIBLE_DEBUG_BOTOCORE_LOGS=True /home/zuul/venv/bin/python3.6 /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036/AnsiballZ_ec2_vpc_route_table.py && sleep 0' <testhost> EXEC /bin/sh -c 'rm -f -r /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036/ > /dev/null 2>&1 && sleep 0' The full traceback is: Traceback (most recent call last): File "/tmp/ansible_ec2_vpc_route_table_payload_y_h0b0in/ansible_ec2_vpc_route_table_payload.zip/ansible_collections/community/aws/plugins/modules/ec2_vpc_route_table.py", line 380, in ensure_tags File "/tmp/ansible_ec2_vpc_route_table_payload_y_h0b0in/ansible_ec2_vpc_route_table_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/core.py", line 288, in deciding_wrapper return retrying_wrapper(*args, **kwargs) File "/tmp/ansible_ec2_vpc_route_table_payload_y_h0b0in/ansible_ec2_vpc_route_table_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/cloud.py", line 154, in retry_func raise e File "/tmp/ansible_ec2_vpc_route_table_payload_y_h0b0in/ansible_ec2_vpc_route_table_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/cloud.py", line 144, in retry_func return f(*args, **kwargs) File "/home/zuul/venv/lib/python3.6/site-packages/botocore/client.py", line 386, in _api_call return self._make_api_call(operation_name, kwargs) File "/home/zuul/venv/lib/python3.6/site-packages/botocore/client.py", line 705, in _make_api_call raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (InvalidRouteTableID.NotFound) when calling the CreateTags operation: The routeTable ID 'rtb-08ce2a0fac35f2cc3' does not exist fatal: [testhost]: FAILED! => { "boto3_version": "1.17.102", "botocore_version": "1.20.102", "changed": false, "error": { "code": "InvalidRouteTableID.NotFound", "message": "The routeTable ID 'rtb-08ce2a0fac35f2cc3' does not exist" }, "invocation": { "module_args": { "aws_access_key": "ASIA6CCDWXDOL3X5ZIJP", "aws_ca_bundle": null, "aws_config": null, "aws_secret_key": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "debug_botocore_endpoint_logs": true, "ec2_url": null, "lookup": "tag", "profile": null, "propagating_vgw_ids": null, "purge_routes": true, "purge_subnets": true, "purge_tags": false, "region": "us-east-1", "route_table_id": null, "routes": [ { "destination_cidr_block": "0.0.0.0/0", "gateway_id": "igw-0c6e113ca6c5d9a2c" } ], "security_token": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "state": "present", "subnets": [], "tags": { "AnsibleRun": "ansible-test-56393648-centos-8-1vcpu-vexxhost-ca-ymq-1-00016024", "AnsibleTest": "ec2_vpc_endpoint", "Name": "ansible-test-56393648-centos-8-1vcpu-vexxhost-ca-ymq-1-00016024-igw" }, "validate_certs": true, "vpc_id": "vpc-055d3d6ce9bec0dc3" } }, "msg": "Couldn't create tags: An error occurred (InvalidRouteTableID.NotFound) when calling the CreateTags operation: The routeTable ID 'rtb-08ce2a0fac35f2cc3' does not exist", "resource_actions": [ "ec2:CreateRouteTable", "ec2:CreateRoute", "ec2:CreateTags", "ec2:DescribeRouteTables", "ec2:DescribeTags" ], "response_metadata": { "http_headers": { "cache-control": "no-cache, no-store", "connection": "close", "content-type": "text/xml;charset=UTF-8", "date": "Tue, 29 Jun 2021 10:58:31 GMT", "server": "AmazonEC2", "strict-transport-security": "max-age=31536000; includeSubDomains", "transfer-encoding": "chunked", "vary": "accept-encoding", "x-amzn-requestid": "fbefb890-4384-4001-a374-cb13db9e0d6c" }, "http_status_code": 400, "request_id": "fbefb890-4384-4001-a374-cb13db9e0d6c", "retry_attempts": 0 } } Reviewed-by: Jill R <None> Reviewed-by: Alina Buzachis <None>
alinabuzachis
pushed a commit
to alinabuzachis/community.aws
that referenced
this pull request
Jul 19, 2021
…s/ec2_vpc_route_table Add NotFound retries when tagging a new RouteTable SUMMARY Prior to botocore 1.17.24 it wasn't possible to tag the route tables as a part of the creation call. As such a separate create tags call is performed after the creation. However, Amazon being 'Eventually consistent" we sometimes see NotFound errors just after creating a route table. Rather than adding hard to test logic, add InvalidRouteTableID.NotFound retries. The tests for RouteTable existing uses its own decorator, we can safely retry on InvalidRouteTableID.NotFound Also move from custom tag handling code over to the shared code in ansible_collections.amazon.aws.plugins.module_utils.ec2 ISSUE TYPE Bugfix Pull Request COMPONENT NAME ec2_vpc_route_table ADDITIONAL INFORMATION TASK [ec2_vpc_endpoint : Create a minimal route table (with IGW)] ************** task path: /home/zuul/.ansible/collections/ansible_collections/community/aws/tests/integration/targets/ec2_vpc_endpoint/tasks/main.yml:54 <testhost> ESTABLISH LOCAL CONNECTION FOR USER: zuul <testhost> EXEC /bin/sh -c 'echo ~zuul && sleep 0' <testhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/zuul/.ansible/tmp `"&& mkdir "` echo /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036 `" && echo ansible-tmp-1624964310.5067005-7213-234903855964036="` echo /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036 `" ) && sleep 0' Using module file /home/zuul/.ansible/collections/ansible_collections/community/aws/plugins/modules/ec2_vpc_route_table.py <testhost> PUT /home/zuul/.ansible/tmp/ansible-local-7051vh18nelt/tmpdx500zwb TO /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036/AnsiballZ_ec2_vpc_route_table.py <testhost> EXEC /bin/sh -c 'chmod u+x /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036/ /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036/AnsiballZ_ec2_vpc_route_table.py && sleep 0' <testhost> EXEC /bin/sh -c 'ANSIBLE_DEBUG_BOTOCORE_LOGS=True /home/zuul/venv/bin/python3.6 /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036/AnsiballZ_ec2_vpc_route_table.py && sleep 0' <testhost> EXEC /bin/sh -c 'rm -f -r /home/zuul/.ansible/tmp/ansible-tmp-1624964310.5067005-7213-234903855964036/ > /dev/null 2>&1 && sleep 0' The full traceback is: Traceback (most recent call last): File "/tmp/ansible_ec2_vpc_route_table_payload_y_h0b0in/ansible_ec2_vpc_route_table_payload.zip/ansible_collections/community/aws/plugins/modules/ec2_vpc_route_table.py", line 380, in ensure_tags File "/tmp/ansible_ec2_vpc_route_table_payload_y_h0b0in/ansible_ec2_vpc_route_table_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/core.py", line 288, in deciding_wrapper return retrying_wrapper(*args, **kwargs) File "/tmp/ansible_ec2_vpc_route_table_payload_y_h0b0in/ansible_ec2_vpc_route_table_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/cloud.py", line 154, in retry_func raise e File "/tmp/ansible_ec2_vpc_route_table_payload_y_h0b0in/ansible_ec2_vpc_route_table_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/cloud.py", line 144, in retry_func return f(*args, **kwargs) File "/home/zuul/venv/lib/python3.6/site-packages/botocore/client.py", line 386, in _api_call return self._make_api_call(operation_name, kwargs) File "/home/zuul/venv/lib/python3.6/site-packages/botocore/client.py", line 705, in _make_api_call raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (InvalidRouteTableID.NotFound) when calling the CreateTags operation: The routeTable ID 'rtb-08ce2a0fac35f2cc3' does not exist fatal: [testhost]: FAILED! => { "boto3_version": "1.17.102", "botocore_version": "1.20.102", "changed": false, "error": { "code": "InvalidRouteTableID.NotFound", "message": "The routeTable ID 'rtb-08ce2a0fac35f2cc3' does not exist" }, "invocation": { "module_args": { "aws_access_key": "ASIA6CCDWXDOL3X5ZIJP", "aws_ca_bundle": null, "aws_config": null, "aws_secret_key": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "debug_botocore_endpoint_logs": true, "ec2_url": null, "lookup": "tag", "profile": null, "propagating_vgw_ids": null, "purge_routes": true, "purge_subnets": true, "purge_tags": false, "region": "us-east-1", "route_table_id": null, "routes": [ { "destination_cidr_block": "0.0.0.0/0", "gateway_id": "igw-0c6e113ca6c5d9a2c" } ], "security_token": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "state": "present", "subnets": [], "tags": { "AnsibleRun": "ansible-test-56393648-centos-8-1vcpu-vexxhost-ca-ymq-1-00016024", "AnsibleTest": "ec2_vpc_endpoint", "Name": "ansible-test-56393648-centos-8-1vcpu-vexxhost-ca-ymq-1-00016024-igw" }, "validate_certs": true, "vpc_id": "vpc-055d3d6ce9bec0dc3" } }, "msg": "Couldn't create tags: An error occurred (InvalidRouteTableID.NotFound) when calling the CreateTags operation: The routeTable ID 'rtb-08ce2a0fac35f2cc3' does not exist", "resource_actions": [ "ec2:CreateRouteTable", "ec2:CreateRoute", "ec2:CreateTags", "ec2:DescribeRouteTables", "ec2:DescribeTags" ], "response_metadata": { "http_headers": { "cache-control": "no-cache, no-store", "connection": "close", "content-type": "text/xml;charset=UTF-8", "date": "Tue, 29 Jun 2021 10:58:31 GMT", "server": "AmazonEC2", "strict-transport-security": "max-age=31536000; includeSubDomains", "transfer-encoding": "chunked", "vary": "accept-encoding", "x-amzn-requestid": "fbefb890-4384-4001-a374-cb13db9e0d6c" }, "http_status_code": 400, "request_id": "fbefb890-4384-4001-a374-cb13db9e0d6c", "retry_attempts": 0 } } Reviewed-by: Jill R <None> Reviewed-by: Alina Buzachis <None>
1 task
alinabuzachis
pushed a commit
to alinabuzachis/community.aws
that referenced
this pull request
May 25, 2022
ec2_key - support for ED25519 key type SUMMARY ec2_key - add support for ED25519 key type This parameter requires botocore>=1.21.23 ISSUE TYPE Feature Pull Request COMPONENT NAME ec2_key Reviewed-by: Mark Chappell <None> Reviewed-by: None <None> Reviewed-by: Alina Buzachis <None> Reviewed-by: None <None>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
Prior to botocore 1.17.24 it wasn't possible to tag the route tables as a part of the creation call. As such a separate create tags call is performed after the creation. However, Amazon being 'Eventually consistent" we sometimes see NotFound errors just after creating a route table.
Rather than adding hard to test logic, add InvalidRouteTableID.NotFound retries. The tests for RouteTable existing uses its own decorator, we can safely retry on InvalidRouteTableID.NotFound
Also move from custom tag handling code over to the shared code in ansible_collections.amazon.aws.plugins.module_utils.ec2
ISSUE TYPE
COMPONENT NAME
ec2_vpc_route_table
ADDITIONAL INFORMATION