Aws-cli: Errno 2 No such file or directory

Created on 30 Jun 2017  路  22Comments  路  Source: aws/aws-cli

Hi everyone,

Im new here so please forgive me if i make obvious mistakes.

So i was trying to use the aws cli tools on my amazon linux machine to transfer a file to an s3 bucket but i kept getting the [Errno2] No such file or directory.

To troubleshoot, i attempted this command "aws ec2 describe-instances" and got the same error.

"aws help" works though.Please i have run out of ideas ,someone help me :(

Most helpful comment

Also have same issue on Windows.

aws --version aws-cli/1.11.160 Python/2.7.9 Windows/2008Server botocore/1.7.18

Fix found here ->https://github.com/aws/aws-cli/issues/2855
copy "c:\Program Files\Amazon\AWSCLI\botocore\vendored\requests\cacert.pem" "c:\Program Files\Amazon\AWSCLI\certifi"

All 22 comments

Can you run the command that gets the issue with the --debug flag added and post the output here?

Hello thanks for the response, this is the output ,i kept seeing something about an SSLError :

2017-07-01 09:08:51,145 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/1.11.83 Python/2.7.12 Linux/4.4.30-32.54.amzn1.x86_64 botocore/1.5.46
2017-07-01 09:08:51,145 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['ec2', 'describe-instances', '--debug']
2017-07-01 09:08:51,145 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler
2017-07-01 09:08:51,145 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler
2017-07-01 09:08:51,150 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/lib/python2.7/dist-packages/botocore/data/ec2/2016-11-15/service-2.json
2017-07-01 09:08:51,239 - MainThread - botocore.hooks - DEBUG - Event service-data-loaded.ec2: calling handler
2017-07-01 09:08:51,239 - MainThread - botocore.handlers - DEBUG - Registering retry handlers for service: ec2
2017-07-01 09:08:51,247 - MainThread - botocore.hooks - DEBUG - Event building-command-table.ec2: calling handler
2017-07-01 09:08:51,247 - MainThread - awscli.customizations.removals - DEBUG - Removing operation: import-instance
2017-07-01 09:08:51,247 - MainThread - awscli.customizations.removals - DEBUG - Removing operation: import-volume
2017-07-01 09:08:51,247 - MainThread - botocore.hooks - DEBUG - Event building-command-table.ec2: calling handler
2017-07-01 09:08:51,249 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/lib/python2.7/dist-packages/botocore/data/ec2/2016-11-15/waiters-2.json
2017-07-01 09:08:51,252 - MainThread - awscli.clidriver - DEBUG - OrderedDict([(u'dry-run', ), (u'no-dry-run', ), (u'instance-ids', ), (u'filters', ), (u'next-token', ), (u'max-results', )])
2017-07-01 09:08:51,252 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.describe-instances: calling handler
2017-07-01 09:08:51,253 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.describe-instances: calling handler
2017-07-01 09:08:51,253 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.describe-instances: calling handler
2017-07-01 09:08:51,253 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.describe-instances: calling handler
2017-07-01 09:08:51,253 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.describe-instances: calling handler
2017-07-01 09:08:51,253 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.describe-instances: calling handler
2017-07-01 09:08:51,255 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/lib/python2.7/dist-packages/botocore/data/ec2/2016-11-15/paginators-1.json
2017-07-01 09:08:51,256 - MainThread - awscli.customizations.paginate - DEBUG - Modifying paging parameters for operation: DescribeInstances
2017-07-01 09:08:51,256 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.describe-instances: calling handler
2017-07-01 09:08:51,256 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.ec2.describe-instances: calling handler >
2017-07-01 09:08:51,256 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.ec2.describe-instances: calling handler >
2017-07-01 09:08:51,257 - MainThread - botocore.hooks - DEBUG - Event operation-args-parsed.ec2.describe-instances: calling handler
2017-07-01 09:08:51,258 - MainThread - botocore.hooks - DEBUG - Event operation-args-parsed.ec2.describe-instances: calling handler
2017-07-01 09:08:51,258 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.describe-instances.dry-run: calling handler
2017-07-01 09:08:51,258 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.describe-instances.instance-ids: calling handler
2017-07-01 09:08:51,258 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.describe-instances.filters: calling handler
2017-07-01 09:08:51,258 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.describe-instances.next-token: calling handler
2017-07-01 09:08:51,258 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.describe-instances.max-results: calling handler
2017-07-01 09:08:51,258 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.describe-instances.cli-input-json: calling handler
2017-07-01 09:08:51,259 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.describe-instances.starting-token: calling handler
2017-07-01 09:08:51,259 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.describe-instances.page-size: calling handler
2017-07-01 09:08:51,259 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.describe-instances.max-items: calling handler
2017-07-01 09:08:51,259 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.describe-instances.generate-cli-skeleton: calling handler
2017-07-01 09:08:51,259 - MainThread - botocore.hooks - DEBUG - Event calling-command.ec2.describe-instances: calling handler >
2017-07-01 09:08:51,259 - MainThread - botocore.hooks - DEBUG - Event calling-command.ec2.describe-instances: calling handler >
2017-07-01 09:08:51,259 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: env
2017-07-01 09:08:51,259 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role
2017-07-01 09:08:51,259 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: shared-credentials-file
2017-07-01 09:08:51,260 - MainThread - botocore.credentials - INFO - Found credentials in shared credentials file: ~/.aws/credentials
2017-07-01 09:08:51,260 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/lib/python2.7/dist-packages/botocore/data/endpoints.json
2017-07-01 09:08:51,274 - MainThread - botocore.client - DEBUG - Registering retry handlers for service: ec2
2017-07-01 09:08:51,283 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.ec2: calling handler
2017-07-01 09:08:51,283 - MainThread - botocore.args - DEBUG - The s3 config key is not a dictionary type, ignoring its value of: None
2017-07-01 09:08:51,287 - MainThread - botocore.endpoint - DEBUG - Setting ec2 timeout as (60, 60)
2017-07-01 09:08:51,288 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.ec2.DescribeInstances: calling handler >
2017-07-01 09:08:51,288 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.ec2.DescribeInstances: calling handler
2017-07-01 09:08:51,288 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=DescribeInstances) (verify_ssl=True) with params: {'body': {'Action': u'DescribeInstances', 'Version': u'2016-11-15'}, 'url': u'https://ec2.eu-west-1.amazonaws.com/', 'headers': {'User-Agent': 'aws-cli/1.11.83 Python/2.7.12 Linux/4.4.30-32.54.amzn1.x86_64 botocore/1.5.46'}, 'context': {'auth_type': None, 'client_region': 'eu-west-1', 'has_streaming_input': False, 'client_config': }, 'query_string': '', 'url_path': '/', 'method': u'POST'}
2017-07-01 09:08:51,289 - MainThread - botocore.hooks - DEBUG - Event request-created.ec2.DescribeInstances: calling handler >
2017-07-01 09:08:51,289 - MainThread - botocore.hooks - DEBUG - Event choose-signer.ec2.DescribeInstances: calling handler
2017-07-01 09:08:51,289 - MainThread - botocore.auth - DEBUG - Calculating signature using v4 auth.
2017-07-01 09:08:51,289 - MainThread - botocore.auth - DEBUG - CanonicalRequest:
POST
/

host:ec2.eu-west-1.amazonaws.com
x-amz-date:20170701T090851Z

host;x-amz-date
6171eb09865e32b0602af0f7957e26573a51f53caaedff02ff88883cb0275885
2017-07-01 09:08:51,290 - MainThread - botocore.auth - DEBUG - StringToSign:
AWS4-HMAC-SHA256
20170701T090851Z
20170701/eu-west-1/ec2/aws4_request
a43be826f784ce50d98b8761e4fa7cd703e0638d97ea8eaa3726d6211270ca95
2017-07-01 09:08:51,290 - MainThread - botocore.auth - DEBUG - Signature:
c0b2b51e0f372d5906a7fde244555e93daf7d891bb5a569ceb973acda98da86b
2017-07-01 09:08:51,291 - MainThread - botocore.endpoint - DEBUG - Sending http request: 2017-07-01 09:08:51,292 - MainThread - botocore.vendored.requests.packages.urllib3.connectionpool - INFO - Starting new HTTPS connection (1): ec2.eu-west-1.amazonaws.com
2017-07-01 09:08:51,298 - MainThread - botocore.endpoint - DEBUG - ConnectionError received when sending HTTP request.
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/botocore/endpoint.py", line 204, in _get_response
proxies=self.proxies, timeout=self.timeout)
File "/usr/lib/python2.7/dist-packages/botocore/vendored/requests/sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/dist-packages/botocore/vendored/requests/adapters.py", line 431, in send
raise SSLError(e, request=request)
SSLError: [Errno 2] No such file or directory
2017-07-01 09:08:51,301 - MainThread - botocore.hooks - DEBUG - Event needs-retry.ec2.DescribeInstances: calling handler
2017-07-01 09:08:51,301 - MainThread - botocore.retryhandler - DEBUG - retry needed, retryable exception caught: [Errno 2] No such file or directory
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 269, in _should_retry
return self._checker(attempt_number, response, caught_exception)
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 317, in __call__
caught_exception)
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 223, in __call__
attempt_number, caught_exception)
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 359, in _check_caught_exception
raise caught_exception
SSLError: [Errno 2] No such file or directory
2017-07-01 09:08:51,302 - MainThread - botocore.retryhandler - DEBUG - Retry needed, action of: 0.301706806121
2017-07-01 09:08:51,302 - MainThread - botocore.endpoint - DEBUG - Response received to retry, sleeping for 0.301706806121 seconds
2017-07-01 09:08:51,605 - MainThread - botocore.hooks - DEBUG - Event request-created.ec2.DescribeInstances: calling handler >
2017-07-01 09:08:51,605 - MainThread - botocore.hooks - DEBUG - Event choose-signer.ec2.DescribeInstances: calling handler
2017-07-01 09:08:51,606 - MainThread - botocore.auth - DEBUG - Calculating signature using v4 auth.
2017-07-01 09:08:51,606 - MainThread - botocore.auth - DEBUG - CanonicalRequest:
POST
/

host:ec2.eu-west-1.amazonaws.com
x-amz-date:20170701T090851Z

host;x-amz-date
6171eb09865e32b0602af0f7957e26573a51f53caaedff02ff88883cb0275885
2017-07-01 09:08:51,606 - MainThread - botocore.auth - DEBUG - StringToSign:
AWS4-HMAC-SHA256
20170701T090851Z
20170701/eu-west-1/ec2/aws4_request
a43be826f784ce50d98b8761e4fa7cd703e0638d97ea8eaa3726d6211270ca95
2017-07-01 09:08:51,606 - MainThread - botocore.auth - DEBUG - Signature:
c0b2b51e0f372d5906a7fde244555e93daf7d891bb5a569ceb973acda98da86b
2017-07-01 09:08:51,606 - MainThread - botocore.endpoint - DEBUG - Sending http request: 2017-07-01 09:08:51,607 - MainThread - botocore.vendored.requests.packages.urllib3.connectionpool - INFO - Starting new HTTPS connection (2): ec2.eu-west-1.amazonaws.com
2017-07-01 09:08:51,613 - MainThread - botocore.endpoint - DEBUG - ConnectionError received when sending HTTP request.
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/botocore/endpoint.py", line 204, in _get_response
proxies=self.proxies, timeout=self.timeout)
File "/usr/lib/python2.7/dist-packages/botocore/vendored/requests/sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/dist-packages/botocore/vendored/requests/adapters.py", line 431, in send
raise SSLError(e, request=request)
SSLError: [Errno 2] No such file or directory
2017-07-01 09:08:51,614 - MainThread - botocore.hooks - DEBUG - Event needs-retry.ec2.DescribeInstances: calling handler
2017-07-01 09:08:51,614 - MainThread - botocore.retryhandler - DEBUG - retry needed, retryable exception caught: [Errno 2] No such file or directory
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 269, in _should_retry
return self._checker(attempt_number, response, caught_exception)
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 317, in __call__
caught_exception)
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 223, in __call__
attempt_number, caught_exception)
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 359, in _check_caught_exception
raise caught_exception
SSLError: [Errno 2] No such file or directory
2017-07-01 09:08:51,614 - MainThread - botocore.retryhandler - DEBUG - Retry needed, action of: 0.473197282381
2017-07-01 09:08:51,614 - MainThread - botocore.endpoint - DEBUG - Response received to retry, sleeping for 0.473197282381 seconds
2017-07-01 09:08:52,088 - MainThread - botocore.hooks - DEBUG - Event request-created.ec2.DescribeInstances: calling handler >
2017-07-01 09:08:52,088 - MainThread - botocore.hooks - DEBUG - Event choose-signer.ec2.DescribeInstances: calling handler
2017-07-01 09:08:52,089 - MainThread - botocore.auth - DEBUG - Calculating signature using v4 auth.
2017-07-01 09:08:52,089 - MainThread - botocore.auth - DEBUG - CanonicalRequest:
POST
/

host:ec2.eu-west-1.amazonaws.com
x-amz-date:20170701T090852Z

host;x-amz-date
6171eb09865e32b0602af0f7957e26573a51f53caaedff02ff88883cb0275885
2017-07-01 09:08:52,089 - MainThread - botocore.auth - DEBUG - StringToSign:
AWS4-HMAC-SHA256
20170701T090852Z
20170701/eu-west-1/ec2/aws4_request
2eeb1b659b678e8a351efb91f519eedb5a062a589e9a8fc17c7a4c3ba76edd1e
2017-07-01 09:08:52,089 - MainThread - botocore.auth - DEBUG - Signature:
a60b53319f0f7b65fb03fff61e64bb9c5fd8bb3fcc530fe21762b4be21a22168
2017-07-01 09:08:52,090 - MainThread - botocore.endpoint - DEBUG - Sending http request: 2017-07-01 09:08:52,090 - MainThread - botocore.vendored.requests.packages.urllib3.connectionpool - INFO - Starting new HTTPS connection (3): ec2.eu-west-1.amazonaws.com
2017-07-01 09:08:52,094 - MainThread - botocore.endpoint - DEBUG - ConnectionError received when sending HTTP request.
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/botocore/endpoint.py", line 204, in _get_response
proxies=self.proxies, timeout=self.timeout)
File "/usr/lib/python2.7/dist-packages/botocore/vendored/requests/sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/dist-packages/botocore/vendored/requests/adapters.py", line 431, in send
raise SSLError(e, request=request)
SSLError: [Errno 2] No such file or directory
2017-07-01 09:08:52,094 - MainThread - botocore.hooks - DEBUG - Event needs-retry.ec2.DescribeInstances: calling handler
2017-07-01 09:08:52,094 - MainThread - botocore.retryhandler - DEBUG - retry needed, retryable exception caught: [Errno 2] No such file or directory
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 269, in _should_retry
return self._checker(attempt_number, response, caught_exception)
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 317, in __call__
caught_exception)
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 223, in __call__
attempt_number, caught_exception)
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 359, in _check_caught_exception
raise caught_exception
SSLError: [Errno 2] No such file or directory
2017-07-01 09:08:52,094 - MainThread - botocore.retryhandler - DEBUG - Retry needed, action of: 3.40183456414
2017-07-01 09:08:52,094 - MainThread - botocore.endpoint - DEBUG - Response received to retry, sleeping for 3.40183456414 seconds
2017-07-01 09:08:55,498 - MainThread - botocore.hooks - DEBUG - Event request-created.ec2.DescribeInstances: calling handler >
2017-07-01 09:08:55,499 - MainThread - botocore.hooks - DEBUG - Event choose-signer.ec2.DescribeInstances: calling handler
2017-07-01 09:08:55,499 - MainThread - botocore.auth - DEBUG - Calculating signature using v4 auth.
2017-07-01 09:08:55,499 - MainThread - botocore.auth - DEBUG - CanonicalRequest:
POST
/

host:ec2.eu-west-1.amazonaws.com
x-amz-date:20170701T090855Z

host;x-amz-date
6171eb09865e32b0602af0f7957e26573a51f53caaedff02ff88883cb0275885
2017-07-01 09:08:55,499 - MainThread - botocore.auth - DEBUG - StringToSign:
AWS4-HMAC-SHA256
20170701T090855Z
20170701/eu-west-1/ec2/aws4_request
97491a30ee7020a08942beb001579ee89f35e16c630feba39d89ae2379827425
2017-07-01 09:08:55,500 - MainThread - botocore.auth - DEBUG - Signature:
b3c46c182fa11229e880a441fa5e746eb1e85557f30426ca4cb6b7eb6ca1e514
2017-07-01 09:08:55,500 - MainThread - botocore.endpoint - DEBUG - Sending http request: 2017-07-01 09:08:55,500 - MainThread - botocore.vendored.requests.packages.urllib3.connectionpool - INFO - Starting new HTTPS connection (4): ec2.eu-west-1.amazonaws.com
2017-07-01 09:08:55,504 - MainThread - botocore.endpoint - DEBUG - ConnectionError received when sending HTTP request.
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/botocore/endpoint.py", line 204, in _get_response
proxies=self.proxies, timeout=self.timeout)
File "/usr/lib/python2.7/dist-packages/botocore/vendored/requests/sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/dist-packages/botocore/vendored/requests/adapters.py", line 431, in send
raise SSLError(e, request=request)
SSLError: [Errno 2] No such file or directory
2017-07-01 09:08:55,504 - MainThread - botocore.hooks - DEBUG - Event needs-retry.ec2.DescribeInstances: calling handler
2017-07-01 09:08:55,505 - MainThread - botocore.retryhandler - DEBUG - retry needed, retryable exception caught: [Errno 2] No such file or directory
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 269, in _should_retry
return self._checker(attempt_number, response, caught_exception)
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 317, in __call__
caught_exception)
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 223, in __call__
attempt_number, caught_exception)
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 359, in _check_caught_exception
raise caught_exception
SSLError: [Errno 2] No such file or directory
2017-07-01 09:08:55,505 - MainThread - botocore.retryhandler - DEBUG - Retry needed, action of: 7.76824379491
2017-07-01 09:08:55,505 - MainThread - botocore.endpoint - DEBUG - Response received to retry, sleeping for 7.76824379491 seconds
2017-07-01 09:09:03,281 - MainThread - botocore.hooks - DEBUG - Event request-created.ec2.DescribeInstances: calling handler >
2017-07-01 09:09:03,281 - MainThread - botocore.hooks - DEBUG - Event choose-signer.ec2.DescribeInstances: calling handler
2017-07-01 09:09:03,282 - MainThread - botocore.auth - DEBUG - Calculating signature using v4 auth.
2017-07-01 09:09:03,282 - MainThread - botocore.auth - DEBUG - CanonicalRequest:
POST
/

host:ec2.eu-west-1.amazonaws.com
x-amz-date:20170701T090903Z

host;x-amz-date
6171eb09865e32b0602af0f7957e26573a51f53caaedff02ff88883cb0275885
2017-07-01 09:09:03,282 - MainThread - botocore.auth - DEBUG - StringToSign:
AWS4-HMAC-SHA256
20170701T090903Z
20170701/eu-west-1/ec2/aws4_request
4985b8039a984d3500e78526ae8a5ac07f797021a6c705a04d07d358ffcd938c
2017-07-01 09:09:03,282 - MainThread - botocore.auth - DEBUG - Signature:
c9dc0b7d339f3d8f5dccddb6af88f62a433e66164c6f42923b0bb69a9c946bbf
2017-07-01 09:09:03,282 - MainThread - botocore.endpoint - DEBUG - Sending http request: 2017-07-01 09:09:03,283 - MainThread - botocore.vendored.requests.packages.urllib3.connectionpool - INFO - Starting new HTTPS connection (5): ec2.eu-west-1.amazonaws.com
2017-07-01 09:09:03,288 - MainThread - botocore.endpoint - DEBUG - ConnectionError received when sending HTTP request.
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/botocore/endpoint.py", line 204, in _get_response
proxies=self.proxies, timeout=self.timeout)
File "/usr/lib/python2.7/dist-packages/botocore/vendored/requests/sessions.py", line 573, in send
r = adapter.send(request, kwargs)
File "/usr/lib/python2.7/dist-packages/botocore/vendored/requests/adapters.py", line 431, in send
raise SSLError(e, request=request)
SSLError: [Errno 2] No such file or directory
2017-07-01 09:09:03,288 - MainThread - botocore.hooks - DEBUG - Event needs-retry.ec2.DescribeInstances: calling handler
2017-07-01 09:09:03,288 - MainThread - awscli.clidriver - DEBUG - Exception caught in main()
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/awscli/clidriver.py", line 200, in main
return command_tableparsed_args.command
File "/usr/lib/python2.7/dist-packages/awscli/clidriver.py", line 338, in __call__
return command_tableparsed_args.operation
File "/usr/lib/python2.7/dist-packages/awscli/clidriver.py", line 508, in __call__
call_parameters, parsed_globals)
File "/usr/lib/python2.7/dist-packages/awscli/clidriver.py", line 628, in invoke
self._display_response(operation_name, response, parsed_globals)
File "/usr/lib/python2.7/dist-packages/awscli/clidriver.py", line 648, in _display_response
formatter(command_name, response)
File "/usr/lib/python2.7/dist-packages/awscli/formatter.py", line 69, in __call__
response_data = response.build_full_result()
File "/usr/lib/python2.7/dist-packages/botocore/paginate.py", line 438, in build_full_result
for response in self:
File "/usr/lib/python2.7/dist-packages/botocore/paginate.py", line 249, in __iter__
response = self._make_request(current_kwargs)
File "/usr/lib/python2.7/dist-packages/botocore/paginate.py", line 321, in _make_request
return self._method(
current_kwargs)
File "/usr/lib/python2.7/dist-packages/botocore/client.py", line 253, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/lib/python2.7/dist-packages/botocore/client.py", line 544, in _make_api_call
operation_model, request_dict)
File "/usr/lib/python2.7/dist-packages/botocore/endpoint.py", line 141, in make_request
return self._send_request(request_dict, operation_model)
File "/usr/lib/python2.7/dist-packages/botocore/endpoint.py", line 170, in _send_request
success_response, exception):
File "/usr/lib/python2.7/dist-packages/botocore/endpoint.py", line 249, in _needs_retry
caught_exception=caught_exception, request_dict=request_dict)
File "/usr/lib/python2.7/dist-packages/botocore/hooks.py", line 227, in emit
return self._emit(event_name, kwargs)
File "/usr/lib/python2.7/dist-packages/botocore/hooks.py", line 210, in _emit
response = handler(**kwargs)
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 183, in __call__
if self._checker(attempts, response, caught_exception):
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 251, in __call__
caught_exception)
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 277, in _should_retry
return self._checker(attempt_number, response, caught_exception)
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 317, in __call__
caught_exception)
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 223, in __call__
attempt_number, caught_exception)
File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 359, in _check_caught_exception
raise caught_exception
SSLError: [Errno 2] No such file or directory
2017-07-01 09:09:03,295 - MainThread - awscli.clidriver - DEBUG - Exiting with rc 255

[Errno 2] No such file or directory

somebody heeeeeeeeeeelp please , im losing my mind :(

I am experiencing a similar problem on macOS. My awscli tools appear to be operating properly, but I get a very similar stack trace, resulting in SSLError [Errno 2], when running custom code that uses boto3 to communicate with DynamoDB. Still trying to pin down the error.

I'm getting the same error, seems like a certificate error in ec2.REGION.amazonaws.com. Try this in your console:

export PUBLICIP=$(curl http://169.254.169.254/latest/meta-data/public-ipv4 2> /dev/null)
echo "Public IP: $PUBLICIP"
export INSTANCEID=`curl 169.254.169.254/latest/meta-data/instance-id 2> /dev/null`
echo "Instance ID: $INSTANCEID"
export EC2_AVAIL_ZONE=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone`
echo "Availability Zone: $EC2_AVAIL_ZONE"
export EC2_REGION="`echo \"$EC2_AVAIL_ZONE\" | sed -e 's:\([0-9][0-9]*\)[a-z]*\$:\\1:'`"
echo "Region: $EC2_REGION"

#OPTIONAL
#yum update openssl*

# Try just hitting the server
echo curl https://ec2.${EC2_REGION}.amazonaws.com/ --verbose
curl https://ec2.${EC2_REGION}.amazonaws.com/ --verbose

# Try it with the openssl debugger
echo openssl s_client -connect "ec2.${EC2_REGION}.amazonaws.com:443"
openssl s_client -connect "ec2.${EC2_REGION}.amazonaws.com:443"
# Here, I get a 'Verify return code: 20 (unable to get local issuer certificate)'

# Try including the primary trusted certificates in chain
openssl s_client -connect "ec2.${EC2_REGION}.amazonaws.com:443" -CAfile /usr/share/pki/ca-trust-source/ca-bundle.trust.crt
# Now I get a 'Verify return code: 0 (ok)'

Not sure yet how this helps us, but it seems to be a certificate issue with HTTPS on ec2.us-west-2.amazonaws.com at least. Issue seems clientside, I think.

Hey, this worked for me:

sudo update-ca-trust force-enable
sudo update-ca-trust extract

Something is mucky not with the awscli, but with the instance itself, and its trusted certificates. If you check out /etc/pki/tls/certs:

ls -la /etc/pki/tls/certs

You'll see it's missing some stuff. The earlier "force-enable" command will remake those files.

Ok great, i will try that thanks. i'll update you in a bit.

whooooooop you are a superman
it's working now....
when i ran : update-ca-trust force-enable
i got a "stat" error then i ran extract, worked without issues.
Long story short you are a great person.
Thanks a million bro.

Command for Windows?

Also have same issue on Windows.

aws --version aws-cli/1.11.160 Python/2.7.9 Windows/2008Server botocore/1.7.18

Fix found here ->https://github.com/aws/aws-cli/issues/2855
copy "c:\Program Files\Amazon\AWSCLI\botocore\vendored\requests\cacert.pem" "c:\Program Files\Amazon\AWSCLI\certifi"

YOU ARE THE BESTTTTTTTT maartenschalekamp, ITS WORK FOR MEEEEEE. I was very desperate because it did not work for me.

C:WINDOWSsystem32>aws glacier create-vault --account-id 3723912531 --vault-name UtilizandoCLI

[Errno 2] No such file or directory

C:WINDOWSsystem32>copy "c:Program FilesAmazonAWSCLIbotocorevendoredrequestscacert.pem" "c:Program FilesAmazonAWSCLIcertifi"
1 archivo(s) copiado(s).

C:WINDOWSsystem32>aws glacier create-vault --account-id 3391192531 --vault-name UtilizandoCLI
/3723911531/vaults/UtilizandoCLI

C:WINDOWSsystem32>

thank you SO MUCH

I was getting same issue and this workaround really helped me a lot.

Thank you so much,

Tried the mac fix but got:

sudo: update-ca-trust: command not found

I got the same: sudo: update-ca-trust: command not found. I have no idea whats wrong!

I got the same: sudo: update-ca-trust: command not found. I have no idea whats wrong!

in my case (REHL) conda was missing from path.

i fixed it with export PATH="/home/username/anaconda3/bin:$PATH"

I was getting

SSL validation failed for https://s3.amazonaws.com/ [Errno 2] No such file or directory

@maludwig suggestion helped me:

Using the --verbose option

curl https://ec2.${EC2_REGION}.amazonaws.com/ --verbose

I got from the output:

* successfully set certificate verify locations:
*   CAfile: C:/Users/my/path/.../ssl/certs/ca-bundle.crt

And then I could set an environment variable in my windows console:

set AWS_CA_BUNDLE=C:/Users/my/path/.../ssl/certs/ca-bundle.crt

And after that awscli stopped complaining.

I'm not sure why it wasn't working out-of-the-box like it should... my two cents...

Similar to my issue - I was trying to use the aws cli from inside a docker container - and it couldn't find the certs. So I just:
export AWS_CA_BUNDLE=/etc/ssl/certs/cacert.pem
..then it worked fine.

I was using aws-cli version2 and came with the same python error [error2] running codedeploy
I tried update-ca-trust but it shows command not found, even after I install ca-certificates.
So I switched to aws-cli version1 and it works just fine.

For Ubuntu users, the fix here seems to work: https://github.com/aws/aws-cli/issues/5038

Hi, there seems to be a couple of different problems being talked about in here, and most of the people posting have found a work-around, plus it being so old makes tracking them reaaally difficult for me... so lazy as it may sound I'll be closing this, please open a new issue if you're still facing this problem.

I got the same: sudo: update-ca-trust: command not found. I have no idea whats wrong!

still, this issue exist in my repo, can anyone solve this problem

Was this page helpful?
0 / 5 - 0 ratings