Closed jeffPOG closed 5 years ago
Could you append --debug
to see what the full stack trace is?
@JordonPhillips sure thing. This is the output that I got
`
TauCeti% aws ec2 start-instances --instance-ids i-043854035c828d97a --profile=xa-at-ec2-admin --debug
2019-03-06 09:14:00,139 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/1.16.100 Python/3.7.2 Darwin/18.2.0 botocore/1.12.90
2019-03-06 09:14:00,140 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['ec2', 'start-instances', '--instance-ids', 'i-048850034c878d97a', '--profile=xa-at-ec2-admin', '--debug']
2019-03-06 09:14:00,140 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_scalar_parsers at 0x10fb8d620>
2019-03-06 09:14:00,140 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function register_uri_param_handler at 0x10f5f46a8>
2019-03-06 09:14:00,140 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_assume_role_provider_cache at 0x10f62f268>
2019-03-06 09:14:00,147 - MainThread - botocore.credentials - DEBUG - Skipping environment variable credential check because profile name was explicitly set.
2019-03-06 09:14:00,147 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function attach_history_handler at 0x10fa55840>
2019-03-06 09:14:00,150 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/data/ec2/2016-11-15/service-2.json
2019-03-06 09:14:00,185 - MainThread - botocore.hooks - DEBUG - Event service-data-loaded.ec2: calling handler <function register_retries_for_service at 0x10f128378>
2019-03-06 09:14:00,185 - MainThread - botocore.handlers - DEBUG - Registering retry handlers for service: ec2
2019-03-06 09:14:00,192 - MainThread - botocore.hooks - DEBUG - Event building-command-table.ec2: calling handler functools.partial(<function _remove_commands at 0x10fb20d08>, commands_to_remove=['import-instance', 'import-volume'])
2019-03-06 09:14:00,192 - MainThread - awscli.customizations.removals - DEBUG - Removing operation: import-instance
2019-03-06 09:14:00,192 - MainThread - awscli.customizations.removals - DEBUG - Removing operation: import-volume
2019-03-06 09:14:00,192 - MainThread - botocore.hooks - DEBUG - Event building-command-table.ec2: calling handler <function add_waiters at 0x10fb94ae8>
2019-03-06 09:14:00,202 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/data/ec2/2016-11-15/waiters-2.json
2019-03-06 09:14:00,204 - MainThread - awscli.clidriver - DEBUG - OrderedDict([('instance-ids', <awscli.arguments.ListArgument object at 0x111f91a20>), ('additional-info', <awscli.arguments.CLIArgument object at 0x111fa3f28>), ('dry-run', <awscli.arguments.BooleanArgument object at 0x111fa3f98>), ('no-dry-run', <awscli.arguments.BooleanArgument object at 0x111fb2048>)])
2019-03-06 09:14:00,204 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.start-instances: calling handler <function add_streaming_output_arg at 0x10fb8d8c8>
2019-03-06 09:14:00,204 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.start-instances: calling handler <function rename_arg.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/credentials.py", line 429, in _protected_refresh metadata = self._refresh_using() File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/credentials.py", line 566, in fetch_credentials return self._get_cached_credentials() File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/credentials.py", line 574, in _get_cached_credentials response = self._load_from_cache() File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/credentials.py", line 592, in _load_from_cache creds = deepcopy(self._cache[self._cache_key]) File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/credentials.py", line 206, in getitem raise KeyError(cache_key) KeyError: '7c6c81215dd22b82ab3183df71e97bc1c3a2d5bb' 2019-03-06 09:14:00,329 - MainThread - awscli.clidriver - DEBUG - Exception caught in main() Traceback (most recent call last): File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/credentials.py", line 203, in getitem with open(actual_key) as f: PermissionError: [Errno 13] Permission denied: '/Users/jeff.sikala.i/.aws/cli/cache/7c6c81215dd22b82ab3183df71e97bc1c3a2d5bb.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/awscli/clidriver.py", line 207, in main return command_table[parsed_args.command](remaining, parsed_args) File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/awscli/clidriver.py", line 348, in call return command_table[parsed_args.operation](remaining, parsed_globals) File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/awscli/clidriver.py", line 520, in call call_parameters, parsed_globals) File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/awscli/clidriver.py", line 640, in invoke client, operation_name, parameters, parsed_globals) File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/awscli/clidriver.py", line 652, in _make_client_call parameters) File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call return self._make_api_call(operation_name, kwargs) File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call operation_model, request_dict, request_context) File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request return self._endpoint.make_request(operation_model, request_dict) File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request return self._send_request(request_dict, operation_model) File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/endpoint.py", line 132, in _send_request request = self.create_request(request_dict, operation_model) File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/endpoint.py", line 116, in create_request operation_name=operation_model.name) File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/hooks.py", line 356, in emit return self._emitter.emit(aliased_event_name, kwargs) File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/hooks.py", line 228, in emit return self._emit(event_name, kwargs) File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/hooks.py", line 211, in _emit response = handler(kwargs) File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/signers.py", line 90, in handler return self.sign(operation_name, request) File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/signers.py", line 149, in sign auth = self.get_auth_instance(kwargs) File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/signers.py", line 229, in get_auth_instance frozen_credentials = self._credentials.get_frozen_credentials() File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/credentials.py", line 518, in get_frozen_credentials self._refresh() File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/credentials.py", line 413, in _refresh self._protected_refresh(is_mandatory=is_mandatory_refresh) File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/credentials.py", line 429, in _protected_refresh metadata = self._refresh_using() File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/credentials.py", line 566, in fetch_credentials return self._get_cached_credentials() File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/credentials.py", line 574, in _get_cached_credentials response = self._load_from_cache() File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/credentials.py", line 592, in _load_from_cache creds = deepcopy(self._cache[self._cache_key]) File "/usr/local/Cellar/awscli/1.16.100/libexec/lib/python3.7/site-packages/botocore/credentials.py", line 206, in getitem raise KeyError(cache_key) KeyError: '7c6c81215dd22b82ab3183df71e97bc1c3a2d5bb' 2019-03-06 09:14:00,335 - MainThread - awscli.clidriver - DEBUG - Exiting with rc 255 `
I figured it out. The reason it didn't work was because the first time I ran the awscli command, I was sudo. So the aws cli cache located in /user/aws/cli/cache cached the new command to root and not user, so everytime I ran that command as user I got the randomly generated number that corresponded to the cached json output located in /user/aws/cli/cache.
Hi @jeffPOG How did you fix this issue?
@sam-som look at the comment above.
closing the loop on this and for any future people. my issue is related to awcli cache https://github.com/aws/aws-cli/issues/5528 the solution was to delete the corrupted cached
rm ~/.aws/cli/cache/<random-string>.json
the random string here is the one in the error message
For some reason, regardless what I do using the aws-cli I get a random output prints a the same string of characters. I'm not sure what this about. Any ideas?
Here are a few examples:
User% aws s3 ls --profile=xa-at-ec2-admin '7c6c81215dd22b82ab3183df71e97bc1c3a2d5bb'
aws ec2 stop-instances --instance-ids i-048f3544c878897a --profile=xa-at-ec2-admin '7c6c81215dd22b82ab3183df71e97bc1c3a2d5bb'