Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-52046

Jenkins build error with aws codepipeline and S3

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Hi,

      I am building a CI/CD pipeine using Git Enterprise to S3, then to Jenkins for build and AWS CodeDeploy for deployment. All these steps are managed by AWS CodePipeline. I was able to put codes from Github Enterprise to S3 bucket, however, when build jobs triggered, the zip package not making it over to the Jenkins instance that living in the same VPC. I use AWS Codepipeline plugin on Jenkins and the pipeline works fine when I pull repository directly from the public GitHub. It just doesn't work when I pull the repo from S3 bucket. The user and role I use are setup exactly like what's described in this document https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-four-stage-pipeline.html#tutorials-four-stage-pipeline-prerequisites Tried to fix that for the last couple of days but no luck and hoping you can provide some guidence.

      The error I am getting showing below:

      ------------ 
      Started by an SCM change Building in workspace /var/lib/jenkins/workspace/harrystage1 [AWS CodePipeline Plugin] Job '489208c6-a513-41dc-85a8-cc022cc516b8' received [AWS CodePipeline Plugin] Acknowledged job with ID: 489208c6-a513-41dc-85a8-cc022cc516b8 [AWS CodePipeline Plugin] Clearing workspace '/var/lib/jenkins/workspace/harrystage1' before download [AWS CodePipeline Plugin] Detected compression type: Zip [AWS CodePipeline Plugin] Successfully downloaded artifact from AWS CodePipeline [AWS CodePipeline Plugin] Extracting '/var/lib/jenkins/workspace/harrystage1/7LXLdqC.zip' to '/var/lib/jenkins/workspace/harrystage1' [AWS CodePipeline Plugin] Failed to acquire artifacts: The compressed input file contains files targeting an invalid destination: ./ [AWS CodePipeline Plugin] Stacktrace: [AWS CodePipeline Plugin] com.amazonaws.codepipeline.jenkinsplugin.ExtractionTools.getDestinationFile(ExtractionTools.java:114) [AWS CodePipeline Plugin] com.amazonaws.codepipeline.jenkinsplugin.ExtractionTools.extractZipFile(ExtractionTools.java:70) [AWS CodePipeline Plugin] com.amazonaws.codepipeline.jenkinsplugin.ExtractionTools.extractZip(ExtractionTools.java:46) [AWS CodePipeline Plugin] com.amazonaws.codepipeline.jenkinsplugin.ExtractionTools.decompressFile(ExtractionTools.java:176) [AWS CodePipeline Plugin] com.amazonaws.codepipeline.jenkinsplugin.DownloadCallable.downloadAndExtract(DownloadCallable.java:127) [AWS CodePipeline Plugin] com.amazonaws.codepipeline.jenkinsplugin.DownloadCallable.invoke(DownloadCallable.java:87) [AWS CodePipeline Plugin] com.amazonaws.codepipeline.jenkinsplugin.DownloadCallable.invoke(DownloadCallable.java:36) [AWS CodePipeline Plugin] hudson.FilePath.act(FilePath.java:997) [AWS CodePipeline Plugin] hudson.FilePath.act(FilePath.java:975) [AWS CodePipeline Plugin] com.amazonaws.codepipeline.jenkinsplugin.AWSCodePipelineSCM.checkout(AWSCodePipelineSCM.java:234) [AWS CodePipeline Plugin] hudson.model.AbstractProject.checkout(AbstractProject.java:1212) [AWS CodePipeline Plugin] hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:560) [AWS CodePipeline Plugin] jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) [AWS CodePipeline Plugin] hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:485) [AWS CodePipeline Plugin] hudson.model.Run.execute(Run.java:1735) [AWS CodePipeline Plugin] hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) [AWS CodePipeline Plugin] hudson.model.ResourceController.execute(ResourceController.java:97) [AWS CodePipeline Plugin] hudson.model.Executor.run(Executor.java:415) [AWS CodePipeline Plugin] Build was aborted [AWS CodePipeline Plugin] Publishing artifacts [AWS CodePipeline Plugin] Build failed, calling PutJobFailureResult Build step 'AWS CodePipeline Publisher' marked build as failure Finished: ABORTED
      

        Attachments

          Activity

          Hide
          wah0310 Harry Lau added a comment -

          Can we downgrade to 0.34?

          Will that be a more stable version to use without the major bugs?

          Show
          wah0310 Harry Lau added a comment - Can we downgrade to 0.34? Will that be a more stable version to use without the major bugs?
          Hide
          fgalmeida Felipe Almeida added a comment -

          Version 0.34 won't work with newer Jenkins versions

          Show
          fgalmeida Felipe Almeida added a comment - Version 0.34 won't work with newer Jenkins versions
          Hide
          wah0310 Harry Lau added a comment -

          What is the compatible version of Jenkins that codepipeline-0.34 works with? And where can I obtain the older version of the .hpi file of the plugin?

          We will use the old working version until the bug is fixed.  

          Show
          wah0310 Harry Lau added a comment - What is the compatible version of Jenkins that codepipeline-0.34 works with? And where can I obtain the older version of the .hpi file of the plugin? We will use the old working version until the bug is fixed.  
          Hide
          fgalmeida Felipe Almeida added a comment -

          Hi,

          the fix is pushed to https://github.com/awslabs/aws-codepipeline-plugin-for-jenkins but the plugin release will still take a few days, as a workaround, you can download the source and build the plugin using the following instructions:

          1. $ git clone https://github.com/awslabs/aws-codepipeline-plugin-for-jenkins.git

          2. $ cd aws-codepipeline-plugin-for-jenkins

          3. $ mvn package

          4. Go to you jenkins instance plugin management page (Manage Jenkins > Manage Plugins)

          5. Click Advanced tab

          6. In Upload Plugin section, click browse and select aws-codepipeline.hpi in aws-codepipeline-plugin-for-jenkins/target

          7. Click upload

          8. Select Restart Jenkins when installation is complete and no jobs are running checkbox

           

          That should fix your issue.

           

          Note: To build the plugin Maven 2 and Java 7 or 8 are required, the build will fail with Java 9+

           

           

           

          Show
          fgalmeida Felipe Almeida added a comment - Hi, the fix is pushed to https://github.com/awslabs/aws-codepipeline-plugin-for-jenkins but the plugin release will still take a few days, as a workaround, you can download the source and build the plugin using the following instructions: 1. $ git clone https://github.com/awslabs/aws-codepipeline-plugin-for-jenkins.git 2. $ cd aws-codepipeline-plugin-for-jenkins 3. $ mvn package 4. Go to you jenkins instance plugin management page (Manage Jenkins > Manage Plugins) 5. Click Advanced tab 6. In Upload Plugin section, click browse and select aws-codepipeline.hpi in aws-codepipeline-plugin-for-jenkins/target 7. Click upload 8. Select Restart Jenkins when installation is complete and no jobs are running checkbox   That should fix your issue.   Note: To build the plugin Maven 2 and Java 7 or 8 are required, the build will fail with Java 9+      
          Hide
          fgalmeida Felipe Almeida added a comment -

          AWS CodePipeline plugin 0.38 was just released, it contains a fix for this issue.

           

          See: https://wiki.jenkins.io/display/JENKINS/AWS+CodePipeline+Plugin

          Show
          fgalmeida Felipe Almeida added a comment - AWS CodePipeline plugin 0.38 was just released, it contains a fix for this issue.   See: https://wiki.jenkins.io/display/JENKINS/AWS+CodePipeline+Plugin

            People

            Assignee:
            fgalmeida Felipe Almeida
            Reporter:
            wah0310 Harry Lau
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: