delfick / bespin

Opinionated wrapper around boto that reads yaml
MIT License
6 stars 8 forks source link

Bespin raises errors when rate-limited #7

Closed jonhiggs closed 8 years ago

jonhiggs commented 8 years ago
Traceback (most recent call last):
  File ".bespin/bin/bespin", line 11, in <module>
    sys.exit(main())
  File ".bespin/lib/python3.4/site-packages/delfick_app.py", line 162, in main
    app.mainline(argv, **execute_args)
  File ".bespin/lib/python3.4/site-packages/delfick_app.py", line 230, in mainline
    self.execute(args_obj, args_dict, extra_args, handler, **execute_args)
  File ".bespin/lib/python3.4/site-packages/bespin/executor.py", line 31, in execute
    collector.configuration["task_runner"](collector.configuration["bespin"].chosen_task)
  File ".bespin/lib/python3.4/site-packages/bespin/task_finder.py", line 20, in task_runner
    return self.tasks[task].run(self.collector, self.stack_finder(task), available_actions, self.tasks, **kwargs)
  File ".bespin/lib/python3.4/site-packages/bespin/option_spec/task_objs.py", line 108, in run
    return task_action(collector, stack=stack, artifact=artifact, tasks=tasks, **extras)
  File ".bespin/lib/python3.4/site-packages/bespin/actions.py", line 106, in deploy
    Deployer().deploy_stack(stack, collector.configuration["stacks"])
  File ".bespin/lib/python3.4/site-packages/bespin/operations/deployer.py", line 44, in deploy_stack
    self.build_stack(stack)
  File ".bespin/lib/python3.4/site-packages/bespin/operations/deployer.py", line 83, in build_stack
    stack.cloudformation.wait(timeout=stack.build_timeout, rollback_is_failure=True)
  File ".bespin/lib/python3.4/site-packages/bespin/amazon/cloudformation.py", line 171, in wait
    events = description.describe_events()
  File ".bespin/lib/python3.4/site-packages/boto/cloudformation/stack.py", line 76, in describe_events
    next_token=next_token
  File ".bespin/lib/python3.4/site-packages/boto/cloudformation/connection.py", line 580, in describe_stack_events
    StackEvent)])
  File ".bespin/lib/python3.4/site-packages/boto/connection.py", line 1186, in get_list
    raise self.ResponseError(response.status, response.reason, body)
boto.exception.BotoServerError: BotoServerError: 400 Bad Request
<ErrorResponse xmlns="http://cloudformation.amazonaws.com/doc/2010-05-15/">
  <Error>
    <Type>Sender</Type>
    <Code>Throttling</Code>
    <Message>Rate exceeded</Message>
  </Error>
  <RequestId>xxxxxxxx-0062-11e6-9396-33252275e1d1</RequestId>
</ErrorResponse>
delfick commented 8 years ago

Looks like I dealt with that in getting the description of the stack, but not in getting the events themselves.

So I copied the same pattern in https://github.com/realestate-com-au/bespin/commit/4b18ea1301875c58bd04453a3d39c7d9e9211573 and bumped the version to 0.5.8.3