Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS CLI - All commands return Unknown output type: [None]

Tags:

aws-cli

All of my aws-cli commands returned

Unknown output type: [None]

I checked my configuration

$ aws configure

appeared normal but i was unable to edit my 'Default output format'

I ran my aws-cli command with --debug and saw

MainThread - awscli.clidriver - DEBUG - Exception caught in main()
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/awscli/clidriver.py", line 208, in main
    return command_table[parsed_args.command](remaining, parsed_args)
  File "/Library/Python/2.7/site-packages/awscli/clidriver.py", line 345, in __call__
    return command_table[parsed_args.operation](remaining, parsed_globals)
  File "/Library/Python/2.7/site-packages/awscli/clidriver.py", line 517, in __call__
    call_parameters, parsed_globals)
  File "/Library/Python/2.7/site-packages/awscli/clidriver.py", line 638, in invoke
    self._display_response(operation_name, response, parsed_globals)
  File "/Library/Python/2.7/site-packages/awscli/clidriver.py", line 657, in _display_response
    formatter = get_formatter(output, parsed_globals)
  File "/Library/Python/2.7/site-packages/awscli/formatter.py", line 272, in get_formatter
    raise ValueError("Unknown output type: %s" % format_type)
ValueError: Unknown output type: [None]
like image 961
0x539 Avatar asked Feb 07 '18 01:02

0x539


People also ask

How do I change the default output format in AWS CLI?

1 Answer. Use the output option in the named profile in the 'config' file. It sets the default output format to JSON. Do check out AWS Training by Intellipaat and master AWS.

Why my AWS CLI is not working?

If the aws command cannot be found after first installing or updating the AWS CLI, you might need to restart your terminal for it to recognize any PATH updates. If the aws command cannot be found after first installing or updating the AWS CLI, it might not have been fully installed.

Which output format does the AWS CLI support?

AWS CLI supports the following formats: json. yaml or yaml-stream.

What is default output format?

The Default output format specifies how the results are formatted. The value can be any of the values in the following list. If you don't specify an output format, json is used as the default. json – The output is formatted as a JSON string.


2 Answers

$aws configure
press Enters
see the "Default output format [None]:" 
input one of "json, text or table "(all in lower case) 
after that rerun your command. 
like image 73
LuoDi Avatar answered Sep 26 '22 20:09

LuoDi


Run the command "aws configure", then check if the word "JSON" in "Default output format [JSON]:" is in upper case or lower case? If it's in upper case then running any aws command shows "Unknown ouput type : JSON".
Or alternately open the file C:\Users\<user>\.aws\config file and check the entry "output = json". If the word json is in upper case then running any aws command shows "Unknown ouput type : JSON".

Solution:
Replace the upper case JSON with lower case json.

like image 41
CarbonEagle Avatar answered Sep 25 '22 20:09

CarbonEagle