0

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!

2
  • 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. Commented May 10, 2016 at 18:51
  • Thank you @tapichu ! That did the trick. Commented May 10, 2016 at 19:47

1 Answer 1

1

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!

Sign up to request clarification or add additional context in comments.

1 Comment

As of version 0.15, the plugin will upload regular files as-is, without zipping them again. So you could go back and update the output location to point to the WAR file you want to upload.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.