Skip to content
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

Work on ec2_vpc_subnet related test flake #1848

Conversation

tremble
Copy link
Contributor

@tremble tremble commented Nov 13, 2023

SUMMARY

As with all things AWS there are no guarantees how fast things will be created. We currently have a hard coded delay of ~10 seconds to wait for the subnet to be created, while advertising a default timeout of 300s. If this 10s is exceeded, then we throw a 'NoneType' object is not subscriptable error (because we didn't check that the subnet was actually returned)

This moves a for-loop over to a waiter. The "waiter_handler" logic already makes sure we have a total waiting time matching the limits set, even if we wait for multiple things to happen)

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

ec2_vpc_subnet

ADDITIONAL INFORMATION
2023-11-13 07:08:17.514752 | controller | TASK [ec2_ami_tpm : create a subnet to use for creating an ec2 instance] *******
2023-11-13 07:08:17.514756 | controller | task path: /home/zuul-worker/.ansible/collections/ansible_collections/amazon/aws/tests/integration/targets/ec2_ami_tpm/tasks/main.yml:31
2023-11-13 07:08:29.688395 | controller | Using module file /home/zuul-worker/.ansible/collections/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py
2023-11-13 07:08:29.688433 | controller | Pipelining is enabled.
2023-11-13 07:08:29.688440 | controller | <testhost> ESTABLISH LOCAL CONNECTION FOR USER: zuul-worker
2023-11-13 07:08:29.688481 | controller | <testhost> EXEC /bin/sh -c 'ANSIBLE_DEBUG_BOTOCORE_LOGS=True /home/zuul-worker/venv/bin/python && sleep 0'
2023-11-13 07:08:29.688488 | controller | The full traceback is:
2023-11-13 07:08:29.688494 | controller | Traceback (most recent call last):
2023-11-13 07:08:29.688501 | controller |   File "<stdin>", line 121, in <module>
2023-11-13 07:08:29.688508 | controller |   File "<stdin>", line 113, in _ansiballz_main
2023-11-13 07:08:29.688514 | controller |   File "<stdin>", line 61, in invoke_module
2023-11-13 07:08:29.688520 | controller |   File "<frozen runpy>", line 226, in run_module
2023-11-13 07:08:29.688526 | controller |   File "<frozen runpy>", line 98, in _run_module_code
2023-11-13 07:08:29.688533 | controller |   File "<frozen runpy>", line 88, in _run_code
2023-11-13 07:08:29.688539 | controller |   File "/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py", line 584, in <module>
2023-11-13 07:08:29.688547 | controller |   File "/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py", line 574, in main
2023-11-13 07:08:29.688553 | controller |   File "/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py", line 491, in ensure_subnet_present
2023-11-13 07:08:29.688560 | controller |   File "/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py", line 501, in ensure_final_subnet
2023-11-13 07:08:29.688567 | controller | TypeError: 'NoneType' object is not subscriptable
2023-11-13 07:08:29.688572 | controller | fatal: [testhost]: FAILED! => {
2023-11-13 07:08:29.688579 | controller |     "changed": false,
2023-11-13 07:08:29.688587 | controller |     "module_stderr": "Traceback (most recent call last):\n  File \"<stdin>\", line 121, in <module>\n  File \"<stdin>\", line 113, in _ansiballz_main\n  File \"<stdin>\", line 61, in invoke_module\n  File \"<frozen runpy>\", line 226, in run_module\n  File \"<frozen runpy>\", line 98, in _run_module_code\n  File \"<frozen runpy>\", line 88, in _run_code\n  File \"/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py\", line 584, in <module>\n  File \"/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py\", line 574, in main\n  File \"/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py\", line 491, in ensure_subnet_present\n  File \"/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py\", line 501, in ensure_final_subnet\nTypeError: 'NoneType' object is not subscriptable\n",
2023-11-13 07:08:29.688599 | controller |     "module_stdout": "",
2023-11-13 07:08:29.688607 | controller |     "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
2023-11-13 07:08:29.688614 | controller |     "rc": 1
2023-11-13 07:08:29.688620 | controller | }

See also:
https://1c9f147019056ec08967-4a68a93a4e95f691374839dd8e3d025a.ssl.cf2.rackcdn.com/1846/7ae4218aaee617a59d13e46e8d0120456210b0fd/check/integration-amazon.aws-5/3714ce7/job-output.txt

Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/800e4c4bc06947e68a3583894fa6bc8a

✔️ ansible-galaxy-importer SUCCESS in 4m 39s
✔️ build-ansible-collection SUCCESS in 14m 04s
✔️ ansible-test-splitter SUCCESS in 11m 54s
integration-amazon.aws-1 FAILURE in 8m 08s
Skipped 43 jobs

@tremble tremble marked this pull request as ready for review November 13, 2023 09:14
@tremble tremble added the backport-7 PR should be backported to the stable-7 branch label Nov 13, 2023
Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/d8ace587208e446cb1f7fe18f5140183

✔️ ansible-galaxy-importer SUCCESS in 5m 07s
✔️ build-ansible-collection SUCCESS in 20m 28s
✔️ ansible-test-splitter SUCCESS in 5m 31s
✔️ integration-amazon.aws-1 SUCCESS in 7m 57s
Skipped 43 jobs

@tremble tremble added the backport-6 PR should be backported to the stable-6 branch label Nov 13, 2023
Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/e2e50b92212b47b79252efca7bf151a8

✔️ ansible-galaxy-importer SUCCESS in 4m 42s
✔️ build-ansible-collection SUCCESS in 14m 59s
✔️ ansible-test-splitter SUCCESS in 5m 32s
✔️ integration-amazon.aws-1 SUCCESS in 8m 48s
Skipped 43 jobs

@tremble tremble added the mergeit Merge the PR (SoftwareFactory) label Nov 21, 2023
Copy link
Contributor

Build succeeded (gate pipeline).
https://ansible.softwarefactory-project.io/zuul/buildset/fba0d433f8aa4a29adf61f0dd2bbc1cc

✔️ ansible-galaxy-importer SUCCESS in 4m 45s
✔️ build-ansible-collection SUCCESS in 14m 46s
✔️ ansible-test-splitter SUCCESS in 5m 37s
✔️ integration-amazon.aws-1 SUCCESS in 6m 39s
Skipped 43 jobs

Copy link
Contributor

Pull request merge failed: Required status check "ansible/gate" is expected.

@tremble
Copy link
Contributor Author

tremble commented Nov 21, 2023

regate

Copy link
Contributor

Build succeeded (gate pipeline).
https://ansible.softwarefactory-project.io/zuul/buildset/91a70c1ae22c4105a2649f3e073d96c5

✔️ ansible-galaxy-importer SUCCESS in 8m 56s
✔️ build-ansible-collection SUCCESS in 14m 26s
✔️ ansible-test-splitter SUCCESS in 5m 32s
✔️ integration-amazon.aws-1 SUCCESS in 10m 31s
Skipped 43 jobs

Copy link
Contributor

Pull request merge failed: Required status check "ansible/gate" is expected.

Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/a1225ed4454141a1b682032ae9dd9d3c

✔️ ansible-galaxy-importer SUCCESS in 3m 58s
✔️ build-ansible-collection SUCCESS in 14m 42s
✔️ ansible-test-splitter SUCCESS in 5m 47s
✔️ integration-amazon.aws-1 SUCCESS in 6m 40s
Skipped 43 jobs

Copy link
Contributor

Build succeeded (gate pipeline).
https://ansible.softwarefactory-project.io/zuul/buildset/59c5b43ece78459b87e25a0fb025b8d6

✔️ ansible-galaxy-importer SUCCESS in 5m 15s
✔️ build-ansible-collection SUCCESS in 15m 07s
✔️ ansible-test-splitter SUCCESS in 5m 54s
✔️ integration-amazon.aws-1 SUCCESS in 8m 09s
Skipped 43 jobs

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit c510f26 into ansible-collections:main Nov 21, 2023
39 checks passed
Copy link

patchback bot commented Nov 21, 2023

Backport to stable-6: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-6/c510f26e2c9ba3d87b063b398b10e5fe91ca9eee/pr-1848

Backported as #1870

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Nov 21, 2023
Work on ec2_vpc_subnet related test flake

SUMMARY
As with all things AWS there are no guarantees how fast things will be created.  We currently have a hard coded delay of ~10 seconds to wait for the subnet to be created, while advertising a default timeout of 300s.  If this 10s is exceeded, then we throw a 'NoneType' object is not subscriptable error (because we didn't check that the subnet was actually returned)
This moves a for-loop over to a waiter.  The "waiter_handler" logic already makes sure we have a total waiting time matching the limits set, even if we wait for multiple things to happen)
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ec2_vpc_subnet
ADDITIONAL INFORMATION
2023-11-13 07:08:17.514752 | controller | TASK [ec2_ami_tpm : create a subnet to use for creating an ec2 instance] *******
2023-11-13 07:08:17.514756 | controller | task path: /home/zuul-worker/.ansible/collections/ansible_collections/amazon/aws/tests/integration/targets/ec2_ami_tpm/tasks/main.yml:31
2023-11-13 07:08:29.688395 | controller | Using module file /home/zuul-worker/.ansible/collections/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py
2023-11-13 07:08:29.688433 | controller | Pipelining is enabled.
2023-11-13 07:08:29.688440 | controller | <testhost> ESTABLISH LOCAL CONNECTION FOR USER: zuul-worker
2023-11-13 07:08:29.688481 | controller | <testhost> EXEC /bin/sh -c 'ANSIBLE_DEBUG_BOTOCORE_LOGS=True /home/zuul-worker/venv/bin/python && sleep 0'
2023-11-13 07:08:29.688488 | controller | The full traceback is:
2023-11-13 07:08:29.688494 | controller | Traceback (most recent call last):
2023-11-13 07:08:29.688501 | controller |   File "<stdin>", line 121, in <module>
2023-11-13 07:08:29.688508 | controller |   File "<stdin>", line 113, in _ansiballz_main
2023-11-13 07:08:29.688514 | controller |   File "<stdin>", line 61, in invoke_module
2023-11-13 07:08:29.688520 | controller |   File "<frozen runpy>", line 226, in run_module
2023-11-13 07:08:29.688526 | controller |   File "<frozen runpy>", line 98, in _run_module_code
2023-11-13 07:08:29.688533 | controller |   File "<frozen runpy>", line 88, in _run_code
2023-11-13 07:08:29.688539 | controller |   File "/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py", line 584, in <module>
2023-11-13 07:08:29.688547 | controller |   File "/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py", line 574, in main
2023-11-13 07:08:29.688553 | controller |   File "/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py", line 491, in ensure_subnet_present
2023-11-13 07:08:29.688560 | controller |   File "/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py", line 501, in ensure_final_subnet
2023-11-13 07:08:29.688567 | controller | TypeError: 'NoneType' object is not subscriptable
2023-11-13 07:08:29.688572 | controller | fatal: [testhost]: FAILED! => {
2023-11-13 07:08:29.688579 | controller |     "changed": false,
2023-11-13 07:08:29.688587 | controller |     "module_stderr": "Traceback (most recent call last):\n  File \"<stdin>\", line 121, in <module>\n  File \"<stdin>\", line 113, in _ansiballz_main\n  File \"<stdin>\", line 61, in invoke_module\n  File \"<frozen runpy>\", line 226, in run_module\n  File \"<frozen runpy>\", line 98, in _run_module_code\n  File \"<frozen runpy>\", line 88, in _run_code\n  File \"/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py\", line 584, in <module>\n  File \"/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py\", line 574, in main\n  File \"/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py\", line 491, in ensure_subnet_present\n  File \"/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py\", line 501, in ensure_final_subnet\nTypeError: 'NoneType' object is not subscriptable\n",
2023-11-13 07:08:29.688599 | controller |     "module_stdout": "",
2023-11-13 07:08:29.688607 | controller |     "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
2023-11-13 07:08:29.688614 | controller |     "rc": 1
2023-11-13 07:08:29.688620 | controller | }

See also:
https://1c9f147019056ec08967-4a68a93a4e95f691374839dd8e3d025a.ssl.cf2.rackcdn.com/1846/7ae4218aaee617a59d13e46e8d0120456210b0fd/check/integration-amazon.aws-5/3714ce7/job-output.txt

Reviewed-by: Alina Buzachis
(cherry picked from commit c510f26)
Copy link

patchback bot commented Nov 21, 2023

Backport to stable-7: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-7/c510f26e2c9ba3d87b063b398b10e5fe91ca9eee/pr-1848

Backported as #1871

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Nov 21, 2023
Work on ec2_vpc_subnet related test flake

SUMMARY
As with all things AWS there are no guarantees how fast things will be created.  We currently have a hard coded delay of ~10 seconds to wait for the subnet to be created, while advertising a default timeout of 300s.  If this 10s is exceeded, then we throw a 'NoneType' object is not subscriptable error (because we didn't check that the subnet was actually returned)
This moves a for-loop over to a waiter.  The "waiter_handler" logic already makes sure we have a total waiting time matching the limits set, even if we wait for multiple things to happen)
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ec2_vpc_subnet
ADDITIONAL INFORMATION
2023-11-13 07:08:17.514752 | controller | TASK [ec2_ami_tpm : create a subnet to use for creating an ec2 instance] *******
2023-11-13 07:08:17.514756 | controller | task path: /home/zuul-worker/.ansible/collections/ansible_collections/amazon/aws/tests/integration/targets/ec2_ami_tpm/tasks/main.yml:31
2023-11-13 07:08:29.688395 | controller | Using module file /home/zuul-worker/.ansible/collections/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py
2023-11-13 07:08:29.688433 | controller | Pipelining is enabled.
2023-11-13 07:08:29.688440 | controller | <testhost> ESTABLISH LOCAL CONNECTION FOR USER: zuul-worker
2023-11-13 07:08:29.688481 | controller | <testhost> EXEC /bin/sh -c 'ANSIBLE_DEBUG_BOTOCORE_LOGS=True /home/zuul-worker/venv/bin/python && sleep 0'
2023-11-13 07:08:29.688488 | controller | The full traceback is:
2023-11-13 07:08:29.688494 | controller | Traceback (most recent call last):
2023-11-13 07:08:29.688501 | controller |   File "<stdin>", line 121, in <module>
2023-11-13 07:08:29.688508 | controller |   File "<stdin>", line 113, in _ansiballz_main
2023-11-13 07:08:29.688514 | controller |   File "<stdin>", line 61, in invoke_module
2023-11-13 07:08:29.688520 | controller |   File "<frozen runpy>", line 226, in run_module
2023-11-13 07:08:29.688526 | controller |   File "<frozen runpy>", line 98, in _run_module_code
2023-11-13 07:08:29.688533 | controller |   File "<frozen runpy>", line 88, in _run_code
2023-11-13 07:08:29.688539 | controller |   File "/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py", line 584, in <module>
2023-11-13 07:08:29.688547 | controller |   File "/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py", line 574, in main
2023-11-13 07:08:29.688553 | controller |   File "/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py", line 491, in ensure_subnet_present
2023-11-13 07:08:29.688560 | controller |   File "/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py", line 501, in ensure_final_subnet
2023-11-13 07:08:29.688567 | controller | TypeError: 'NoneType' object is not subscriptable
2023-11-13 07:08:29.688572 | controller | fatal: [testhost]: FAILED! => {
2023-11-13 07:08:29.688579 | controller |     "changed": false,
2023-11-13 07:08:29.688587 | controller |     "module_stderr": "Traceback (most recent call last):\n  File \"<stdin>\", line 121, in <module>\n  File \"<stdin>\", line 113, in _ansiballz_main\n  File \"<stdin>\", line 61, in invoke_module\n  File \"<frozen runpy>\", line 226, in run_module\n  File \"<frozen runpy>\", line 98, in _run_module_code\n  File \"<frozen runpy>\", line 88, in _run_code\n  File \"/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py\", line 584, in <module>\n  File \"/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py\", line 574, in main\n  File \"/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py\", line 491, in ensure_subnet_present\n  File \"/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py\", line 501, in ensure_final_subnet\nTypeError: 'NoneType' object is not subscriptable\n",
2023-11-13 07:08:29.688599 | controller |     "module_stdout": "",
2023-11-13 07:08:29.688607 | controller |     "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
2023-11-13 07:08:29.688614 | controller |     "rc": 1
2023-11-13 07:08:29.688620 | controller | }

See also:
https://1c9f147019056ec08967-4a68a93a4e95f691374839dd8e3d025a.ssl.cf2.rackcdn.com/1846/7ae4218aaee617a59d13e46e8d0120456210b0fd/check/integration-amazon.aws-5/3714ce7/job-output.txt

Reviewed-by: Alina Buzachis
(cherry picked from commit c510f26)
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Nov 21, 2023
[PR #1848/c510f26e backport][stable-6] Work on ec2_vpc_subnet related test flake

This is a backport of PR #1848 as merged into main (c510f26).
SUMMARY
As with all things AWS there are no guarantees how fast things will be created.  We currently have a hard coded delay of ~10 seconds to wait for the subnet to be created, while advertising a default timeout of 300s.  If this 10s is exceeded, then we throw a 'NoneType' object is not subscriptable error (because we didn't check that the subnet was actually returned)
This moves a for-loop over to a waiter.  The "waiter_handler" logic already makes sure we have a total waiting time matching the limits set, even if we wait for multiple things to happen)
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ec2_vpc_subnet
ADDITIONAL INFORMATION
2023-11-13 07:08:17.514752 | controller | TASK [ec2_ami_tpm : create a subnet to use for creating an ec2 instance] *******
2023-11-13 07:08:17.514756 | controller | task path: /home/zuul-worker/.ansible/collections/ansible_collections/amazon/aws/tests/integration/targets/ec2_ami_tpm/tasks/main.yml:31
2023-11-13 07:08:29.688395 | controller | Using module file /home/zuul-worker/.ansible/collections/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py
2023-11-13 07:08:29.688433 | controller | Pipelining is enabled.
2023-11-13 07:08:29.688440 | controller | <testhost> ESTABLISH LOCAL CONNECTION FOR USER: zuul-worker
2023-11-13 07:08:29.688481 | controller | <testhost> EXEC /bin/sh -c 'ANSIBLE_DEBUG_BOTOCORE_LOGS=True /home/zuul-worker/venv/bin/python && sleep 0'
2023-11-13 07:08:29.688488 | controller | The full traceback is:
2023-11-13 07:08:29.688494 | controller | Traceback (most recent call last):
2023-11-13 07:08:29.688501 | controller |   File "<stdin>", line 121, in <module>
2023-11-13 07:08:29.688508 | controller |   File "<stdin>", line 113, in _ansiballz_main
2023-11-13 07:08:29.688514 | controller |   File "<stdin>", line 61, in invoke_module
2023-11-13 07:08:29.688520 | controller |   File "<frozen runpy>", line 226, in run_module
2023-11-13 07:08:29.688526 | controller |   File "<frozen runpy>", line 98, in _run_module_code
2023-11-13 07:08:29.688533 | controller |   File "<frozen runpy>", line 88, in _run_code
2023-11-13 07:08:29.688539 | controller |   File "/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py", line 584, in <module>
2023-11-13 07:08:29.688547 | controller |   File "/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py", line 574, in main
2023-11-13 07:08:29.688553 | controller |   File "/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py", line 491, in ensure_subnet_present
2023-11-13 07:08:29.688560 | controller |   File "/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py", line 501, in ensure_final_subnet
2023-11-13 07:08:29.688567 | controller | TypeError: 'NoneType' object is not subscriptable
2023-11-13 07:08:29.688572 | controller | fatal: [testhost]: FAILED! => {
2023-11-13 07:08:29.688579 | controller |     "changed": false,
2023-11-13 07:08:29.688587 | controller |     "module_stderr": "Traceback (most recent call last):\n  File \"<stdin>\", line 121, in <module>\n  File \"<stdin>\", line 113, in _ansiballz_main\n  File \"<stdin>\", line 61, in invoke_module\n  File \"<frozen runpy>\", line 226, in run_module\n  File \"<frozen runpy>\", line 98, in _run_module_code\n  File \"<frozen runpy>\", line 88, in _run_code\n  File \"/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py\", line 584, in <module>\n  File \"/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py\", line 574, in main\n  File \"/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py\", line 491, in ensure_subnet_present\n  File \"/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py\", line 501, in ensure_final_subnet\nTypeError: 'NoneType' object is not subscriptable\n",
2023-11-13 07:08:29.688599 | controller |     "module_stdout": "",
2023-11-13 07:08:29.688607 | controller |     "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
2023-11-13 07:08:29.688614 | controller |     "rc": 1
2023-11-13 07:08:29.688620 | controller | }

See also:
https://1c9f147019056ec08967-4a68a93a4e95f691374839dd8e3d025a.ssl.cf2.rackcdn.com/1846/7ae4218aaee617a59d13e46e8d0120456210b0fd/check/integration-amazon.aws-5/3714ce7/job-output.txt

Reviewed-by: Mark Chappell
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Nov 21, 2023
[PR #1848/c510f26e backport][stable-7] Work on ec2_vpc_subnet related test flake

This is a backport of PR #1848 as merged into main (c510f26).
SUMMARY
As with all things AWS there are no guarantees how fast things will be created.  We currently have a hard coded delay of ~10 seconds to wait for the subnet to be created, while advertising a default timeout of 300s.  If this 10s is exceeded, then we throw a 'NoneType' object is not subscriptable error (because we didn't check that the subnet was actually returned)
This moves a for-loop over to a waiter.  The "waiter_handler" logic already makes sure we have a total waiting time matching the limits set, even if we wait for multiple things to happen)
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ec2_vpc_subnet
ADDITIONAL INFORMATION
2023-11-13 07:08:17.514752 | controller | TASK [ec2_ami_tpm : create a subnet to use for creating an ec2 instance] *******
2023-11-13 07:08:17.514756 | controller | task path: /home/zuul-worker/.ansible/collections/ansible_collections/amazon/aws/tests/integration/targets/ec2_ami_tpm/tasks/main.yml:31
2023-11-13 07:08:29.688395 | controller | Using module file /home/zuul-worker/.ansible/collections/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py
2023-11-13 07:08:29.688433 | controller | Pipelining is enabled.
2023-11-13 07:08:29.688440 | controller | <testhost> ESTABLISH LOCAL CONNECTION FOR USER: zuul-worker
2023-11-13 07:08:29.688481 | controller | <testhost> EXEC /bin/sh -c 'ANSIBLE_DEBUG_BOTOCORE_LOGS=True /home/zuul-worker/venv/bin/python && sleep 0'
2023-11-13 07:08:29.688488 | controller | The full traceback is:
2023-11-13 07:08:29.688494 | controller | Traceback (most recent call last):
2023-11-13 07:08:29.688501 | controller |   File "<stdin>", line 121, in <module>
2023-11-13 07:08:29.688508 | controller |   File "<stdin>", line 113, in _ansiballz_main
2023-11-13 07:08:29.688514 | controller |   File "<stdin>", line 61, in invoke_module
2023-11-13 07:08:29.688520 | controller |   File "<frozen runpy>", line 226, in run_module
2023-11-13 07:08:29.688526 | controller |   File "<frozen runpy>", line 98, in _run_module_code
2023-11-13 07:08:29.688533 | controller |   File "<frozen runpy>", line 88, in _run_code
2023-11-13 07:08:29.688539 | controller |   File "/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py", line 584, in <module>
2023-11-13 07:08:29.688547 | controller |   File "/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py", line 574, in main
2023-11-13 07:08:29.688553 | controller |   File "/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py", line 491, in ensure_subnet_present
2023-11-13 07:08:29.688560 | controller |   File "/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py", line 501, in ensure_final_subnet
2023-11-13 07:08:29.688567 | controller | TypeError: 'NoneType' object is not subscriptable
2023-11-13 07:08:29.688572 | controller | fatal: [testhost]: FAILED! => {
2023-11-13 07:08:29.688579 | controller |     "changed": false,
2023-11-13 07:08:29.688587 | controller |     "module_stderr": "Traceback (most recent call last):\n  File \"<stdin>\", line 121, in <module>\n  File \"<stdin>\", line 113, in _ansiballz_main\n  File \"<stdin>\", line 61, in invoke_module\n  File \"<frozen runpy>\", line 226, in run_module\n  File \"<frozen runpy>\", line 98, in _run_module_code\n  File \"<frozen runpy>\", line 88, in _run_code\n  File \"/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py\", line 584, in <module>\n  File \"/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py\", line 574, in main\n  File \"/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py\", line 491, in ensure_subnet_present\n  File \"/tmp/ansible_ec2_vpc_subnet_payload_g63mopop/ansible_ec2_vpc_subnet_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_subnet.py\", line 501, in ensure_final_subnet\nTypeError: 'NoneType' object is not subscriptable\n",
2023-11-13 07:08:29.688599 | controller |     "module_stdout": "",
2023-11-13 07:08:29.688607 | controller |     "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
2023-11-13 07:08:29.688614 | controller |     "rc": 1
2023-11-13 07:08:29.688620 | controller | }

See also:
https://1c9f147019056ec08967-4a68a93a4e95f691374839dd8e3d025a.ssl.cf2.rackcdn.com/1846/7ae4218aaee617a59d13e46e8d0120456210b0fd/check/integration-amazon.aws-5/3714ce7/job-output.txt

Reviewed-by: Mark Chappell
markuman pushed a commit to markuman/amazon.aws that referenced this pull request Nov 30, 2023
Various ARN handling fixes

Depends-On: ansible-collections#1619
SUMMARY
fixes: ansible-collections#1846
Various modules had hard-coded ARN handling which assumed the use of the main  partition.  This causes problems for folks using Gov Cloud (and aws-cn)
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/modules/batch_compute_environment.py
plugins/modules/ec2_launch_template.py
plugins/modules/elasticache_info.py
plugins/modules/iam_group.py
plugins/modules/iam_role.py
plugins/modules/msk_config.py
plugins/modules/redshift.py
plugins/modules/sns_topic.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@25a636c
markuman pushed a commit to markuman/amazon.aws that referenced this pull request Nov 30, 2023
Various ARN handling fixes

Depends-On: ansible-collections#1619
SUMMARY
fixes: ansible-collections#1846
Various modules had hard-coded ARN handling which assumed the use of the main  partition.  This causes problems for folks using Gov Cloud (and aws-cn)
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/modules/batch_compute_environment.py
plugins/modules/ec2_launch_template.py
plugins/modules/elasticache_info.py
plugins/modules/iam_group.py
plugins/modules/iam_role.py
plugins/modules/msk_config.py
plugins/modules/redshift.py
plugins/modules/sns_topic.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@25a636c
@tremble tremble deleted the ec2_vpc_subnet/flakes branch January 12, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-6 PR should be backported to the stable-6 branch backport-7 PR should be backported to the stable-7 branch mergeit Merge the PR (SoftwareFactory)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants