awslabs / aws-codepipeline-plugin-for-jenkins

Use this plugin to integrate your Jenkins project with a pipeline in AWS CodePipeline. For more information and step-by-step directions on how to install and configure this plugin, follow the Four Stage Pipeline Tutorial. http://docs.aws.amazon.com/codepipeline/latest/userguide/getting-started-4.html
Apache License 2.0
82 stars 68 forks source link

EMPTY_STRING_SHA256_HEX exception when publishing build result #3

Closed mattmcclean closed 9 years ago

mattmcclean commented 9 years ago

Hi,

I am getting the following error when running the CodePipelines Jenkins plugin as a build task. The build works fine and I generate a file for the build result however the plugin has the following stack trace error when trying to publish the build artefact to S3 in the Post Build action: AWS CodePipeline Publisher. For this action I configured the value for Location to be result/output.txt.

I am running with the plugin file: aws-codepipeline-plugin-for-jenkins-0.1.hpi

[AWS CodePipeline Plugin] Publishing Artifacts
[AWS CodePipeline Plugin] Compressing Directory 'result/output.txt' as a 'Zip' archive
[AWS CodePipeline Plugin] Uploading Artifact: {Name: MyAppBuild,Location: {Type: S3,S3Location: {BucketName: codepipeline-us-east-1-824586205417,ObjectKey: DockerDemo/MyAppBuild/JG0Py6O}}}, file: /tmp/DockerDemo-2107315773527791876.zip
[AWS CodePipeline Plugin] Build Succeeded. PutJobSuccessResult
ERROR: Publisher com.amazonaws.codepipeline.jenkinsplugin.AWSCodePipelinePublisher aborted due to exception
java.lang.NoSuchFieldError: EMPTY_STRING_SHA256_HEX
    at com.amazonaws.auth.AwsChunkedEncodingInputStream.createSignedChunk(AwsChunkedEncodingInputStream.java:336)
    at com.amazonaws.auth.AwsChunkedEncodingInputStream.setUpNextChunk(AwsChunkedEncodingInputStream.java:325)
    at com.amazonaws.auth.AwsChunkedEncodingInputStream.read(AwsChunkedEncodingInputStream.java:172)
    at org.apache.http.entity.InputStreamEntity.writeTo(InputStreamEntity.java:142)
    at com.amazonaws.http.RepeatableInputStreamRequestEntity.writeTo(RepeatableInputStreamRequestEntity.java:153)
    at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:96)
    at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:112)
    at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:117)
    at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:265)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.sendRequestEntity(ManagedClientConnectionImpl.java:203)
    at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:237)
    at com.amazonaws.http.protocol.SdkHttpRequestExecutor.doSendRequest(SdkHttpRequestExecutor.java:47)
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:122)
    at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:685)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:487)
    at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:882)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
    at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:686)
    at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:461)
    at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:296)
    at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:3674)
    at com.amazonaws.services.s3.AmazonS3Client.doUploadPart(AmazonS3Client.java:2808)
    at com.amazonaws.services.s3.AmazonS3Client.uploadPart(AmazonS3Client.java:2793)
    at com.amazonaws.codepipeline.jenkinsplugin.UploadTools.uploadFile(UploadTools.java:121)
    at com.amazonaws.codepipeline.jenkinsplugin.AWSCodePipelinePublisher.uploadArtifacts(AWSCodePipelinePublisher.java:162)
    at com.amazonaws.codepipeline.jenkinsplugin.AWSCodePipelinePublisher.publishArtifacts(AWSCodePipelinePublisher.java:137)
    at com.amazonaws.codepipeline.jenkinsplugin.AWSCodePipelinePublisher.perform(AWSCodePipelinePublisher.java:97)
    at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
    at hudson.model.Build$BuildExecution.post2(Build.java:183)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
    at hudson.model.Run.execute(Run.java:1766)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:374)
Finished: FAILURE
ghost commented 9 years ago

Same here, no matter what I do I get this error, on latest jenkins.

JoeVieira commented 9 years ago

I've been running into this issue as well. Using Jenkins 1.620

JoeVieira commented 9 years ago

The latest build seems to have resolved my issues. I think it has something to do with the refactor in src/main/java/com/amazonaws/codepipeline/jenkinsplugin/AWSCodePipelinePublisher.java Seems the s3 publishing was seriously simplified. @kevingraham77 @mattmcclean

schmittthomas commented 9 years ago

Please use the latest plugin. We have update the AWS SDK for Java and added remoting support in 1a9be5e. Closing this ticket.