-
Notifications
You must be signed in to change notification settings - Fork 541
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
[AWS] Add identity info when check fails #2456
Changes from 6 commits
feb1b18
ae62f0c
316b667
e40011a
d82df7a
badd220
016a74b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
import pandas as pd | ||
|
||
from sky.adaptors import aws | ||
from sky.utils import common_utils | ||
from sky.utils import ux_utils | ||
|
||
# Enable most of the regions. Each user's account may have a subset of these | ||
|
@@ -133,10 +134,12 @@ def _get_availability_zones(region: str) -> Optional[pd.DataFrame]: | |
elif e.response['Error']['Code'] == 'UnauthorizedOperation': | ||
with ux_utils.print_exception_no_traceback(): | ||
raise RuntimeError( | ||
'Failed to retrieve availability zone. ' | ||
'Failed to retrieve availability zones. ' | ||
'Please ensure that the `ec2:DescribeAvailabilityZones` ' | ||
'action is enabled for your AWS account in IAM. ' | ||
'Ref: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeAvailabilityZones.html' # pylint: disable=line-too-long | ||
'Ref: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeAvailabilityZones.html.\n' # pylint: disable=line-too-long | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some more detail on this raise would be good - currently just recieve the error: "Details: [botocore.exceptions.ClientError] An error occurred (UnauthorizedOperation) when calling the DescribeAvailabilityZones operation: You are not authorized to perform this operation." despite: Can you log the account at this point also? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the comment @TRT-BradleyB! The upper-level caller in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did think that was the intention, this is the extent of the message I recieve:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, this is weird. I did see the following messages when running $ sky check
Checking credentials to enable clouds for SkyPilot.
Checking AWS...I 08-24 10:09:34 aws_catalog.py:79] Fetching availability zones mapping for AWS...
AWS: disabled
Reason: Failed to fetch the availability zones for the account ['my-account', 'my-account']. It is likely due to permission issues, please check the minimal permission required for AWS: https://skypilot.readthedocs.io/en/latest/cloud-setup/cloud-permissions/aws.html
Details: [builtins.RuntimeError] Failed to retrieve availability zones. Please ensure that the `ec2:DescribeAvailabilityZones` action is enabled for your AWS account in IAM. Ref: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeAvailabilityZones.html. Details: [botocore.exceptions.ClientError] ... Just to confirm, is the error you shown from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah - no that's my bad I was running There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for confirming! Merging this for now, and we can continue the discussion in #2451 for the availability zones permission issue. ; ) |
||
'Details: ' | ||
f'{common_utils.format_exception(e, use_bracket=True)}' | ||
) from None | ||
else: | ||
raise | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a list of strings. We probably don't want to add
!r