Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

traceback from iam instance profile load #574

Closed
wt opened this issue Mar 30, 2016 · 0 comments
Closed

traceback from iam instance profile load #574

wt opened this issue Mar 30, 2016 · 0 comments

Comments

@wt
Copy link

wt commented Mar 30, 2016

I have the following code

profile = iam.InstanceProfile(role_name)
provile.load()

where role_name is a instance_profile that does not exist.

I get the following traceback occasionally (but not always):

Traceback (most recent call last):
...
  File "/path/to/util.py", line 332, in iam_instance_profile_exists
    profile.load()
  File "/home/wt/.virtualenvs/sf/local/lib/python2.7/site-packages/boto3/resources/factory.py", line 483, in do_action
    response = action(self, *args, **kwargs)
  File "/home/wt/.virtualenvs/sf/local/lib/python2.7/site-packages/boto3/resources/action.py", line 83, in __call__
    response = getattr(parent.meta.client, operation_name)(**params)
  File "/home/wt/.virtualenvs/sf/local/lib/python2.7/site-packages/botocore/client.py", line 228, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/home/wt/.virtualenvs/sf/local/lib/python2.7/site-packages/botocore/client.py", line 481, in _make_api_call
    operation_model, request_dict)
  File "/home/wt/.virtualenvs/sf/local/lib/python2.7/site-packages/botocore/endpoint.py", line 117, in make_request
    return self._send_request(request_dict, operation_model)
  File "/home/wt/.virtualenvs/sf/local/lib/python2.7/site-packages/botocore/endpoint.py", line 157, in _send_request
    request, operation_model, attempts)
  File "/home/wt/.virtualenvs/sf/local/lib/python2.7/site-packages/botocore/endpoint.py", line 203, in _get_response
    parser.parse(response_dict, operation_model.output_shape)),
  File "/home/wt/.virtualenvs/sf/local/lib/python2.7/site-packages/botocore/parsers.py", line 209, in parse
    parsed = self._do_error_parse(response, shape)
  File "/home/wt/.virtualenvs/sf/local/lib/python2.7/site-packages/botocore/parsers.py", line 433, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/home/wt/.virtualenvs/sf/local/lib/python2.7/site-packages/botocore/parsers.py", line 385, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (no element found: line 1, column 0), invalid XML received:

However, I can immediately run the same script again and not get that exception. I expect to get something similar to the following exception:

...
botocore.exceptions.ClientError: An error occurred (NoSuchEntity) when calling the GetInstanceProfile operation: Instance Profile some-instance-profile cannot be found.

Do you have any idea what's going on or how I can work around it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant