0
votes

I recently created an AWS CodePipeline pipeline to pull from Github, build with Jenkins/Maven, and deploy to an existing ElasticBeanstalk project. The output of the build step and input to the deploy step is the built .war file. Upon successfully building the WAR, deployment fails with this error from the AWS EB console.

[Instance: i-6605c4e1] Command failed on instance. Return code: 2 Output: (TRUNCATED)...opt/elasticbeanstalk/deploy/appsource/source_bundle + /usr/bin/unzip -o -d /tmp/deployment/application/ROOT /opt/elasticbeanstalk/deploy/appsource/source_bundle Archive: /opt/elasticbeanstalk/deploy/appsource/source_bundle mapname: conversion of failed. Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/02unzip.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

I can pull a more detailed message to include here, but perhaps someone can see something obvious I'm missing that I cannot see.

I can successfully deploy the Jenkins/Maven-generated WAR file directly to Elastic Beanstalk, but via CodePipeline the deploy fails.

Thank you!

1
The CodePipeline Jenkins plugin will zip the Jenkins job "output location" before uploading it to S3. Could it be that the WAR file is getting zipped twice? Is your Jenkins "output location" pointing to the compressed WAR file? You could try changing it to the uncompressed path from which the WAR file is generated.tapichu
Thank you @tapichu ! That did the trick.klesh

1 Answers

1
votes

Just to answer this question and mark it as resolved, I'm restating the answer provided by @tapichu.

The CodePipeline Jenkins plugin will zip the Jenkins job "output location" before uploading it to S3.

In the Jenkins project Configure page, there is an option to set a Post-Build Action. I chose the action, "AWS CodePipeline Publisher" and had originally set the "output location" to the built project's WAR file. This was incorrect. Instead, set the output location...

...to the uncompressed path from which the WAR file is generated.

Thanks again, @tapichu!