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

Fails with "ERROR: Publisher jenkins.plugins.jclouds.blobstore.BlobStorePublisher aborted due to exception java.lang.IllegalArgumentException: contentLength must be set, streaming not supported"

    Details

    • Similar Issues:

      Description

      Using the latest version of both the JClouds plugin and Jenkins, I get the following exception when trying to push assets to an Amazon S3 bucket:

      `ERROR: Publisher jenkins.plugins.jclouds.blobstore.BlobStorePublisher aborted due to exception java.lang.IllegalArgumentException: contentLength must be set, streaming not supported`

      Full trace below:

      ```
      Started by user aendrew
      Building in workspace /var/lib/jenkins/jobs/projectname/workspace
      Fetching changes from the remote Git repository
      Fetching upstream changes from https://github.com/aendrew/something.git
      using .gitcredentials to set credentials
      Checking out Revision 3508b73795599970ed4629c37fcd045c06cf3c87 (origin/master)
      Publish artifacts to JClouds Clouds Storage Using JClouds blobStoreProfile: Static S3
      Publish artifacts to JClouds Clouds Storage container=my-bucket-name, path=2014/projectname/public, file=favicon.ico
      ERROR: Publisher jenkins.plugins.jclouds.blobstore.BlobStorePublisher aborted due to exception
      java.lang.IllegalArgumentException: contentLength must be set, streaming not supported
      at shaded.com.google.common.base.Preconditions.checkArgument(Preconditions.java:93)
      at org.jclouds.s3.binders.BindS3ObjectMetadataToRequest.bindToRequest(BindS3ObjectMetadataToRequest.java:52)
      at org.jclouds.rest.internal.RestAnnotationProcessor.decorateRequest(RestAnnotationProcessor.java:631)
      at org.jclouds.rest.internal.RestAnnotationProcessor.apply(RestAnnotationProcessor.java:330)
      at org.jclouds.rest.internal.RestAnnotationProcessor.apply(RestAnnotationProcessor.java:133)
      at org.jclouds.rest.internal.InvokeSyncToAsyncHttpMethod.toCommand(InvokeSyncToAsyncHttpMethod.java:238)
      at org.jclouds.rest.internal.InvokeSyncToAsyncHttpMethod.invoke(InvokeSyncToAsyncHttpMethod.java:123)
      at org.jclouds.rest.internal.InvokeSyncToAsyncHttpMethod.apply(InvokeSyncToAsyncHttpMethod.java:95)
      at org.jclouds.rest.internal.InvokeSyncToAsyncHttpMethod.apply(InvokeSyncToAsyncHttpMethod.java:56)
      at org.jclouds.rest.internal.DelegatesToInvocationFunction.handle(DelegatesToInvocationFunction.java:156)
      at org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke(DelegatesToInvocationFunction.java:123)
      at com.sun.proxy.$Proxy99.putObject(Unknown Source)
      at org.jclouds.s3.blobstore.S3BlobStore.putBlob(S3BlobStore.java:239)
      at org.jclouds.aws.s3.blobstore.AWSS3BlobStore.putBlob(AWSS3BlobStore.java:98)
      at org.jclouds.s3.blobstore.S3BlobStore.putBlob(S3BlobStore.java:217)
      at jenkins.plugins.jclouds.blobstore.BlobStoreProfile.upload(BlobStoreProfile.java:122)
      at jenkins.plugins.jclouds.blobstore.BlobStorePublisher.perform(BlobStorePublisher.java:159)
      at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:745)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:709)
      at hudson.model.Build$BuildExecution.post2(Build.java:182)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:658)
      at hudson.model.Run.execute(Run.java:1731)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:231)
      Finished: FAILURE
      ```

        Attachments

          Activity

          Hide
          demobox Andrew Phillips added a comment -

          It looks like BlobStoreProfile is simply forgetting to set a contentLength?

          Blob blob = context.getBlobStore().blobBuilder(destPath).payload(filePath.read()).build();
          

          See [1] and a related Stack Overflow question [2].

          [1] https://github.com/jenkinsci/jclouds-plugin/blob/master/jclouds-plugin/src/main/java/jenkins/plugins/jclouds/blobstore/BlobStoreProfile.java#L121
          [2] http://stackoverflow.com/questions/22105240/jclouds-s3-specify-content-length-when-uploading-file

          Show
          demobox Andrew Phillips added a comment - It looks like BlobStoreProfile is simply forgetting to set a contentLength? Blob blob = context.getBlobStore().blobBuilder(destPath).payload(filePath.read()).build(); See [1] and a related Stack Overflow question [2] . [1] https://github.com/jenkinsci/jclouds-plugin/blob/master/jclouds-plugin/src/main/java/jenkins/plugins/jclouds/blobstore/BlobStoreProfile.java#L121 [2] http://stackoverflow.com/questions/22105240/jclouds-s3-specify-content-length-when-uploading-file
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Fritz Elfert
          Path:
          jclouds-plugin/src/main/java/jenkins/plugins/jclouds/blobstore/BlobStoreProfile.java
          jclouds-plugin/src/main/java/jenkins/plugins/jclouds/blobstore/BlobStorePublisher.java
          http://jenkins-ci.org/commit/jclouds-plugin/13fa3324926ff51ec2e1cfb7bda1d41cd282ce74
          Log:
          Fixed JENKINS-23049
          Better error handling in BlobStore upload

          Compare: https://github.com/jenkinsci/jclouds-plugin/compare/4170abbd4367...13fa3324926f

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Fritz Elfert Path: jclouds-plugin/src/main/java/jenkins/plugins/jclouds/blobstore/BlobStoreProfile.java jclouds-plugin/src/main/java/jenkins/plugins/jclouds/blobstore/BlobStorePublisher.java http://jenkins-ci.org/commit/jclouds-plugin/13fa3324926ff51ec2e1cfb7bda1d41cd282ce74 Log: Fixed JENKINS-23049 Better error handling in BlobStore upload Compare: https://github.com/jenkinsci/jclouds-plugin/compare/4170abbd4367...13fa3324926f
          Hide
          felfert Fritz Elfert added a comment -

          Should be fixed in git now.

          Show
          felfert Fritz Elfert added a comment - Should be fixed in git now.

            People

            • Assignee:
              felfert Fritz Elfert
              Reporter:
              aendrew ├ćndrew Rininsland
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: