Creating application version is failing
hypery2k opened this issue · comments
I've trying to use the plugin to deploy to an existing environment. The S3 upload is working so far, but create version is failing:
mvn -Paws-demo beanstalk:create-application-version -X
DEBUG] Sending request: POST / HTTP/1.1
[DEBUG] >> "POST / HTTP/1.1[\r][\n]"
[DEBUG] >> "Host: elasticbeanstalk.us-east-1.amazonaws.com[\r][\n]"
[DEBUG] >> "Authorization: AWS4-HMAC-SHA256 Credential=xxxx/20150908/us-east-1/elasticbeanstalk/aws4_request, SignedHeaders=host;user-agent;x-amz-date, Signature=4b89c4baeb9b5bf4e2890567c74d9a0202537aed2d1d9f10437e1d6e9822b404[\r][\n]"
[DEBUG] >> "X-Amz-Date: 20150908T190629Z[\r][\n]"
[DEBUG] >> "User-Agent: Apache Maven/3.0 (ingenieux beanstalker/1.4.0; http://beanstalker.ingenieux.com.br), aws-sdk-java/1.9.8 Mac_OS_X/10.11 Java_HotSpot(TM)_64-Bit_Server_VM/25.20-b23/1.8.0_20[\r][\n]"
[DEBUG] >> "Content-Type: application/x-www-form-urlencoded; charset=utf-8[\r][\n]"
[DEBUG] >> "Content-Length: 271[\r][\n]"
[DEBUG] >> "Connection: Keep-Alive[\r][\n]"
[DEBUG] >> "[\r][\n]"
[DEBUG] >> POST / HTTP/1.1
[DEBUG] >> Host: elasticbeanstalk.us-east-1.amazonaws.com
[DEBUG] >> Authorization: AWS4-HMAC-SHA256 Credential=xxxx/20150908/us-east-1/elasticbeanstalk/aws4_request, SignedHeaders=host;user-agent;x-amz-date, Signature=4b89c4baeb9b5bf4e2890567c74d9a0202537aed2d1d9f10437e1d6e9822b404
[DEBUG] >> X-Amz-Date: 20150908T190629Z
[DEBUG] >> User-Agent: Apache Maven/3.0 (ingenieux beanstalker/1.4.0; http://beanstalker.ingenieux.com.br), aws-sdk-java/1.9.8 Mac_OS_X/10.11 Java_HotSpot(TM)_64-Bit_Server_VM/25.20-b23/1.8.0_20
[DEBUG] >> Content-Type: application/x-www-form-urlencoded; charset=utf-8
[DEBUG] >> Content-Length: 271
[DEBUG] >> Connection: Keep-Alive
[DEBUG] >> "Action=CreateApplicationVersion&Version=2010-12-01&ApplicationName=app&VersionLabel=1.2.1&Description=Update+from+beanstalk-maven-plugin&SourceBundle.S3Bucket=elasticbeanstalk-eu-central-1-072409525121&SourceBundle.S3Key=app-20150908190627.war&AutoCreateApplication=true"
[DEBUG] << "HTTP/1.1 400 Bad Request[\r][\n]"
[DEBUG] << "x-amzn-RequestId: b5e917a7-565c-11e5-81fe-ede8e2f9f96c[\r][\n]"
[DEBUG] << "Content-Type: text/xml[\r][\n]"
[DEBUG] << "Content-Length: 412[\r][\n]"
[DEBUG] << "Date: Tue, 08 Sep 2015 19:06:29 GMT[\r][\n]"
[DEBUG] << "[\r][\n]"
[DEBUG] Receiving response: HTTP/1.1 400 Bad Request
[DEBUG] << HTTP/1.1 400 Bad Request
[DEBUG] << x-amzn-RequestId: ...
[DEBUG] << Content-Type: text/xml
[DEBUG] << Content-Length: 412
[DEBUG] << Date: Tue, 08 Sep 2015 19:06:29 GMT
[DEBUG] Connection can be kept alive indefinitely
[DEBUG] << "<ErrorResponse xmlns="http://elasticbeanstalk.amazonaws.com/docs/2010-12-01/">[\n]"
[DEBUG] << " <Error>[\n]"
[DEBUG] << " <Type>Sender</Type>[\n]"
[DEBUG] << " <Code>InvalidParameterCombination</Code>[\n]"
[DEBUG] << " <Message>Unable to download from S3 location (Bucket: elasticbeanstalk-eu-central-1-072409525121 Key: app-20150908190627.war). Reason: Bad Request</Message>[\n]"
[DEBUG] << " </Error>[\n]"
[DEBUG] << " <RequestId>b5e917a7-565c-11e5-81fe-ede8e2f9f96c</RequestId>[\n]"
[DEBUG] << "</ErrorResponse>[\n]"
With the same login credentials via AWS Command Line Tools it's working. Any ideas what I'm doing wrong
Here is my POM:
<profiles>
<profile>
<id>aws-demo</id>
<properties>
<maven.install.skip>true</maven.install.skip>
<maven.deploy.skip>true</maven.deploy.skip>
<beanstalk.applicationName>app</beanstalk.applicationName>
<beanstalk.cnamePrefix>app-demo</beanstalk.cnamePrefix>
<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
<beanstalk.s3Bucket>elasticbeanstalk-eu-central-1-072409525121</beanstalk.s3Bucket>
<beanstalk.s3Key>${project.build.finalName}-${maven.build.timestamp}.war
</beanstalk.s3Key>
<beanstalk.region>eu-central-1</beanstalk.region>
<!-- Frankfurt -->
<beanstalker.verbose>true</beanstalker.verbose>
<beanstalk.versionLabel>${project.build.finalName}_v${project.version}_build${env.BUILD_NUMBER}
</beanstalk.versionLabel>
<beanstalk.multipartUpload>false</beanstalk.multipartUpload>
<beanstalk.useLatestVersion>false</beanstalk.useLatestVersion>
</properties>
...
Nevermind.
Here's what happens: The bucket is in eu-central-1, and the service was in eu-central.
mvn -Paws-demo beanstalk:create-application-version -X
[DEBUG] >> Host: elasticbeanstalk.us-east-1.amazonaws.com
Looks a bit weird. I knew there were a few gotchas with eu-central, but then I reviewed a small gotcha:
<beanstalk.region>eu-central-1</beanstalk.region>
Instead, this one should be beanstalker
instead. There's a historical reason for this.