boto / botocore

The low-level, core functionality of boto3 and the AWS CLI.
Apache License 2.0
1.49k stars 1.09k forks source link

HTTP 500 on POST to CE GetRightsizingRecommendation #1803

Closed The1hauntedX closed 5 years ago

The1hauntedX commented 5 years ago

Calling GetRightsizingRecommendation from AWS CLI and Python Boto3 returns with an HTTP 500 error.

Request info:


2019-08-06 09:23:38,436 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://ce.us-east-1.amazonaws.com/, headers={
   'X-Amz-Target':b'AWSInsightsIndexService.GetRightsizingRecommendation',
   'Content-Type':b'application/x-amz-json-1.1',
   'User-Agent':b'aws-cli/1.16.208 Python/3.7.4 Darwin/18.2.0 botocore/1.12.198',
   'X-Amz-Date':b'20190806T142338Z',
   'X-Amz-Security-Token':redacted',
   'Authorization':b'AWS4-HMAC-SHA256 Credential=ASIAredacted/20190806/us-east-1/ce/aws4_request,
   SignedHeaders=content-type;host;x-amz-date;x-amz-security-token;x-amz-target,
   Signature=redacted',
   'Content-Length':'18'
}>
2019-08-06 09:23:38,436 - MainThread - urllib3.util.retry - DEBUG - Converted retries value: False -> Retry(total=False, connect=None, read=None, redirect=0, status=None)
2019-08-06 09:23:38,436 - MainThread - urllib3.connectionpool - DEBUG - Resetting dropped connection: ce.us-east-1.amazonaws.com
2019-08-06 09:23:38,632 - MainThread - urllib3.connectionpool - DEBUG - https://ce.us-east-1.amazonaws.com:443 "POST / HTTP/1.1" 500 28
2019-08-06 09:23:38,632 - MainThread - botocore.parsers - DEBUG - Response headers: {'x-amzn-RequestId': '9c56c13c-3e24-4d9e-88d5-5cd7c24f3ae9, dc6d113e-5a1d-4e25-a285-81b781d96a5c', 'Date': 'Tue, 06 Aug 2019 14:23:38 GMT', 'Connection': 'keep-alive, close', 'Content-Type': 'application/x-amz-json-1.1', 'Content-Length': '28'}
2019-08-06 09:23:38,632 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"__type":"InternalFailure"}'
swetashre commented 5 years ago

@The1hauntedX - Thank you for your post. I am not getting any error. Can you please provide us the exact code you are using to make the api call ?

I used this sample code to reproduce the issue :

response = client.get_rightsizing_recommendation(Service='AmazonEC2')    

Please note that AmazonEC2 is the only supported value for Service.

The1hauntedX commented 5 years ago

I had been attempting to use values as listed on the boto3 documentation:

Valid values for the SERVICE dimension are Amazon Elastic Compute Cloud - Compute, Amazon Elasticsearch Service, Amazon ElastiCache, Amazon Redshift, and Amazon Relational Database Service.

'AmazonEC2' appears to do the trick. Thank you for your assistance, @swetashre!