-
Bug
-
Resolution: Fixed
-
Critical
-
None
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
This file name threw me off 7LXLdqC.zip
The filename that in S3 bucket actually different than the one shows in the log. The filename changed to 7LXLdqC.zip
When I manually download the zip file from S3 and ran the unzip command, it shows ok but nothing got extracted. See below output:
root@jenkins:/var/lib/jenkins/workspace/myweb# unzip -t /var/lib/jenkins/workspace/myweb/stage_branch_test.zip
Archive: /var/lib/jenkins/workspace/myweb/stage_branch_test.zip
testing: ./ OK
testing: appspec.yml OK
testing: index.html OK
testing: scripts/ OK
testing: scripts/restart_server OK
testing: scripts/before_install OK
No errors detected in compressed data of /var/lib/jenkins/workspace/myweb/bt_harrystage_branch_test.zip.
When I do a list, nothing got unzipped.
root@jenkins:/var/lib/jenkins/workspace/myweb# ls -la
total 12
drwxr-xr-x 2 jenkins jenkins 4096 Jun 19 21:15 .
drwxr-xr-x 3 jenkins jenkins 4096 Jun 19 21:14 ..