Issue with Botocore and Personalize API Calls
See original GitHub issueThe botocore API fails to properly allow for users to communicate with the Personalize service. Originally I thought this was an issue related to my local Python environment so I created a clean install of MacOS and reproduced.
Meta Information
(personalize) ➜ ~ pip freeze | grep boto
boto3==1.9.248
botocore==1.12.248
(personalize) ➜ ~ python --version
Python 3.7.3
Steps to Reproduce Error:
- Install versions of libraries listed above
- Execute the following:
ipython
import boto3
personalize = boto3.client('personalize')
personalize.list_schemas()
Output:
personalize.list_schemas()
---------------------------------------------------------------------------
ClientError Traceback (most recent call last)
<ipython-input-3-4bf9284f94ae> in <module>
----> 1 personalize.list_schemas()
~/personalize/lib/python3.7/site-packages/botocore/client.py in _api_call(self, *args, **kwargs)
355 "%s() only accepts keyword arguments." % py_operation_name)
356 # The "self" in this scope is referring to the BaseClient.
--> 357 return self._make_api_call(operation_name, kwargs)
358
359 _api_call.__name__ = str(py_operation_name)
~/personalize/lib/python3.7/site-packages/botocore/client.py in _make_api_call(self, operation_name, api_params)
659 error_code = parsed_response.get("Error", {}).get("Code")
660 error_class = self.exceptions.from_code(error_code)
--> 661 raise error_class(parsed_response, operation_name)
662 else:
663 return parsed_response
ClientError: An error occurred (UnknownOperationException) when calling the ListSchemas operation:
This was reported a while back with Forecast as well. I have yet to figure out exactly which versions would be good of botocore.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Personalize — Boto3 Docs 1.26.33 documentation - AWS
The campaign provides recommendations to a client through the GetRecommendations API. To train a model, Amazon Personalize requires training data and a recipe....
Read more >Troubleshoot common errors with API calls in Amazon ECS
The Amazon ECS APIs might fail with one of the following errors: AccessDeniedException; ClientException; ClusterNotFoundException ...
Read more >Boto3 documentation — Boto3 Docs 1.26.34 documentation
Boto3 documentation ¶. You use the AWS SDK for Python (Boto3) to create, configure, and manage AWS services, such as Amazon Elastic Compute...
Read more >Waiting for things to happen and paginating responses with ...
The AWS SDK for Python comprises two packages: boto3 and botocore. ... It supports paginators for many services and API calls that make...
Read more >AWS Quicksight Create Dashboard BOTO3 API Call Error
Based on the comment you left with your iam policy, you have nothing in Resource. You need at least "Resource": "*" - the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you @swetashre !
Step to resolve:
It looks like there was an out of date bit of info there. When I restored my credentials by copying over my old AWS folder it corrupted the new env.
@chrisking - Thanks for providing the debug log. It looks like when boto3 is making request for operational model the target header is wrong. In your case it is
'X-Amz-Target': 'AWSConciergeControlService.ListSchemas'
but it should be'X-Amz-Target': 'AmazonPersonalize.ListSchemas'
.Please make sure that the
targetPrefix
value should beAmazonPersonalize
in the/Users/chris/.aws/models/personalize/2018-05-22/service-2.json
file like this"targetPrefix":"AmazonPersonalize"
.Hope it helps and please let me know if you have any questions.