aws-sdk-java icon indicating copy to clipboard operation
aws-sdk-java copied to clipboard

OpsWorks describeStacks for all stacks throws validation exception

Open brewsteropsdev opened this issue 13 years ago • 4 comments

A DescribeStacksRequest describeStacks call with no ID's specified throws a validation error. Per the [API](http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/opsworks/model/DescribeStacksRequest.html#withStackIds(java.lang.String...), omitting the withStackIds() parameter should return a description of all stacks.

List result = opsWorksClient.describeStacks(new DescribeStacksRequest()).getStacks();

Exception in thread "main" ValidationException: Status Code: 400, AWS Service: AWSOpsWorks, AWS Request ID: 45957802-c956-11e2-bd64-95797b8784fd, AWS Error Code: ValidationException, AWS Error Message: Please provide no arguments or, one or more stack IDs
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:653)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:347)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:199)
at com.amazonaws.services.opsworks.AWSOpsWorksClient.invoke(AWSOpsWorksClient.java:2039)
at com.amazonaws.services.opsworks.AWSOpsWorksClient.describeStacks(AWSOpsWorksClient.java:1686)

And:

List result = opsWorksClient.describeStacks(new DescribeStacksRequest().withStackIds()).getStacks();

Exception in thread "main" ValidationException: Status Code: 400, AWS Service: AWSOpsWorks, AWS Request ID: 1e5777d7-c958-11e2-9f24-eb40b9de1b03, AWS Error Code: ValidationException, AWS Error Message: Please provide no arguments or, one or more stack IDs
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:653)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:347)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:199)
at com.amazonaws.services.opsworks.AWSOpsWorksClient.invoke(AWSOpsWorksClient.java:2039)
at com.amazonaws.services.opsworks.AWSOpsWorksClient.describeStacks(AWSOpsWorksClient.java:1686)

brewsteropsdev avatar May 30 '13 18:05 brewsteropsdev

Hi, Mbrewster,

Thanks for reporting it. For some reason, we do not have the API describeStacks(). I have reported your issue to the AWS Opsworks team. I will let you when there is any update.

thanks,

Yifei

yifeireplay avatar May 31 '13 18:05 yifeireplay

Thanks Yifei,

As a follow-on I tested the above code against the 1.4.3 API and it seems to work. Looks like it must be a regression bug.

Thanks,

Matt

brewsteropsdev avatar May 31 '13 18:05 brewsteropsdev

Hi, Matt,

The issue has been fixed in AWS Java SDK 1.4.6 which was release today. Thanks again for your report and help.

Yifei

yifeireplay avatar Jun 14 '13 07:06 yifeireplay

Thanks Yifei! Have tested and is working against 1.4.6.

brewsteropsdev avatar Jun 14 '13 19:06 brewsteropsdev