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

[Storage] Improve UX for error message when bucket is not accessible #1857

Merged
merged 3 commits into from
Apr 14, 2023

Conversation

romilbhardwaj
Copy link
Collaborator

Changes the error message when a bucket is not accessible to focus on fix rather than the problem. Considered moving the root error (boto3/gcloud) to after our exception or removing it altogether, but decided it's better to let it come first, followed by our exception.

Before:

botocore.exceptions.ClientError: An error occurred (403) when calling the HeadBucket operation: Forbidden

The above exception was the direct cause of the following exception:

sky.exceptions.StorageBucketGetError: Failed to connect to an existing bucket 'mybucket'.
Please check if:
  1. the bucket name is taken and/or 
  2. the bucket permissions are not setup correctly. To debug, consider using aws s3 ls checkpoint.

After:

botocore.exceptions.ClientError: An error occurred (403) when calling the HeadBucket operation: Forbidden

The above exception was the direct cause of the following exception:

sky.exceptions.StorageBucketGetError: Failed to connect to an existing bucket 'mybucket'. This is likely because it is a private bucket you do not have access to.
To fix: 
  1. If you are trying to create a new bucket - use a different name.
  2. If you are trying to connect to an existing bucket - make sure you have access to it. To debug, consider running `aws s3 ls mybucket`.

Tested (run the relevant ones):

  • Test with a common bucket name like checkpoint for s3, gcs and r2.
  • Relevant individual smoke tests: pytest tests/test_smoke.py::TestStorageWithCredentials

Copy link
Member

@concretevitamin concretevitamin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @romilbhardwaj. A few nits.

sky/data/storage.py Outdated Show resolved Hide resolved
sky/data/storage.py Outdated Show resolved Hide resolved
sky/data/storage.py Outdated Show resolved Hide resolved
@romilbhardwaj
Copy link
Collaborator Author

Done, thanks! Merging now.

@romilbhardwaj romilbhardwaj merged commit a654870 into master Apr 14, 2023
@romilbhardwaj romilbhardwaj deleted the storage_errorux branch April 14, 2023 19:45
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

Successfully merging this pull request may close these issues.

2 participants