toil
toil copied to clipboard
Permission check unable to get role policy
[2022-09-29T11:36:25-0700] [MainThread] [E] [toil.lib.aws.iam] Exception when trying to get role policies
Traceback (most recent call last):
File "/home/lukas/Desktop/toil/src/toil/lib/aws/iam.py", line 226, in get_policy_permissions
user = iam.get_user()
File "/home/lukas/Desktop/toil/venv/lib/python3.10/site-packages/botocore/client.py", line 508, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/home/lukas/Desktop/toil/venv/lib/python3.10/site-packages/botocore/client.py", line 911, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (ValidationError) when calling the GetUser operation: Must specify userName when calling with non-User credentials
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/lukas/Desktop/toil/src/toil/lib/aws/iam.py", line 244, in get_policy_permissions
role_attached_policies = allowed_actions_attached(iam, attached_policies['AttachedPolicies'])
File "/home/lukas/Desktop/toil/src/toil/lib/aws/iam.py", line 162, in allowed_actions_attached
policy_document = json.loads(policy_ver['PolicyVersion']['Document'])
File "/usr/lib/python3.10/json/__init__.py", line 339, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not dict
┆Issue is synchronized with this Jira Story ┆friendlyId: TOIL-1227
issue seen in commit 21820af3777faf13f7831511d3b9ff2bbcf850bd when trying to launch cluster