0

I'm trying to run jenkins tests from my AWS codePipeline.

I'm new to Jenkins so I don't really know what's going on.

What I can Tell is codePipeline get code from GitHub, send it to my EC2 server where jenkins is installed, and it runs "something" ( I don't really know what, I just want to run phpunit )

Started by an SCM change
Building in workspace /home/tomcat/.jenkins/workspace/RHTest
[AWS CodePipeline Plugin] Job '0c947e80-2b61-400b-b574-879a06ebaac0' received
[AWS CodePipeline Plugin] Clearing Workspace '/home/tomcat/.jenkins/workspace/RHTest' before download
[AWS CodePipeline Plugin] Detected compression type: Zip
[AWS CodePipeline Plugin] Successfully downloaded the artifacts from CodePipeline
[AWS CodePipeline Plugin] File downloaded successfully
[AWS CodePipeline Plugin] Extracting '/home/tomcat/.jenkins/workspace/RHTest/rX6QseT.zip' to '/home/tomcat/.jenkins/workspace/RHTest'
[AWS CodePipeline Plugin] File uncompressed successfully
[AWS CodePipeline Plugin] Publishing artifacts
[AWS CodePipeline Plugin] /home/tomcat/.jenkins/workspace/RHTest/target/rhtest
[AWS CodePipeline Plugin] Stacktrace:
[AWS CodePipeline Plugin] sun.nio.fs.UnixException.translateToIOException(Unknown Source)
[AWS CodePipeline Plugin] sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)
[AWS CodePipeline Plugin] sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)
[AWS CodePipeline Plugin] sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(Unknown Source)
[AWS CodePipeline Plugin] sun.nio.fs.UnixFileSystemProvider.readAttributes(Unknown Source)
[AWS CodePipeline Plugin] sun.nio.fs.LinuxFileSystemProvider.readAttributes(Unknown Source)
[AWS CodePipeline Plugin] java.nio.file.Files.readAttributes(Unknown Source)
[AWS CodePipeline Plugin] java.nio.file.FileTreeWalker.walk(Unknown Source)
[AWS CodePipeline Plugin] java.nio.file.FileTreeWalker.walk(Unknown Source)
[AWS CodePipeline Plugin] java.nio.file.Files.walkFileTree(Unknown Source)
[AWS CodePipeline Plugin] com.amazonaws.codepipeline.jenkinsplugin.CompressionTools.addFilesToCompress(CompressionTools.java:176)
[AWS CodePipeline Plugin] com.amazonaws.codepipeline.jenkinsplugin.CompressionTools.compressArchive(CompressionTools.java:153)
[AWS CodePipeline Plugin] com.amazonaws.codepipeline.jenkinsplugin.CompressionTools.compressZipFile(CompressionTools.java:92)
[AWS CodePipeline Plugin] com.amazonaws.codepipeline.jenkinsplugin.CompressionTools.compressFile(CompressionTools.java:66)
[AWS CodePipeline Plugin] com.amazonaws.codepipeline.jenkinsplugin.PublisherCallable.invoke(PublisherCallable.java:78)
[AWS CodePipeline Plugin] com.amazonaws.codepipeline.jenkinsplugin.PublisherCallable.invoke(PublisherCallable.java:34)
[AWS CodePipeline Plugin] hudson.FilePath.act(FilePath.java:990)
[AWS CodePipeline Plugin] hudson.FilePath.act(FilePath.java:968)
[AWS CodePipeline Plugin] com.amazonaws.codepipeline.jenkinsplugin.AWSCodePipelinePublisher.callPublish(AWSCodePipelinePublisher.java:163)
[AWS CodePipeline Plugin] com.amazonaws.codepipeline.jenkinsplugin.AWSCodePipelinePublisher.perform(AWSCodePipelinePublisher.java:129)
[AWS CodePipeline Plugin] hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
[AWS CodePipeline Plugin] hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
[AWS CodePipeline Plugin] hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
[AWS CodePipeline Plugin] hudson.model.Build$BuildExecution.post2(Build.java:185)
[AWS CodePipeline Plugin] hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
[AWS CodePipeline Plugin] hudson.model.Run.execute(Run.java:1763)
[AWS CodePipeline Plugin] hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
[AWS CodePipeline Plugin] hudson.model.ResourceController.execute(ResourceController.java:98)
[AWS CodePipeline Plugin] hudson.model.Executor.run(Executor.java:410)
[AWS CodePipeline Plugin] 

[AWS CodePipeline Plugin] Build Failed. PutJobFailureResult
Build step 'AWS CodePipeline Publisher' marked build as failure
Finished: FAILURE

Then I started again manually the job,

Started by user JuliancitoBravo
    Building in workspace /home/tomcat/.jenkins/workspace/RHTest
    [AWS CodePipeline Plugin] Job '0c947e80-2b61-400b-b574-879a06ebaac0' received
    [AWS CodePipeline Plugin] Clearing Workspace '/home/tomcat/.jenkins/workspace/RHTest' before download
    [AWS CodePipeline Plugin] Detected compression type: Zip
    [AWS CodePipeline Plugin] Successfully downloaded the artifacts from CodePipeline
    [AWS CodePipeline Plugin] File downloaded successfully
    [AWS CodePipeline Plugin] Extracting '/home/tomcat/.jenkins/workspace/RHTest/rX6QseT.zip' to '/home/tomcat/.jenkins/workspace/RHTest'
    [AWS CodePipeline Plugin] File uncompressed successfully
    [AWS CodePipeline Plugin] Publishing artifacts
    [AWS CodePipeline Plugin] Build Succeeded. PutJobSuccessResult
    ERROR: Build step failed with exception
    com.amazonaws.services.codepipeline.model.InvalidJobStateException: Job with id 0c947e80-2b61-400b-b574-879a06ebaac0 has already terminated (Service: AWSCodePipeline; Status Code: 400; Error Code: InvalidJobStateException; Request ID: 1fda4ec8-f14b-11e5-ad9e-a7b383532abe)
        at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1182)
        at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:770)
        at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:489)
        at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:310)
        at com.amazonaws.services.codepipeline.AWSCodePipelineClient.invoke(AWSCodePipelineClient.java:1615)
        at com.amazonaws.services.codepipeline.AWSCodePipelineClient.putJobSuccessResult(AWSCodePipelineClient.java:1352)
        at com.amazonaws.codepipeline.jenkinsplugin.PublisherTools.putJobResult(PublisherTools.java:65)
        at com.amazonaws.codepipeline.jenkinsplugin.AWSCodePipelinePublisher.perform(AWSCodePipelinePublisher.java:139)
        at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
        at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
        at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
        at hudson.model.Build$BuildExecution.post2(Build.java:185)
        at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
        at hudson.model.Run.execute(Run.java:1763)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
        at hudson.model.ResourceController.execute(ResourceController.java:98)
        at hudson.model.Executor.run(Executor.java:410)
    Build step 'AWS CodePipeline Publisher' marked build as failure
    Finished: FAILURE

In this last log, I can see an error 400, but in Jenkins CodePipeline Plugin, I set Access Key Id / Secret Access Key from admin user, so it should not be a problem...

Can you help me find what the problem is???

Tx!!!

1 Answer 1

0

Looks like the plugin is failing when compressing the workspace to upload the build result to S3:

[AWS CodePipeline Plugin] sun.nio.fs.UnixException.translateToIOException(Unknown Source)
[AWS CodePipeline Plugin] sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)
[AWS CodePipeline Plugin] sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)
[AWS CodePipeline Plugin] sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(Unknown Source)
[AWS CodePipeline Plugin] sun.nio.fs.UnixFileSystemProvider.readAttributes(Unknown Source)
[AWS CodePipeline Plugin] sun.nio.fs.LinuxFileSystemProvider.readAttributes(Unknown Source)
[AWS CodePipeline Plugin] java.nio.file.Files.readAttributes(Unknown Source)
[AWS CodePipeline Plugin] java.nio.file.FileTreeWalker.walk(Unknown Source)
[AWS CodePipeline Plugin] java.nio.file.FileTreeWalker.walk(Unknown Source)
[AWS CodePipeline Plugin] java.nio.file.Files.walkFileTree(Unknown Source)

Are you using symbolic links? Could there be a cycle in your workspace? Or not have the necessary permissions?

http://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#walkFileTree-java.nio.file.Path-java.util.Set-int-java.nio.file.FileVisitor-

If the options parameter contains the FOLLOW_LINKS option then this method keeps track of directories visited so that cycles can be detected. A cycle arises when there is an entry in a directory that is an ancestor of the directory. Cycle detection is done by recording the file-key of directories, or if file keys are not available, by invoking the isSameFile method to test if a directory is the same file as an ancestor. When a cycle is detected it is treated as an I/O error, and the visitFileFailed method is invoked with an instance of FileSystemLoopException.

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

1 Comment

Did you configure an output location in your project (Post-build Actions -> AWS CodePipeline Publisher)? Often, you'll want at least one output (the result of your build), so the next actions in the pipeline can use it (like a deploy action). But if you really don't need it (for example, you're using Jenkins to run tests), then try deleting the output location (but don't remove the AWS CodePipeline Publisher post-build action).

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.