Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.11.17 and above breaks EC2 describe volumes with JSON input #2452

Closed
stephanwehr opened this issue Feb 19, 2017 · 1 comment
Closed
Labels
bug This issue is a bug.

Comments

@stephanwehr
Copy link

Related Issue: #1976

JSON File:

{
  "VolumeIds": [
    "vol-<id>"
  ]
}

Command:

aws ec2 describe-volumes --region <region> --cli-input-json file://<file-name>.json

Error Message:

An error occurred (InvalidParameterCombination) when calling the DescribeVolumes operation: The parameter volumeSet cannot be used with the parameter maxResults

OS Release:

NAME="Amazon Linux AMI"
VERSION="2016.09"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2016.09"
PRETTY_NAME="Amazon Linux AMI 2016.09"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2016.09:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"

Works:

python27-botocore-1.4.46-1.58.amzn1.noarch
aws-cli-1.10.56-1.41.amzn1.noarch

Breaks:

python27-botocore-1.4.74-1.60.amzn1.noarch
aws-cli-1.11.17-1.43.amzn1.noarch
python27-botocore-1.4.86-1.62.amzn1.noarch
aws-cli-1.11.29-1.45.amzn1.noarch
@kyleknap
Copy link
Contributor

Yeah this looks related to the issue you linked, but is a regression specifically for --cli-input-json and automatically paginating some of the ec2 commands. We will look into fixing this. In the meantime, I would recommend using --volume-ids parameter if possible as it should not have this issue.

@kyleknap kyleknap added bug This issue is a bug. confirmed labels Feb 22, 2017
JordonPhillips added a commit to JordonPhillips/aws-cli that referenced this issue Mar 27, 2017
Resolves aws#2452

Fixes a bug where cli json input would get processed after ec2
auto pagination injection.

This was due to a subtle behavior of the event system. A handler
registered at the top level without any delimiters will always
be called *after* any events registered that do have delimiters
regarless of when or how they were registered.

The handler for --cli-input-json was registered against
'calling-command', and the handler for the ec2 pagination injection
was registered against 'calling-command.ec2.operation-name'. So then
even though the ec2 pagination injection was using register_last, it
was being called first.

The solution is to use 'calling-command.*' instead for the event
that --cli-input-json is registered against. This puts it in the same
pool as the other delimited handlers. This had the potential to break
other handlers depending on the existing ordering, but there were
very few registered to that event. Running the tests revealed no
issues, however.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants