Confusing errors from client.describe_images - what type is Filters?
See original GitHub issuefrom boto3.session import Session
session = Session()
client = session.client(service_name='ec2', region_name='us-west-1')
images = client.describe_images(Filters={'virtualization-type':'hvm'})
Traceback (most recent call last):
File "C:/Users/Adam/Documents/Git/junkcode/Python/spotprices/gimme.py", line 8, in <module>
images = client.describe_images(Filters={'virtualization-type':'hvm'})
File "C:\Users\Adam\Documents\PyEnvs\ec2-venv\lib\site-packages\botocore\client.py", line 269, in _api_call
return self._make_api_call(operation_name, kwargs)
File "C:\Users\Adam\Documents\PyEnvs\ec2-venv\lib\site-packages\botocore\client.py", line 310, in _make_api_call
api_params, operation_model)
File "C:\Users\Adam\Documents\PyEnvs\ec2-venv\lib\site-packages\botocore\client.py", line 351, in _convert_to_request_dict
api_params, operation_model)
File "C:\Users\Adam\Documents\PyEnvs\ec2-venv\lib\site-packages\botocore\validate.py", line 273, in serialize_to_request
raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter Filters, value: {'virtualization-type': 'hvm'}, type: <class 'dict'>, valid types: <class 'list'>, <class 'tuple'>
session = Session()
client = session.client(service_name='ec2', region_name='us-west-1')
images = client.describe_images(Filters=['virtualization-type:hvm',])
Traceback (most recent call last):
File "C:/Users/Adam/Documents/Git/junkcode/Python/spotprices/gimme.py", line 8, in <module>
images = client.describe_images(Filters=['virtualization-type:hvm',])
File "C:\Users\Adam\Documents\PyEnvs\ec2-venv\lib\site-packages\botocore\client.py", line 269, in _api_call
return self._make_api_call(operation_name, kwargs)
File "C:\Users\Adam\Documents\PyEnvs\ec2-venv\lib\site-packages\botocore\client.py", line 310, in _make_api_call
api_params, operation_model)
File "C:\Users\Adam\Documents\PyEnvs\ec2-venv\lib\site-packages\botocore\client.py", line 351, in _convert_to_request_dict
api_params, operation_model)
File "C:\Users\Adam\Documents\PyEnvs\ec2-venv\lib\site-packages\botocore\validate.py", line 273, in serialize_to_request
raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter Filters[0], value: virtualization-type:hvm, type: <class 'str'>, valid types: <class 'dict'>
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
What is the correct ways to write Boto3 filters to use customise ...
Filters accept list value, and info inside the tag should be dict. ... It is confusing without examples when they say you may...
Read more >EC2 — Boto3 Docs 1.26.32 documentation - AWS
A low-level client representing Amazon Elastic Compute Cloud (EC2) ... a resource type that is unsupported for the action you're using, you'll get...
Read more >Class: AWS.EC2 — AWS SDK for JavaScript
Adds an ingress authorization rule to a Client VPN endpoint. ... Describes the details of the instance types that are offered in a...
Read more >Fault and error handling filters - Axway Documentation Portal
In cases where a transaction fails, API Gateway can use a generic error to convey error information to the client based on the...
Read more >Confusing errors for a confusing feature, part two
The compiler has to let code with a reference of type IList<int> call the Add() method, even though that reference might identify something...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The docs here seem to be sufficient to show what should be in the request: http://boto3.readthedocs.io/en/latest/reference/services/ec2.html#EC2.Client.describe_images
I’m not sure how we can improve the error message, which tells you the index of the type that had the issue.
If you still are having issues please feel free to open up another issue and we’ll get back to you.
Really, you can’t improve the error message here? You have to know ahead of time to go look at a webpage that isn’t mentioned anywhere, and can’t get it from the error message or the source? All you’re told by the error message above is that it’s expecting a list or tuple, and doesn’t say ANYTHING about what that list is supposed to contain (which also requires an extreme amount of structure). There is a LOT of improvement that can be done to the error message, and saying “We’re not sure how” is disappointing.