Reputation: 5393
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]
Upvotes: 37
Views: 53861
Reputation: 524
Apparently, the .aws/config must say lower case json, not uppercase JSON, i.e.
[default]
region = eu-west-2
output = json
This definitely works.
Upvotes: 2
Reputation: 1
using AWS Cloud Shell it was giving me the same error when I used us-east-1 and after changing the region to us-east-2 the problem is solved. when I try it on my desktop by changing the region to us-east-2 with JSON option still the error happens. try changing regions with Cloud Shell availability.
Upvotes: 0
Reputation: 1285
Go to .aws folder and cat the config and credentials files
just comment out the line containing output = NONE
.
Upvotes: 0
Reputation: 51
Figure out your ARN and your role and set up everything (region and clustername) as in the below command in the respective place.
aws eks update-kubeconfig --name eks-cluster-name --region aws-region --role-arn arn:aws:iam::XXXXXXXXXXXX:role/testrole
Also, read on the documentation here below.
https://aws.amazon.com/premiumsupport/knowledge-center/eks-api-server-unauthorized-error/
Upvotes: 0
Reputation: 391
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.
Upvotes: 29
Reputation: 591
$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.
Upvotes: 59
Reputation: 5393
My ~/.aws/config was somehow in a bad state, there were multiple declarations for the same setting under a single role header. Editing the file manually fixed my issue.
The info under Configuration Settings and Precedence https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html led me to the right place.
Upvotes: 15