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

Stickiness type 'lb_cookie' is not supported for target groups with the TCP protocol(unable to disable stickiness not supported in NLB) #67993

Closed
ghost opened this issue Mar 4, 2020 · 10 comments
Labels
affects_2.5 This issue/PR affects Ansible v2.5 aws bug This issue/PR relates to a bug. cloud module This issue/PR relates to a module. openstack support:community This issue/PR relates to code supported by the Ansible community. system System category traceback This issue/PR includes a traceback.

Comments

@ghost
Copy link

ghost commented Mar 4, 2020

SUMMARY

We are using Ansible 2.5 to deploy AWS resources in our environment. From March 02, 2019 our deployment is failing with the below error.

ERROR:

TASK [immutable_server : target group for analytics-tst-plebos loadbalancer] ***
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: InvalidConfigurationRequestException:
An error occurred (InvalidConfigurationRequest) when calling the ModifyTargetGroupAttributes operation:
Stickiness type 'lb_cookie' is not supported for target groups with the TCP protocol
17:21:08 fatal: [localhost]: FAILED! => {"changed": false, "error": {"code": "InvalidConfigurationRequest", "message": "Stickiness type 'lb_cookie'
is not supported for target groups with the TCP protocol", "type": "Sender"}, "msg": "An error occurred (InvalidConfigurationRequest)
when calling the ModifyTargetGroupAttributes operation: Stickiness type 'lb_cookie' is not supported for target groups with the TCP protocol",
"response_metadata": {"http_headers": {"connection": "close", "content-length": "359", "content-type": "text/xml", "date": "Tue, 03 Mar 2020 11:51:08 GMT",
"x-amzn-requestid": "23b0ca87-e0fb-4b84-b93b-ae5b1363df53"}, "http_status_code": 400, "request_id": "23b0ca87-e0fb-4b84-b93b-ae5b1363df53", "retry_attempts": 0}}

ISSUE TYPE
  • Bug Report - Unable to disable stickiness not supported in NLB
COMPONENT NAME
  • name: "target group for {{ server_name }} loadbalancer"
    elb_target_group:
    state: present
    name: "{{ server_name }}-elb"
    protocol: tcp
    port: 80
    target_type: instance
    deregistration_delay_timeout: 35
    modify_targets: False
    vpc_id: "{{ vpc_out.vpcs.0.id }}"
    health_check_protocol: "{{ load_balancer_ping_protocol | default('http') }}"
    health_check_port: "{{ load_balancer_ping_port | default('80') }}"
    health_check_path: "{{ load_balancer_ping_path | default('/elb/ping')}}"
    health_check_interval: 30
    unhealthy_threshold_count: 2
    healthy_threshold_count: 2
    stickiness_enabled: False
    tags: "{{ aws.tags_as_dict }}"
    register: target_group_out
ANSIBLE VERSION
Ansible version = 2.5.0
CONFIGURATION
- name: "target group for {{ server_name }} loadbalancer"
  elb_target_group:
    state: present
    name: "{{ server_name }}-elb"
    protocol: tcp
    port: 80
    target_type: instance
    deregistration_delay_timeout: 35
    modify_targets: False
    vpc_id: "{{ vpc_out.vpcs.0.id }}"
    health_check_protocol: "{{ load_balancer_ping_protocol | default('http') }}"
    health_check_port: "{{ load_balancer_ping_port | default('80') }}"
    health_check_path: "{{ load_balancer_ping_path | default('/elb/ping')}}"
    health_check_interval: 30
    unhealthy_threshold_count: 2
    healthy_threshold_count: 2
    stickiness_enabled: False
    tags: "{{ aws.tags_as_dict }}"
  register: target_group_out

OS / ENVIRONMENT

Ubuntu 18.04 LTS / AWS environment

STEPS TO REPRODUCE

Kindly use the below playbook to deploy loadbalancer using Ansible on AWS cloud.

- name: "target group for {{ server_name }} loadbalancer"
  elb_target_group:
    state: present
    name: "{{ server_name }}-elb"
    protocol: tcp
    port: 80
    target_type: instance
    deregistration_delay_timeout: 35
    modify_targets: False
    vpc_id: "{{ vpc_out.vpcs.0.id }}"
    health_check_protocol: "{{ load_balancer_ping_protocol | default('http') }}"
    health_check_port: "{{ load_balancer_ping_port | default('80') }}"
    health_check_path: "{{ load_balancer_ping_path | default('/elb/ping')}}"
    health_check_interval: 30
    unhealthy_threshold_count: 2
    healthy_threshold_count: 2
    stickiness_enabled: False
    tags: "{{ aws.tags_as_dict }}"
  register: target_group_out
EXPECTED RESULTS

An AWS Network loadbalancer will be created.

ACTUAL RESULTS

The deployment fails with below error.

 TASK [immutable_server : target group for analytics-tst-plebos loadbalancer] ***
17:21:08 An exception occurred during task execution. To see the full traceback, use -vvv. The error was: InvalidConfigurationRequestException:
An error occurred (InvalidConfigurationRequest) when calling the ModifyTargetGroupAttributes operation: 
Stickiness type 'lb_cookie' is not supported for target groups with the TCP protocol
17:21:08 fatal: [localhost]: FAILED! => {"changed": false, "error": {"code": "InvalidConfigurationRequest", "message": "Stickiness type 'lb_cookie'
is not supported for target groups with the TCP protocol", "type": "Sender"}, "msg": "An error occurred (InvalidConfigurationRequest) 
when calling the ModifyTargetGroupAttributes operation: Stickiness type 'lb_cookie' is not supported for target groups with the TCP protocol", 
"response_metadata": {"http_headers": {"connection": "close", "content-length": "359", "content-type": "text/xml", "date": "Tue, 03 Mar 2020 11:51:08 GMT", 
"x-amzn-requestid": "23b0ca87-e0fb-4b84-b93b-ae5b1363df53"}, "http_status_code": 400, "request_id": "23b0ca87-e0fb-4b84-b93b-ae5b1363df53", "retry_attempts": 0}}

References

I can see a similar issue occurred for terraform users as well.

hashicorp/terraform-provider-aws#10494

@ansibot
Copy link
Contributor

ansibot commented Mar 4, 2020

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 Mar 4, 2020

@srikark16, just so you are aware we have a dedicated Working Group for aws.
You can find other people interested in this in #ansible-aws on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@ansibot ansibot added affects_2.5 This issue/PR affects Ansible v2.5 aws bug This issue/PR relates to a bug. cloud module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. openstack support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. system System category traceback This issue/PR includes a traceback. labels Mar 4, 2020
@mkrizek
Copy link
Contributor

mkrizek commented Mar 4, 2020

!component -lib/ansible/modules/system/ping.py

@ansibot
Copy link
Contributor

ansibot commented Mar 4, 2020

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 ansibot removed 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 Mar 4, 2020
@Sodki
Copy link
Contributor

Sodki commented Mar 4, 2020

The same is happening to me with Ansible 2.9.

@Sodki
Copy link
Contributor

Sodki commented Mar 4, 2020

I tried putting a random value for stickiness_type and got the following error:

Couldn't delete target group: An error occurred (ValidationError) when calling the ModifyTargetGroupAttributes operation: 'Stickiness type' must be one of [lb_cookie, source_ip]

So it seems that lb_cookie is not the only valid option, unlike what the documentation says. Using the following workaround worked for me:

stickiness_type: source_ip

@ghost
Copy link
Author

ghost commented Mar 6, 2020

Thank you Henrique Rodrigues!!!
The work around you have provided worked for me.

Regards,
Srikar

@ghost ghost closed this as completed Mar 6, 2020
@thomaszooman
Copy link

setting stickiness_enabled: no not working also.

@antoineserrano
Copy link

Adding both stickiness_enable: no and stickiness_type: source_ip did the trick for us, using Ansible 2.9.6.

@ansible ansible locked and limited conversation to collaborators Apr 3, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.5 This issue/PR affects Ansible v2.5 aws bug This issue/PR relates to a bug. cloud module This issue/PR relates to a module. openstack support:community This issue/PR relates to code supported by the Ansible community. system System category traceback This issue/PR includes a traceback.
Projects
None yet
Development

No branches or pull requests

5 participants