aws-amicleaner icon indicating copy to clipboard operation
aws-amicleaner copied to clipboard

Invalid length for parameter LaunchConfigurationNames[0], value: 0, valid range: 1-inf

Open Mattnmoore opened this issue 6 years ago • 8 comments

I've been using this tool for the past week without an issue, but yesterday I started getting an error message when trying to perform a clean:

Invalid length for parameter LaunchConfigurationNames[0], value: 0, valid range: 1-inf

This is the command I'm running

amicleaner --mapping-key name --mapping-values my-ami-name --keep-previous 3

Mattnmoore avatar Aug 09 '18 14:08 Mattnmoore

#87 fixes the issue for me

Mattnmoore avatar Aug 15 '18 15:08 Mattnmoore

Same issue, Im using LaunchTemplate with ASG

Retrieving AMIs to clean ...
Traceback (most recent call last):
  File "/usr/bin/amicleaner", line 11, in <module>
    load_entry_point('aws-amicleaner', 'console_scripts', 'amicleaner')()
  File "/aws-amicleaner/amicleaner/cli.py", line 195, in main
    app.run_cli()
  File "/aws-amicleaner/amicleaner/cli.py", line 165, in run_cli
    candidates = self.prepare_candidates()
  File "/aws-amicleaner/amicleaner/cli.py", line 66, in prepare_candidates
    candidates_amis = candidates_amis or self.fetch_candidates()
  File "/aws-amicleaner/amicleaner/cli.py", line 53, in fetch_candidates
    excluded_amis += f.fetch_zeroed_asg()
  File "/aws-amicleaner/amicleaner/fetch.py", line 73, in fetch_zeroed_asg
    LaunchConfigurationNames=zeroed_lcs
  File "/usr/lib/python2.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/lib/python2.7/site-packages/botocore/client.py", line 634, in _make_api_call
    api_params, operation_model, context=request_context)
  File "/usr/lib/python2.7/site-packages/botocore/client.py", line 682, in _convert_to_request_dict
    api_params, operation_model)
  File "/usr/lib/python2.7/site-packages/botocore/validate.py", line 297, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid length for parameter LaunchConfigurationNames[0], value: 0, valid range: 1-inf
Invalid length for parameter LaunchConfigurationNames[2], value: 0, valid range: 1-inf

talset avatar Feb 15 '19 16:02 talset

@Mattnmoore I tried forking this repo, and implementing the changes in https://github.com/bonclay7/aws-amicleaner/pull/87, but it didn't work. Do you have a working fork?

sc250024 avatar Jul 16 '19 11:07 sc250024

Same issue here

codingtony avatar Feb 20 '20 13:02 codingtony

Having the same issue. Anyone able to implement the fix or an alternative

leetcarey avatar Jan 19 '23 09:01 leetcarey

The #115 appears to fix it, but it looks like this project is abandoned so it might never get merged.

GMartinez-Sisti avatar Jan 19 '23 11:01 GMartinez-Sisti

Yup, installing from source via https://github.com/janus-anderwelt/aws-amicleaner fixed my issue :-)

leetcarey avatar Jan 19 '23 16:01 leetcarey

can confirm that fix ☝️ works. 🙌

arturrez avatar Sep 29 '23 14:09 arturrez