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

cloudfront_distribution.py - wait_until_processed appears broken #255

Closed
asciifaceman opened this issue Oct 6, 2020 · 2 comments · Fixed by #1822
Closed

cloudfront_distribution.py - wait_until_processed appears broken #255

asciifaceman opened this issue Oct 6, 2020 · 2 comments · Fixed by #1822
Labels
affects_2.10 bug This issue/PR relates to a bug module module needs_verified plugins plugin (any type) python3 traceback waiting_on_contributor Needs help. Feel free to engage to get things unblocked

Comments

@asciifaceman
Copy link

SUMMARY

A cloudfront_distribution which performs its operation and the cloudfront distribution is created successfully. However, when wait: yes is enabled the error is detailed below.

Digging around the source I've been unable to find anything on my own where the key error could be originating from.
This behavior only occurs on creation with state: present, not on deletion with state: absent

ISSUE TYPE
  • Bug Report
COMPONENT NAME

cloudfront_distribution

ANSIBLE VERSION
13:18 $ ansible --version
ansible 2.10.1
  config file = /Users/redacted/redacted/ansible-roles/ansible.role-cloudfront-stream-distribution/ansible.cfg
  configured module search path = ['/Users/redacted/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.7.7 (default, Mar 10 2020, 15:43:27) [Clang 10.0.0 (clang-1000.11.45.5)]
CONFIGURATION
13:43 $ ansible-config dump --only-changed
INTERPRETER_PYTHON(/Users/redacted/redacted/ansible-roles/ansible.role-cloudfront-stream-distribution/ansible.cfg) = auto
(END)
OS / ENVIRONMENT
Darwin 17.7.0 Darwin Kernel Version 17.7.0: Wed Apr 24 21:17:24 PDT 2019; root:xnu-4570.71.45~1/RELEASE_X86_64 x86_64
MacOS 10.13.6
STEPS TO REPRODUCE

I haven't been able to fully deconstruct it yet to a minimal case, I will try to update with one if I can. Right now I can reproduce by using wait: yes, and it goes away with wait: no

EXPECTED RESULTS

The ansible routine to wait until the distribution is made and reports healthy and then exit with my registered variable populated.

ACTUAL RESULTS
TASK [/Users/redacted/redacted/ansible-roles/ansible.role-cloudfront-stream-distribution : Create / Manage / Delete distribution (This may take some time)] ***
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'Id'
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/Users/redacted/.ansible/tmp/ansible-tmp-1602015472.329021-59538-203288307626216/AnsiballZ_cloudfront_distribution.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/Users/redacted/.ansible/tmp/ansible-tmp-1602015472.329021-59538-203288307626216/AnsiballZ_cloudfront_distribution.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/Users/redacted/.ansible/tmp/ansible-tmp-1602015472.329021-59538-203288307626216/AnsiballZ_cloudfront_distribution.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.community.aws.plugins.modules.cloudfront_distribution', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py\", line 205, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py\", line 96, in _run_module_code\n    mod_name, mod_spec, pkg_name, script_name)\n  File \"/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/var/folders/w_/1n5tpdtx3h1f5k3skn3d6d9r0000gn/T/ansible_community.aws.cloudfront_distribution_payload_lk_w9xob/ansible_community.aws.cloudfront_distribution_payload.zip/ansible_collections/community/aws/plugins/modules/cloudfront_distribution.py\", line 2252, in <module>\n  File \"/var/folders/w_/1n5tpdtx3h1f5k3skn3d6d9r0000gn/T/ansible_community.aws.cloudfront_distribution_payload_lk_w9xob/ansible_community.aws.cloudfront_distribution_payload.zip/ansible_collections/community/aws/plugins/modules/cloudfront_distribution.py\", line 2242, in main\n  File \"/var/folders/w_/1n5tpdtx3h1f5k3skn3d6d9r0000gn/T/ansible_community.aws.cloudfront_distribution_payload_lk_w9xob/ansible_community.aws.cloudfront_distribution_payload.zip/ansible_collections/community/aws/plugins/modules/cloudfront_distribution.py\", line 2072, in wait_until_processed\nKeyError: 'Id'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
@ansibullbot
Copy link

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link

@ansibullbot ansibullbot added affects_2.10 bug This issue/PR relates to a bug module module needs_triage plugins plugin (any type) python3 traceback labels Nov 16, 2020
@goneri goneri added needs_verified waiting_on_contributor Needs help. Feel free to engage to get things unblocked and removed needs_triage labels Feb 19, 2021
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this issue May 25, 2022
…ollections#337)

ec2_eni: Fix idempotency when security_groups is specified

SUMMARY

If security_groups attribute is specified - module always returns Changed = True.
Fixes ansible-collections#255.

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

ec2_eni
ADDITIONAL INFORMATION



Example:
- amazon.aws.ec2_eni:
    name: my-eni
    security_groups:
      - my-sg
    subnet_id: subnet-123456

Will always return Changed = True.

Reviewed-by: Jill R <None>
softwarefactory-project-zuul bot pushed a commit that referenced this issue Jun 1, 2023
…n of creation (#1822)

cloudfront_distribution: no longer crashes when waiting for completion of creation

SUMMARY
Fixes #255
Here we were referring to the ["Id"] member of a queried distribution, but there is level of embedding missing: ["Distribution"]["Id"]
(Just how it's used here )
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
cloudfront_distribution

Reviewed-by: Markus Bergholz <[email protected]>
Reviewed-by: Alina Buzachis
patchback bot pushed a commit that referenced this issue Jun 1, 2023
…n of creation (#1822)

cloudfront_distribution: no longer crashes when waiting for completion of creation

SUMMARY
Fixes #255
Here we were referring to the ["Id"] member of a queried distribution, but there is level of embedding missing: ["Distribution"]["Id"]
(Just how it's used here )
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
cloudfront_distribution

Reviewed-by: Markus Bergholz <[email protected]>
Reviewed-by: Alina Buzachis
(cherry picked from commit dbf6362)
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this issue Jun 1, 2023
…n of creation (ansible-collections#1822)

cloudfront_distribution: no longer crashes when waiting for completion of creation

SUMMARY
Fixes ansible-collections#255
Here we were referring to the ["Id"] member of a queried distribution, but there is level of embedding missing: ["Distribution"]["Id"]
(Just how it's used here )
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
cloudfront_distribution

Reviewed-by: Markus Bergholz <[email protected]>
Reviewed-by: Alina Buzachis
(cherry picked from commit dbf6362)
softwarefactory-project-zuul bot pushed a commit that referenced this issue Jun 1, 2023
…n of creation (#1822) (#1838)

[manual backport stable-5] cloudfront_distribution: no longer crashes when waiting for completion of creation (#1822)

cloudfront_distribution: no longer crashes when waiting for completion of creation
SUMMARY
Fixes #255
Here we were referring to the ["Id"] member of a queried distribution, but there is level of embedding missing: ["Distribution"]["Id"] (Just how it's used here )
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
cloudfront_distribution
Reviewed-by: Markus Bergholz [email protected]
Reviewed-by: Alina Buzachis
(cherry picked from commit dbf6362)
SUMMARY


ISSUE TYPE


Bugfix Pull Request
Docs Pull Request
Feature Pull Request
New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Markus Bergholz <[email protected]>
softwarefactory-project-zuul bot pushed a commit that referenced this issue Jun 8, 2023
…n of creation (#1822) (#1835)

[PR #1822/dbf6362d backport][stable-6] cloudfront_distribution: no longer crashes when waiting for completion of creation

This is a backport of PR #1822 as merged into main (dbf6362).
SUMMARY
Fixes #255
Here we were referring to the ["Id"] member of a queried distribution, but there is level of embedding missing: ["Distribution"]["Id"]
(Just how it's used here )
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
cloudfront_distribution

Reviewed-by: Alina Buzachis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_2.10 bug This issue/PR relates to a bug module module needs_verified plugins plugin (any type) python3 traceback waiting_on_contributor Needs help. Feel free to engage to get things unblocked
Projects
None yet
3 participants