aws / aws-cli

Universal Command Line Interface for Amazon Web Services
Other
15.57k stars 4.13k forks source link

Errno 2 No such file or directory #2690

Closed remiavan closed 4 years ago

remiavan commented 7 years ago

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 :(

stealthycoin commented 7 years ago

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

remiavan commented 7 years ago

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 <function add_scalar_parsers at 0x7f7aa5670500> 2017-07-01 09:08:51,145 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_assume_role_provider_cache at 0x7f7aa5f70de8> 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 <function register_retries_for_service at 0x7f7aa68c2c08> 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 <functools.partial object at 0x7f7aa6028730> 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 <function add_waiters at 0x7f7aa5673c08> 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', <awscli.arguments.BooleanArgument object at 0x7f7aa523e1d0>), (u'no-dry-run', <awscli.arguments.BooleanArgument object at 0x7f7aa523e210>), (u'instance-ids', <awscli.arguments.ListArgument object at 0x7f7aa523e250>), (u'filters', <awscli.arguments.ListArgument object at 0x7f7aa523e290>), (u'next-token', <awscli.arguments.CLIArgument object at 0x7f7aa523e2d0>), (u'max-results', <awscli.arguments.CLIArgument object at 0x7f7aa523e310>)]) 2017-07-01 09:08:51,252 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.describe-instances: calling handler <function add_streaming_output_arg at 0x7f7aa56730c8> 2017-07-01 09:08:51,253 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.describe-instances: calling handler <function _rename_arg at 0x7f7aa5619488> 2017-07-01 09:08:51,253 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.describe-instances: calling handler <function _rename_arg at 0x7f7aa56199b0> 2017-07-01 09:08:51,253 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.describe-instances: calling handler <functools.partial object at 0x7f7aa60287e0> 2017-07-01 09:08:51,253 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.describe-instances: calling handler <function add_cli_input_json at 0x7f7aa5f7bc08> 2017-07-01 09:08:51,253 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.describe-instances: calling handler <function unify_paging_params at 0x7f7aa56eacf8> 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 <function add_generate_skeleton at 0x7f7aa56e22a8> 2017-07-01 09:08:51,256 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.ec2.describe-instances: calling handler <bound method CliInputJSONArgument.override_required_args of <awscli.customizations.cliinputjson.CliInputJSONArgument object at 0x7f7aa4814b50>> 2017-07-01 09:08:51,256 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.ec2.describe-instances: calling handler <bound method GenerateCliSkeletonArgument.override_required_args of <awscli.customizations.generatecliskeleton.GenerateCliSkeletonArgument object at 0x7f7aa523e910>> 2017-07-01 09:08:51,257 - MainThread - botocore.hooks - DEBUG - Event operation-args-parsed.ec2.describe-instances: calling handler <functools.partial object at 0x7f7aa47a7a48> 2017-07-01 09:08:51,258 - MainThread - botocore.hooks - DEBUG - Event operation-args-parsed.ec2.describe-instances: calling handler <functools.partial object at 0x7f7aa47a7af8> 2017-07-01 09:08:51,258 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.describe-instances.dry-run: calling handler <function uri_param at 0x7f7aa600f578> 2017-07-01 09:08:51,258 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.describe-instances.instance-ids: calling handler <function uri_param at 0x7f7aa600f578> 2017-07-01 09:08:51,258 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.describe-instances.filters: calling handler <function uri_param at 0x7f7aa600f578> 2017-07-01 09:08:51,258 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.describe-instances.next-token: calling handler <function uri_param at 0x7f7aa600f578> 2017-07-01 09:08:51,258 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.describe-instances.max-results: calling handler <function uri_param at 0x7f7aa600f578> 2017-07-01 09:08:51,258 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.describe-instances.cli-input-json: calling handler <function uri_param at 0x7f7aa600f578> 2017-07-01 09:08:51,259 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.describe-instances.starting-token: calling handler <function uri_param at 0x7f7aa600f578> 2017-07-01 09:08:51,259 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.describe-instances.page-size: calling handler <function uri_param at 0x7f7aa600f578> 2017-07-01 09:08:51,259 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.describe-instances.max-items: calling handler <function uri_param at 0x7f7aa600f578> 2017-07-01 09:08:51,259 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.describe-instances.generate-cli-skeleton: calling handler <function uri_param at 0x7f7aa600f578> 2017-07-01 09:08:51,259 - MainThread - botocore.hooks - DEBUG - Event calling-command.ec2.describe-instances: calling handler <bound method CliInputJSONArgument.add_to_call_parameters of <awscli.customizations.cliinputjson.CliInputJSONArgument object at 0x7f7aa4814b50>> 2017-07-01 09:08:51,259 - MainThread - botocore.hooks - DEBUG - Event calling-command.ec2.describe-instances: calling handler <bound method GenerateCliSkeletonArgument.generate_json_skeleton of <awscli.customizations.generatecliskeleton.GenerateCliSkeletonArgument object at 0x7f7aa523e910>> 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 <function add_generate_presigned_url at 0x7f7aa690e140> 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 <bound method ParameterAlias.alias_parameter_in_call of <botocore.handlers.ParameterAlias object at 0x7f7aa68bdcd0>> 2017-07-01 09:08:51,288 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.ec2.DescribeInstances: calling handler <function generate_idempotent_uuid at 0x7f7aa68c2668> 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': <botocore.config.Config object at 0x7f7aa5028710>}, '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 <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f7aa5028690>> 2017-07-01 09:08:51,289 - MainThread - botocore.hooks - DEBUG - Event choose-signer.ec2.DescribeInstances: calling handler <function set_operation_specific_signer at 0x7f7aa68c2578> 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: <PreparedRequest [POST]> 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 <botocore.retryhandler.RetryHandler object at 0x7f7aa4814ad0> 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 <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f7aa5028690>> 2017-07-01 09:08:51,605 - MainThread - botocore.hooks - DEBUG - Event choose-signer.ec2.DescribeInstances: calling handler <function set_operation_specific_signer at 0x7f7aa68c2578> 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: <PreparedRequest [POST]> 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 <botocore.retryhandler.RetryHandler object at 0x7f7aa4814ad0> 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 <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f7aa5028690>> 2017-07-01 09:08:52,088 - MainThread - botocore.hooks - DEBUG - Event choose-signer.ec2.DescribeInstances: calling handler <function set_operation_specific_signer at 0x7f7aa68c2578> 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: <PreparedRequest [POST]> 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 <botocore.retryhandler.RetryHandler object at 0x7f7aa4814ad0> 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 <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f7aa5028690>> 2017-07-01 09:08:55,499 - MainThread - botocore.hooks - DEBUG - Event choose-signer.ec2.DescribeInstances: calling handler <function set_operation_specific_signer at 0x7f7aa68c2578> 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: <PreparedRequest [POST]> 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 <botocore.retryhandler.RetryHandler object at 0x7f7aa4814ad0> 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 <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f7aa5028690>> 2017-07-01 09:09:03,281 - MainThread - botocore.hooks - DEBUG - Event choose-signer.ec2.DescribeInstances: calling handler <function set_operation_specific_signer at 0x7f7aa68c2578> 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: <PreparedRequest [POST]> 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 <botocore.retryhandler.RetryHandler object at 0x7f7aa4814ad0> 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_table[parsed_args.command](remaining, parsed_args) File "/usr/lib/python2.7/dist-packages/awscli/clidriver.py", line 338, in call return command_table[parsed_args.operation](remaining, parsed_globals) 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

remiavan commented 7 years ago

somebody heeeeeeeeeeelp please , im losing my mind :(

qwrrty commented 7 years ago

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.

maludwig commented 7 years ago

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.

maludwig commented 7 years ago

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.

remiavan commented 7 years ago

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

remiavan commented 7 years ago

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.

theoneandonlywoj commented 7 years ago

Command for Windows?

maartenschalekamp commented 7 years ago

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"
jorkcaceres15 commented 7 years ago

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

C:\WINDOWS\system32>aws glacier create-vault --account-id 3723912531 --vault-name UtilizandoCLI

[Errno 2] No such file or directory

C:\WINDOWS\system32>copy "c:\Program Files\Amazon\AWSCLI\botocore\vendored\requests\cacert.pem" "c:\Program Files\Amazon\AWSCLI\certifi" 1 archivo(s) copiado(s).

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

C:\WINDOWS\system32>

thank you SO MUCH

KrupaMoliya commented 7 years ago

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

Thank you so much,

taylorhawks commented 6 years ago

Tried the mac fix but got:

sudo: update-ca-trust: command not found

shoste commented 6 years ago

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

meetagulati commented 6 years ago

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

squarewave24 commented 5 years ago

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

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

siran commented 5 years ago

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...

chicagobuss commented 5 years ago

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.

desperadomzc commented 4 years ago

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.

asnaseer-resilient commented 4 years ago

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

KaibaLopez commented 4 years ago

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.

daniyalwaris commented 4 years ago

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

pavan-nndn commented 3 years ago

hi i am new to aws , trying to install jenkins by using below command ,endedup with no such file or directory

image

kdaily commented 3 years ago

Hi @pavan-nndn, this is unrelated to the AWS CLI. If you are looking for support with Amazon Linux, please head over to the EC2 page for help:

https://aws.amazon.com/amazon-linux-2/

EngZaz commented 3 years ago

I had the same issue on MAC and the problem was with AWScli doing this command aws sts get-caller-identity.

the problem was related to deleting netskope folders and i had added REQUESTS_CA_BUNDLE='/Library/Application Support/Netskope/STAgent/download/nscacert.pem' on ~/.bash_profile.

so i commented the line i pasted above at the ~/.bash_profile. restarted the terminal and it worked

rkolp commented 2 years ago

I had the same issue on MAC and the problem was with AWScli doing this command aws sts get-caller-identity.

the problem was related to deleting netskope folders and i had added REQUESTS_CA_BUNDLE='/Library/Application Support/Netskope/STAgent/download/nscacert.pem' on ~/.bash_profile.

so i commented the line i pasted above at the ~/.bash_profile. restarted the terminal and it worked

Similiar to EngZaz's experience after removing netskope from macOS. I had to remove the ca_bundle from ~/.aws/config

MainThread - botocore.retryhandler - DEBUG - retry needed, retryable exception caught: SSL validation failed for https://ssm.us-west-2.amazonaws.com/ [Errno 2] No such file or directory
rhdmchirag commented 2 years ago

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 ->#2855

copy "c:\Program Files\Amazon\AWSCLI\botocore\vendored\requests\cacert.pem" "c:\Program Files\Amazon\AWSCLI\certifi"

I have an issue in the windows 10 system when I try to fire command: aws s3 ls I get this error.

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

I also try this solution but did not succeed. copy "c:\Program Files\Amazon\AWSCLI\botocore\vendored\requests\cacert.pem" "c:\Program Files\Amazon\AWSCLI\certifi" Please help me if anyone has solutions I spend 2 days on this issue still not resolved.

mo333v commented 2 years ago

I am having the same issues on windows I tried the copy command as well but gave me a path error. Could someone please help me with this?

C:\Windows\System32>aws s3 ls

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

C:\Windows\System32>copy "c:\Program Files\Amazon\AWSCLI\botocore\vendored\requests\cacert.pem" "c:\Program Files\Amazon\AWSCLI\certifi" The system cannot find the path specified.

maartenschalekamp commented 1 year ago

I had the same issue on MAC and the problem was with AWScli doing this command aws sts get-caller-identity. the problem was related to deleting netskope folders and i had added REQUESTS_CA_BUNDLE='/Library/Application Support/Netskope/STAgent/download/nscacert.pem' on ~/.bash_profile. so i commented the line i pasted above at the ~/.bash_profile. restarted the terminal and it worked

Similiar to EngZaz's experience after removing netskope from macOS. I had to remove the ca_bundle from ~/.aws/config

MainThread - botocore.retryhandler - DEBUG - retry needed, retryable exception caught: SSL validation failed for https://ssm.us-west-2.amazonaws.com/ [Errno 2] No such file or directory

For netskope users -> https://docs.netskope.com/en/netskope-help/traffic-steering/netskope-client/addressing-ssl-error-while-accessing-aws-services-via-the-aws-cli-with-the-netskope-client-enabled/

tavisca-vghatol commented 1 year ago

How to solve this for windows?

I'm getting below error:

image

liuj23CD commented 2 months ago

thanks. I use follow method to solve the problem.

curl https://ec2.eu-west-1.amazonaws.com/ --verbose

I got:

then I change .asw/config [default] region = eu-west-1 output = json ca_bundle = /etc/ssl/certs/ca-certificates.crt

The last lin of the config file is change to I got from curl. then it works.