{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/143","repository_url":"https://api.github.com/repos/ansible/ansible-modules-core","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/143/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/143/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/143/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/143","id":44991804,"number":143,"title":"ec2_elb: Failing with boto exception ( 400 - throttling ) ","user":{"login":"ndobbs","id":3474164,"avatar_url":"https://avatars.githubusercontent.com/u/3474164?v=3","gravatar_id":"","url":"https://api.github.com/users/ndobbs","html_url":"https://github.com/ndobbs","followers_url":"https://api.github.com/users/ndobbs/followers","following_url":"https://api.github.com/users/ndobbs/following{/other_user}","gists_url":"https://api.github.com/users/ndobbs/gists{/gist_id}","starred_url":"https://api.github.com/users/ndobbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndobbs/subscriptions","organizations_url":"https://api.github.com/users/ndobbs/orgs","repos_url":"https://api.github.com/users/ndobbs/repos","events_url":"https://api.github.com/users/ndobbs/events{/privacy}","received_events_url":"https://api.github.com/users/ndobbs/received_events","type":"User","site_admin":false},"labels":[{"id":439056739,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/affects_1.7","name":"affects_1.7","color":"5319e7","default":false},{"id":382351767,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/aws","name":"aws","color":"c5def5","default":false},{"id":132571937,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/bug_report","name":"bug_report","color":"fbca04","default":false},{"id":132897218,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/cloud","name":"cloud","color":"c7def8","default":false},{"id":414073372,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/waiting_on_maintainer","name":"waiting_on_maintainer","color":"d93f0b","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2014-10-06T14:46:34Z","updated_at":"2016-12-03T06:29:12Z","closed_at":null,"body":"**Issue Type: Bug Report**\n\n**Ansible Version: Ansible 1.7.2**\n**Boto Version: 2.32.1**\n**Environment:** Redhat Enterprise Linux 6.4 ( Ansible Tower v2.0.0) \n\n**Summary:**\nI have a process \"lights on\" which turns on ec2 instances, then subsequently adds said instances to their respective load balancers ( defined by elb_shortname ). I get very intermittent results, sometimes the playbook will complete successfully, even consecutively at times. No matter what I do, ( change logic, implement 'pauses' etc, setting and retrieving facts ) I can not get around this AWS throttling message. \n\n**Steps to Reproduce:**\n\nInvoke playbook that turns on ec2_instances, waits and then places machines with defined elb_shortname variable into its respective group load balancer. \n\n```\n- name: starting instance(s)\n  when: instance_id is defined and lights_on|default (\"false\") == \"true\"\n  local_action: ec2\n  args:\n    region: 'us-west-2'\n    instance_ids: \"{{ instance_id }}\"\n    state: 'running'\n    wait: 'yes'\n    wait_timeout: '300'\n  register: ec2\n\n- name: Pausing, trying to avoid AWS throttling\n  pause: minutes=10\n\n- name: registering instance to its respective groups ELB\n  # instances that do not require ELBs do not need to run this part of the playbook\n  when: elb_shortname is defined and lights_on|default (\"false\") == \"true\"\n  local_action: ec2_elb\n  args:\n    region: 'us-west-2'\n    state: 'present'\n    wait: 'yes'\n    wait_timeout: '300'\n```\n\n**Expected Results:**\n\n```\nTASK: [roles/lights_on | registering instance to its respective groups ELB] *** \nskipping: [tstmaoradbc01 -> 127.0.0.1] \nskipping: [tstmaoradbt01 -> 127.0.0.1] \nskipping: [tstmaoradbt02 -> 127.0.0.1] \nskipping: [tstmaoramqa01 -> 127.0.0.1] \nskipping: [tstmaoramqe01 -> 127.0.0.1] \nskipping: [tstmaoramem01 -> 127.0.0.1] \nskipping: [tstmaoradbu01 -> 127.0.0.1] \nskipping: [tstmaoramem02 -> 127.0.0.1] \nskipping: [tstmaorabix01 -> 127.0.0.1] \nskipping: [tstmaorarel01 -> 127.0.0.1] \nskipping: [tstmaorarex01 -> 127.0.0.1] \nskipping: [tstmaorarex02 -> 127.0.0.1] \nskipping: [tstmaorarex03 -> 127.0.0.1] \nskipping: [tstmaorarex04 -> 127.0.0.1] \nskipping: [tstmaoraetl01 -> 127.0.0.1] \nchanged: [tstmaorawsa01 -> 127.0.0.1] \nchanged: [tstmaoramax01 -> 127.0.0.1] \nchanged: [tstmaorauia02 -> 127.0.0.1] \nchanged: [tstmaorauiw01 -> 127.0.0.1] \nchanged: [tstmaoramwx01 -> 127.0.0.1] \nchanged: [tstmaorawss01 -> 127.0.0.1] \nchanged: [tstmaorawsl01 -> 127.0.0.1] \nchanged: [tstmaorawss02 -> 127.0.0.1] \nchanged: [tstmaorawsa02 -> 127.0.0.1] \nchanged: [tstmaorauia01 -> 127.0.0.1] \nchanged: [tstmaoramwx02 -> 127.0.0.1]\n```\n\n**Actual Results:**\n\n```\nTASK: [roles/lights_on | registering instance to its respective groups ELB] ***\nfailed: [tstmaorawss01 -> 127.0.0.1] => {\"failed\": true, \"parsed\": false}\ninvalid output was: Traceback (most recent call last):\n  File \"/Users/ndobbs/.ansible/tmp/ansible-tmp-1412091621.06-77576803493759/ec2_elb\", line 1874, in <module>\n    main()\n  File \"/Users/ndobbs/.ansible/tmp/ansible-tmp-1412091621.06-77576803493759/ec2_elb\", line 326, in main\n    elb_man.register(wait, enable_availability_zone, timeout)\n  File \"/Users/ndobbs/.ansible/tmp/ansible-tmp-1412091621.06-77576803493759/ec2_elb\", line 159, in register\n    self._await_elb_instance_state(lb, 'InService', initial_state, timeout)\n  File \"/Users/ndobbs/.ansible/tmp/ansible-tmp-1412091621.06-77576803493759/ec2_elb\", line 196, in _await_elb_instance_state\n    instance_state = self._get_instance_health(lb)\n  File \"/Users/ndobbs/.ansible/tmp/ansible-tmp-1412091621.06-77576803493759/ec2_elb\", line 244, in _get_instance_health\n    status = lb.get_instance_health([self.instance_id])[0]\n  File \"/Library/Python/2.7/site-packages/boto/ec2/elb/loadbalancer.py\", line 324, in get_instance_health\n    return self.connection.describe_instance_health(self.name, instances)\n  File \"/Library/Python/2.7/site-packages/boto/ec2/elb/__init__.py\", line 547, in describe_instance_health\n    [('member', InstanceState)])\n  File \"/Library/Python/2.7/site-packages/boto/connection.py\", line 1166, in get_list\n    raise self.ResponseError(response.status, response.reason, body)\nboto.exception.BotoServerError: BotoServerError: 400 Bad Request\n<ErrorResponse xmlns=\"http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/\">\n  <Error>\n    <Type>Sender</Type>\n    <Code>Throttling</Code>\n    <Message>Rate exceeded</Message>\n  </Error>\n  <RequestId>1a08966d-48b8-11e4-8ddc-e3515a48666b</RequestId>\n</ErrorResponse>\n```\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/264620912","html_url":"https://github.com/ansible/ansible-modules-core/issues/143#issuecomment-264620912","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/143","id":264620912,"user":{"login":"cooniur","id":3030052,"avatar_url":"https://avatars.githubusercontent.com/u/3030052?v=3","gravatar_id":"","url":"https://api.github.com/users/cooniur","html_url":"https://github.com/cooniur","followers_url":"https://api.github.com/users/cooniur/followers","following_url":"https://api.github.com/users/cooniur/following{/other_user}","gists_url":"https://api.github.com/users/cooniur/gists{/gist_id}","starred_url":"https://api.github.com/users/cooniur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cooniur/subscriptions","organizations_url":"https://api.github.com/users/cooniur/orgs","repos_url":"https://api.github.com/users/cooniur/repos","events_url":"https://api.github.com/users/cooniur/events{/privacy}","received_events_url":"https://api.github.com/users/cooniur/received_events","type":"User","site_admin":false},"created_at":"2016-12-03T06:29:12Z","updated_at":"2016-12-03T06:29:12Z","body":"Update: this issue happens in Ansible 2.x too."}}
{"actor":{"display_login":"cooniur"}}