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

unhandled exception polling TrustedAdvisor #155

Closed
jantman opened this issue Mar 11, 2016 · 3 comments
Closed

unhandled exception polling TrustedAdvisor #155

jantman opened this issue Mar 11, 2016 · 3 comments
Labels

Comments

@jantman
Copy link
Owner

jantman commented Mar 11, 2016

This appears to have just started in the last 24 hours. While polling Trusted Advisor with awslimitchecker 0.3.1:

INFO:botocore.credentials:Found credentials in environment variables.
INFO:awslimitchecker.connectable:Connected to support in region us-east-1
INFO:awslimitchecker.trustedadvisor:Beginning TrustedAdvisor poll
INFO:botocore.vendored.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): support.us-east-1.amazonaws.com
Traceback (most recent call last):
  File "/home/jantman/GIT/awslimitchecker/docs/build_generated_docs.py", line 309, in <module>
    build_docs()
  File "/home/jantman/GIT/awslimitchecker/docs/build_generated_docs.py", line 305, in build_docs
    build_limits(c)
  File "/home/jantman/GIT/awslimitchecker/docs/build_generated_docs.py", line 100, in build_limits
    limits = checker.get_limits()
  File "/home/jantman/GIT/awslimitchecker/docs/../awslimitchecker/checker.py", line 179, in get_limits
    self.ta.update_limits()
  File "/home/jantman/GIT/awslimitchecker/docs/../awslimitchecker/trustedadvisor.py", line 113, in update_limits
    ta_results = self._poll()
  File "/home/jantman/GIT/awslimitchecker/docs/../awslimitchecker/trustedadvisor.py", line 152, in _poll
    if check['region'] != region:
KeyError: 'region'

or

INFO:botocore.credentials:Found credentials in environment variables.
INFO:botocore.vendored.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): support.us-east-1.amazonaws.com
Checking AWS resource usage; WARNING threshold 80% of limit, CRITICAL threshold 99% of limit
Traceback (most recent call last):
  File "./check_aws_limits.py", line 289, in <module>
    checker.run(error_on_warning=args.error_on_warning, verbose=args.verbose)
  File "./check_aws_limits.py", line 249, in run
    warnings, criticals = self.run_for_regions(regions, verbose=verbose)
  File "./check_aws_limits.py", line 230, in run_for_regions
    w, c = self.run_for_region(region=region, verbose=verbose)
  File "./check_aws_limits.py", line 201, in run_for_region
    return self.check_limits(region, verbose=verbose)
  File "./check_aws_limits.py", line 141, in check_limits
    checker.check_thresholds()
  File "/home/ec2-user/jenkins/workspace/ReleaseEngineering/awslimitchecker/awslimitchecker_dev/lib/python2.7/site-packages/awslimitchecker/checker.py", line 413, in check_thresholds
    self.ta.update_limits()
  File "/home/ec2-user/jenkins/workspace/ReleaseEngineering/awslimitchecker/awslimitchecker_dev/lib/python2.7/site-packages/awslimitchecker/trustedadvisor.py", line 113, in update_limits
    ta_results = self._poll()
  File "/home/ec2-user/jenkins/workspace/ReleaseEngineering/awslimitchecker/awslimitchecker_dev/lib/python2.7/site-packages/awslimitchecker/trustedadvisor.py", line 152, in _poll
    if check['region'] != region:
KeyError: 'region'

The problem is here; it seems that the TA DescribeTrustedAdvisorCheckResult API action is now returning checks without a region, even though the API docs for the TrustedAdvisorResourceDetail type still show region as a required element.

I can't find any recent release notes for Support or Trusted Advisor...

@jantman jantman added the bug label Mar 11, 2016
@jantman
Copy link
Owner Author

jantman commented Mar 12, 2016

It appears that sometime in the past few days (specifically, between Thu, 10 Mar 2016 07:00:00 GMT and Fri, 11 Mar 2016 07:00:00 GMT for the account I'm testing with) Trusted Advisor rolled out five new checks for IAM-related things. These checks lack the region dictionary key that is marked as Required in the TrustedAdvisorResourceDetail API documentation.

Example of these checks:

{'status': 'ok', 'resourceId': 'x', 'isSuppressed': False, 'metadata': ['-', 'IAM', 'Instance profiles', '500', '394', 'Green']}
{'status': 'ok', 'resourceId': 'x', 'isSuppressed': False, 'metadata': ['-', 'IAM', 'Roles', '500', '375', 'Green']}
{'status': 'ok', 'resourceId': 'x', 'isSuppressed': False, 'metadata': ['-', 'IAM', 'Groups', '100', '25', 'Green']}
{'status': 'ok', 'resourceId': 'x', 'isSuppressed': False, 'metadata': ['-', 'IAM', 'Users', '5000', '152', 'Green']}
{'status': 'ok', 'resourceId': 'x', 'isSuppressed': False, 'metadata': ['-', 'IAM', 'Server certificates', '100', '55', 'Green']}

jantman added a commit that referenced this issue Mar 12, 2016
…the (required, per API docs) region field
@jantman jantman mentioned this issue Mar 12, 2016
jantman added a commit that referenced this issue Mar 12, 2016
@jmetzmeier
Copy link

👍 thanks for the fix

@jantman
Copy link
Owner Author

jantman commented Mar 13, 2016

Any time :)

I put in a rather strongly-worded support request on $EMPLOYER's largest AWS account, inquiring about both violating the published API, and not announcing or documenting the change...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants