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

elb_target_group modules sometimes throws a TypeError #36628

Closed
ramonamis opened this issue Feb 23, 2018 · 9 comments
Closed

elb_target_group modules sometimes throws a TypeError #36628

ramonamis opened this issue Feb 23, 2018 · 9 comments
Assignees
Labels
affects_2.4 This issue/PR affects Ansible v2.4 aws bot_closed bug This issue/PR relates to a bug. cloud collection:community.aws collection Related to Ansible Collections work has_pr This issue has an associated PR. module This issue/PR relates to a module. needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md support:community This issue/PR relates to code supported by the Ansible community. traceback This issue/PR includes a traceback.

Comments

@ramonamis
Copy link

ramonamis commented Feb 23, 2018

ISSUE TYPE
  • Bug Report
COMPONENT NAME

elb_target_group

ANSIBLE VERSION
$ ansible --version
ansible 2.4.3.0
  config file = None
  configured module search path = [u'/Users/ramonamis/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/ramonamis/.virtualenvs/devops/lib/python2.7/site-packages/ansible
  executable location = /Users/ramonamis/.virtualenvs/devops/bin/ansible
  python version = 2.7.10 (default, Jul 15 2017, 17:16:57) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
CONFIGURATION
OS / ENVIRONMENT
SUMMARY

While trying to create a target group with ansible most of the time works, sometimes it throws the following error:

TASK [lb-route53-create : Create lb target group] ******************************
Friday 23 February 2018  10:24:20 +0000 (0:00:00.037)       0:19:28.899 ******* 
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: 'NoneType' object has no attribute '__getitem__'
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_pBY2Rv/ansible_module_elb_target_group.py\", line 672, in <module>\n    main()\n  File \"/tmp/ansible_pBY2Rv/ansible_module_elb_target_group.py\", line 667, in main\n    create_or_update_target_group(connection, module)\n  File \"/tmp/ansible_pBY2Rv/ansible_module_elb_target_group.py\", line 541, in create_or_update_target_group\n    current_tg_attributes = get_tg_attributes(connection, module, tg['TargetGroupArn'])\nTypeError: 'NoneType' object has no attribute '__getitem__'\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 0}

Re-running works like a charm, with exactly the same code

STEPS TO REPRODUCE

This is the code I am using to create the target groups:

        elb_target_group:
          name: "{{ lb_target_group_name }}"
          protocol: "{{ lb_protocol }}"
          port: "{{ lb_port }}"
          vpc_id: "{{ aws_vpc }}"
          health_check_path: "{{ lb_health_check_path }}"
          health_check_protocol: "{{ lb_health_check_protocol }}"
          health_check_interval: 5
          health_check_timeout: 2
          healthy_threshold_count: 2
          unhealthy_threshold_count: 2
          successful_response_codes: "200-299"
          stickiness_enabled: "{{ lb_stickiness_enabled }}"
          stickiness_lb_cookie_duration: "{{ lb_stickiness_cookie_duration }}"
          deregistration_delay_timeout: "{{ lb_deregistration_delay_timeout }}"
          targets: "{{ lb_targets }}"
          modify_targets: "{{ lb_modify_targets }}"
          state: present

I only notice this issue when we deploy multiple target groups in a row, for instance, we have a loop which deploys multiple customers and this happens after a few loops. Re-running works like a charm.

EXPECTED RESULTS

target group is created

ACTUAL RESULTS
TASK [lb-route53-create : Create lb target group] ******************************
Friday 23 February 2018  10:24:20 +0000 (0:00:00.037)       0:19:28.899 ******* 
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: 'NoneType' object has no attribute '__getitem__'
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_pBY2Rv/ansible_module_elb_target_group.py\", line 672, in <module>\n    main()\n  File \"/tmp/ansible_pBY2Rv/ansible_module_elb_target_group.py\", line 667, in main\n    create_or_update_target_group(connection, module)\n  File \"/tmp/ansible_pBY2Rv/ansible_module_elb_target_group.py\", line 541, in create_or_update_target_group\n    current_tg_attributes = get_tg_attributes(connection, module, tg['TargetGroupArn'])\nTypeError: 'NoneType' object has no attribute '__getitem__'\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 0}
@ansibot ansibot added affects_2.4 This issue/PR affects Ansible v2.4 bug_report needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Feb 23, 2018
@s-hertel s-hertel added cloud aws and removed needs_triage Needs a first human triage before being processed. labels Feb 23, 2018
@ansibot
Copy link
Contributor

ansibot commented Feb 23, 2018

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

@ansibot
Copy link
Contributor

ansibot commented Feb 23, 2018

@ansibot ansibot added module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community. and removed support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Feb 23, 2018
@s-hertel s-hertel self-assigned this Mar 1, 2018
@ansibot ansibot added the bug This issue/PR relates to a bug. label Mar 1, 2018
@s-hertel
Copy link
Contributor

s-hertel commented Mar 1, 2018

Just making a note that a custom waiter would fix this. Going to try to work on that soon.

@ansibot ansibot removed the bug_report label Mar 1, 2018
@ansibot ansibot added the traceback This issue/PR includes a traceback. label May 29, 2018
@ansibot ansibot added support:core This issue/PR relates to code supported by the Ansible Engineering Team. and removed support:community This issue/PR relates to code supported by the Ansible community. labels Sep 18, 2018
@ansibot ansibot added needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) support:community This issue/PR relates to code supported by the Ansible community. and removed support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Oct 4, 2018
@Akasurde
Copy link
Member

@ramonamis Could you please check if PR #37079 works for you and let us know? Thanks,

needs_info

@Akasurde
Copy link
Member

resolved_by_pr #37079

@Akasurde Akasurde added the has_pr This issue has an associated PR. label Oct 11, 2018
@ansibot ansibot added the needs_info This issue requires further information. Please answer any outstanding questions. label Oct 11, 2018
@ramonamis
Copy link
Author

@Akasurde this is pretty hard to reproduce, but I will try my best

@ansibot ansibot removed the needs_info This issue requires further information. Please answer any outstanding questions. label Oct 22, 2018
@ansibot ansibot removed the needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) label Nov 16, 2018
@ansibot
Copy link
Contributor

ansibot commented Jan 31, 2020

@ansibot ansibot added collection Related to Ansible Collections work collection:community.aws needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md labels Apr 29, 2020
@yravid
Copy link

yravid commented Jul 28, 2020

Had the same issue first time after upgrading from ansible 2.7.18 to 2.9.11

@ansibot
Copy link
Contributor

ansibot commented Aug 13, 2020

Thank you very much for your interest in Ansible. Ansible has migrated much of the content into separate repositories to allow for more rapid, independent development. We are closing this issue/PR because this content has been moved to one or more collection repositories.

For further information, please see:
https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md

@ansibot ansibot closed this as completed Aug 13, 2020
@ansible ansible locked and limited conversation to collaborators Sep 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.4 This issue/PR affects Ansible v2.4 aws bot_closed bug This issue/PR relates to a bug. cloud collection:community.aws collection Related to Ansible Collections work has_pr This issue has an associated PR. module This issue/PR relates to a module. needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md support:community This issue/PR relates to code supported by the Ansible community. traceback This issue/PR includes a traceback.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants