trying to connect to s3 without explicit credentials by running from ec2 with IAM role that allows access:
datahub = hub.s3('my-bucket').connect()
Traceback (most recent call last):
File "hub_load_s3.py", line 13, in <module>
imagenet = datahub.open('imagenet/test:latest')
File "/usr/local/lib/python3.6/dist-packages/hub/bucket.py", line 41, in open
jsontext = self._storage.get_or_none(os.path.join(name, "info.json"))
File "/usr/local/lib/python3.6/dist-packages/retrying.py", line 49, in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
File "/usr/local/lib/python3.6/dist-packages/retrying.py", line 212, in call
raise attempt.get()
File "/usr/local/lib/python3.6/dist-packages/retrying.py", line 247, in get
six.reraise(self.value[0], self.value[1], self.value[2])
File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/dist-packages/retrying.py", line 200, in call
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
File "/usr/local/lib/python3.6/dist-packages/hub/storage/retry_wrapper.py", line 30, in get_or_none
return self._internal.get_or_none(path)
File "/usr/local/lib/python3.6/dist-packages/hub/storage/s3.py", line 55, in get_or_none
raise err
File "/usr/local/lib/python3.6/dist-packages/hub/storage/s3.py", line 48, in get_or_none
Key=path,
File "/usr/local/lib/python3.6/dist-packages/botocore/client.py", line 357, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/local/lib/python3.6/dist-packages/botocore/client.py", line 661, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the GetObject operation: Access Denied
I do manage to access s3 from this machine just fine with aws-cli without configured credentials.