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

ClientError on Section 4.3 while trying to access S3 #1

Open
jacquesmats opened this issue Jul 7, 2020 · 1 comment
Open

ClientError on Section 4.3 while trying to access S3 #1

jacquesmats opened this issue Jul 7, 2020 · 1 comment

Comments

@jacquesmats
Copy link

I'm receiving the following error while following the steps from section 4.3:

`START RequestId: 70de6cc9-fe33-4833-aa88-1b026dfa597e Version: $LATEST
An error occurred (403) when calling the HeadObject operation: Forbidden: ClientError
Traceback (most recent call last):
File "/var/task/index.py", line 19, in handler
downloadFromS3(strBucket,'imagenet/inputimage.jpg',strFile)
File "/var/task/index.py", line 53, in downloadFromS3
s3_client.download_file(strBucket, strKey, strFile)
File "/var/runtime/boto3/s3/inject.py", line 172, in download_file
extra_args=ExtraArgs, callback=Callback)
File "/var/runtime/boto3/s3/transfer.py", line 307, in download_file
future.result()
File "/var/runtime/s3transfer/futures.py", line 106, in result
return self._coordinator.result()
File "/var/runtime/s3transfer/futures.py", line 265, in result
raise self._exception
File "/var/runtime/s3transfer/tasks.py", line 255, in _main
self._submit(transfer_future=transfer_future, **kwargs)
File "/var/runtime/s3transfer/download.py", line 343, in _submit
**transfer_future.meta.call_args.extra_args
File "/var/runtime/botocore/client.py", line 316, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/var/runtime/botocore/client.py", line 626, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (403) when calling the HeadObject operation: Forbidden

END RequestId: 70de6cc9-fe33-4833-aa88-1b026dfa597e
REPORT RequestId: 70de6cc9-fe33-4833-aa88-1b026dfa597e Duration: 198.06 ms Billed Duration: 200 ms Memory Size: 512 MB Max Memory Used: 186 MB
`

Seems like a permission problem between the IAM, Role and S3. But I can't figure out what is wrong. I guess there is some step missing from the tutorial. Any ideas?

@ryfeus
Copy link
Collaborator

ryfeus commented Jul 8, 2020

@jacquesmats thank you for the question. I've forgotten to make bucket serverlessdeeplearning public so that those elements would be available. I've updated permissions so now it should work. You can also use your own bucket. In this case, you would need to place the following files (from lesson3.4 https://github.com/PacktPublishing/Serverless-Deep-Learning-with-TensorFlow-and-AWS-Lambda/tree/master/lesson3.4):

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

No branches or pull requests

2 participants