question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with Botocore and Personalize API Calls

See original GitHub issue

The 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:

  1. Install versions of libraries listed above
  2. 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:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
chriskingcommented, Oct 15, 2019

Thank you @swetashre !

Step to resolve:

rm -rf ~/.aws/models

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.

0reactions
swetashrecommented, Oct 15, 2019

@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 be AmazonPersonalize 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found