aws / aws/amazon-sagemaker-examples

[Bug Report] Bucket s3://sagemaker-sample-data-<region> not available in some regions

Open
#3,933 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
11k
Forks
7k
Avg merge
8h 29m
Merged PRs (30d)
8

Description

**Link to the notebook**
https://github.com/aws/amazon-sagemaker-examples/blob/main/sagemaker_processing/basic_sagemaker_data_processing/basic_sagemaker_processing_outputs.ipynb

**Describe the bug**
I want to run this note book in af-south-1, but I got error
`botocore.exceptions.ClientError: An error occurred (403) when calling the HeadObject operation: Forbidden`.

I use the following command to test if the sample buckets are available in af-south-1, ap-northeast-3, and eu-south-1:

```
export region=xxx
aws s3 ls s3://sagemaker-sample-data-$region --region $region
```

I got:
```
af-south-1: Access Denied
ap-northeast-3: The specified bucket does not exist
eu-south-1: Access Denied
```

**To reproduce**
aws configure default region to be one of the three mentioned above. And run the ipynb.

Or use the command to check if sample buckets are available in the regions.
```
export region=xxx
aws s3 ls s3://sagemaker-sample-data-$region --region $region
```

**Logs**
```
Traceback (most recent call last):
File "/Users/rdpeng/Desktop/test.py", line 15, in
s3.download_file(
File "/Users/rdpeng/.pyenv/versions/3.8.16/lib/python3.8/site-packages/boto3/s3/inject.py", line 190, in download_file
return transfer.download_file(
File "/Users/rdpeng/.pyenv/versions/3.8.16/lib/python3.8/site-packages/boto3/s3/transfer.py", line 326, in download_file
future.result()
File "/Users/rdpeng/.pyenv/versions/3.8.16/lib/python3.8/site-packages/s3transfer/futures.py", line 103, in result
return self._coordinator.result()
File "/Users/rdpeng/.pyenv/versions/3.8.16/lib/python3.8/site-packages/s3transfer/futures.py", line 266, in result
raise self._exception
File "/Users/rdpeng/.pyenv/versions/3.8.16/lib/python3.8/site-packages/s3transfer/tasks.py", line 269, in _main
self._submit(transfer_future=transfer_future, **kwargs)
File "/Users/rdpeng/.pyenv/versions/3.8.16/lib/python3.8/site-packages/s3transfer/download.py", line 354, in _submit
response = client.head_object(
File "/Users/rdpeng/.pyenv/versions/3.8.16/lib/python3.8/site-packages/botocore/client.py", line 530, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/Users/rdpeng/.pyenv/versions/3.8.16/lib/python3.8/site-packages/botocore/client.py", line 960, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (403) when calling the HeadObject operation: Forbidden
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.