boto / boto3

AWS SDK for Python
https://aws.amazon.com/sdk-for-python/
Apache License 2.0
8.98k stars 1.86k forks source link

UnknownServiceError Unknown service: 'cognito-idp' #2250

Closed taschik closed 4 years ago

taschik commented 4 years ago

Hi,

We are encountering occasional the following error message in our backend that creates user account in AWS Cognito:

UnknownServiceError: Unknown service: 'cognito-idp'. Valid service names are: acm, acm-pca, amplify, apigateway, apigatewayv2, application-autoscaling, appmesh, appstream, appsync, athena, autoscaling, autoscaling-plans, backup, batch, budgets, ce, clouddirectory, cloudformation, cloudfront, cloudsearchdomain, cloudtrail, cloudwatch, codebuild, codeguruprofiler, codepipeline, codestar-notifications, cognito-identity, cognito-sync, comprehend, config, cur, dataexchange, datapipeline, dax, detective, devicefarm, directconnect,...
  File "django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
 ....
  File "__init__.py", line 91, in client
    return _get_default_session().client(*args, **kwargs)
  File "boto3/session.py", line 263, in client
    aws_session_token=aws_session_token, config=config)
  File "botocore/session.py", line 835, in create_client
    client_config=config, api_version=api_version)
  File "botocore/client.py", line 76, in create_client
    service_model = self._load_service_model(service_name, api_version)
  File "botocore/client.py", line 114, in _load_service_model
    api_version=api_version)
  File "botocore/loaders.py", line 132, in _wrapper
    data = func(self, *args, **kwargs)
  File "botocore/loaders.py", line 378, in load_service_model
    known_service_names=', '.join(sorted(known_services)))

We are running on:

boto3==1.10.24
botocore==1.13.24.
Python 3.7.5 (3.7.5 (default, Nov 23 2019, 06:10:46) [GCC 8.3.0])

It is working fine for most of the days but every other day or this exception is getting thrown. Any idea why and how to fix this?

Thanks a lot!

swetashre commented 4 years ago

@taschik - Thank you for your post. Can you please make sure your "botocore/data" directory contain the "cognito-idp" service model ? I can think of only this is a reason for the error. But as you mentioned it is giving error only on the other day i am wondering if your code is using different version of botocore or different model every time.

no-response[bot] commented 4 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.