botocore.exceptions.DataNotFoundError: Unable to load data for: ec2/2016-09-15/service-2
See original GitHub issueThis issue started happening when we upgraded to boto3 1.4.1. When we try to create a ec2 resource from a boto3 session, we are getting this error
botocore.exceptions.DataNotFoundError: Unable to load data for: ec2/2016-09-15/service-2
The code we use to reproduce this issue is
import boto3
role_arn_to_assume = 'arn:aws:iam::xxxxxxxxxx:role/some-role-name'
sts_client = boto3.client('sts')
assumed_role = sts_client.assume_role(
RoleArn=role_arn_to_assume,
RoleSessionName='some-session-name'
)
new_creds = assumed_role['Credentials']
session_args = {
'aws_access_key_id': new_creds['AccessKeyId'],
'aws_secret_access_key': new_creds['SecretAccessKey'],
'aws_session_token': new_creds['SessionToken'],
}
session = boto3.session.Session(**session_args)
ec2_resource = session.resource('ec2')
When I run this code with 1.4.1, it gives the following error:
Traceback (most recent call last):
File "/my/folder/workspace/my_script.py", line xxx, in <module>
ec2_resource = session.resource('ec2')
File "/my/folder/my-virtualenv/lib/python2.7/site-packages/boto3/session.py", line 389, in resource
aws_session_token=aws_session_token, config=config)
File "/my/folder/my-virtualenv/lib/python2.7/site-packages/boto3/session.py", line 263, in client
aws_session_token=aws_session_token, config=config)
File "/my/folder/my-virtualenv/lib/python2.7/site-packages/botocore/session.py", line 824, in create_client
client_config=config, api_version=api_version)
File "/my/folder/my-virtualenv/lib/python2.7/site-packages/botocore/client.py", line 61, in create_client
service_model = self._load_service_model(service_name, api_version)
File "/my/folder/my-virtualenv/lib/python2.7/site-packages/botocore/client.py", line 91, in _load_service_model
api_version=api_version)
File "/my/folder/my-virtualenv/lib/python2.7/site-packages/botocore/loaders.py", line 123, in _wrapper
data = func(self, *args, **kwargs)
File "/my/folder/my-virtualenv/lib/python2.7/site-packages/botocore/loaders.py", line 358, in load_service_model
return self.load_data(full_path)
File "/my/folder/my-virtualenv/lib/python2.7/site-packages/botocore/loaders.py", line 123, in _wrapper
data = func(self, *args, **kwargs)
File "/my/folder/my-virtualenv/lib/python2.7/site-packages/botocore/loaders.py", line 382, in load_data
raise DataNotFoundError(data_path=name)
botocore.exceptions.DataNotFoundError: Unable to load data for: ec2/2016-09-15/service-2
If I run it with previous release 1.4.0, it works fine.
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (1 by maintainers)
Top Results From Across the Web
botocore.exceptions.DataNotFoundError: Unable to load ...
The DataNotFoundError exception is very misleading but is indeed caused by your failure to provide keyword arguments correctly.
Read more >boto3 S3 in Windows COM object
I've worked around the problem where boto3 needs to know where some external files: ... DataNotFoundError: Unable to load data for: endpoints
Read more >boto/boto3 - Gitter
Greetings, I am newbie on boto3 sdk on AWS AMI, I tried to run basic s3 service, but seeing "botocore.exceptions.ClientError: An error occurred...
Read more >Boto3 and PyInstaller – Getting DataNotFoundError only in ...
Hi, I'm working on a project in python that uses boto3 and I've recently come across an issue ... DataNotFoundError: Unable to load...
Read more >Python botocore.exceptions.DataNotFoundError() Examples
def load_data(self, name): """Load data given a data path. This is a low level method that will search through the various search paths...
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
Some other teammates found that this error even happens with simple code like
the workaround they found was to rewrite that line to be
I had a similar
DataNotFoundError
with the kinesis client, where the erroring item wasendpoints
.Adding
api_version='2016-04-01'
to the client instaniation did not help…