Recently, there have been a lot of issues with getting AWS CLI to work properly with S3. The common response given was Errno 2 No such file or directory
For sanity sake, the version is:
CLI version: aws-cli/1.15.83 Python/2.7.14 Linux/4.14.67-66.56.amzn1.x86_64 botocore/1.10.82
Running debug: aws s3 ls --debug
we are able to identify the culprit:
SSLError: [Errno 2] No such file or directory
Okay, this is telling us the error is coming from SSL and that it’s not an AWS CLI issue at all.
Doing some research, I found this comment by maludwig that explains there are files missing from /etc/pki/tls/certs
.
To verify this was my issue, I confirmed his hypothesis:
Great! At least now I know what the issue is. Following the rest of his comment, I ran:
sudo update-ca-trust force-enable sudo update-ca-trust extract
This did give me this response:
cp: cannot stat ‘/etc/pki/tls/certs/ca-bundle.crt’: No such file or directory cp: cannot stat ‘/etc/pki/tls/certs/ca-bundle.trust.crt’: No such file or directory cp: cannot stat ‘/etc/pki/tls/certs/ca-bundle.crt’: No such file or directory cp: cannot stat ‘/etc/pki/tls/certs/ca-bundle.trust.crt’: No such file or directory
Which confims the issue.
I ran sudo update-ca-trust force-enable
again but I don’t think it was necessary.
I confirmed my certs we in place.
With that issue now resolved, I ran a simple check to be sure this was working now: aws s3 ls
and it now works!