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

post build deployment task fails with : Unbuffered entity enclosing request can not be repeated.

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • maven-plugin
    • None

      Since few weeks my builds aren't deploying artifacts from Maven but from the jenkins post build tasks to fail faster if there is a build issue and to not publish an unless incomplete set of artifacts SNAPSHOTs in the remote repositories.
      But since I use this I noticed various upload failures like this one :

      Maven RedeployPublished use remote  maven settings from : /home/swfhudson/.m2/settings.xml
      [INFO] Deployment in dav:http://repository.exoplatform.org/content/repositories/exo-snapshots (id=repository.exoplatform.org,uniqueVersion=true)
      Deploying the main artifact cs-2.1.6-SNAPSHOT.pom
      [INFO] Deployment in dav:http://repository.exoplatform.org/content/repositories/exo-snapshots (id=repository.exoplatform.org,uniqueVersion=true)
      Deploying the main artifact cs.packaging.module-2.1.6-SNAPSHOT.pom
      Deploying the main artifact cs.packaging.module-2.1.6-SNAPSHOT.js
      [INFO] Deployment in dav:http://repository.exoplatform.org/content/repositories/exo-snapshots (id=repository.exoplatform.org,uniqueVersion=true)
      Deploying the main artifact cs.packaging.product-2.1.6-SNAPSHOT.pom
      Deploying the main artifact cs.packaging.product-2.1.6-SNAPSHOT.js
      [INFO] Deployment in dav:http://repository.exoplatform.org/content/repositories/exo-snapshots (id=repository.exoplatform.org,uniqueVersion=true)
      Deploying the main artifact exo.cs.datamigration-2.1.6-SNAPSHOT.jar
      Deploying the main artifact exo.cs.datamigration-2.1.6-SNAPSHOT-sources.jar
      [INFO] Deployment in dav:http://repository.exoplatform.org/content/repositories/exo-snapshots (id=repository.exoplatform.org,uniqueVersion=true)
      Deploying the main artifact exo.cs.datamigration-import-2.1.6-SNAPSHOT.jar
      Deploying the main artifact exo.cs.datamigration-import-2.1.6-SNAPSHOT-sources.jar
      [INFO] Deployment in dav:http://repository.exoplatform.org/content/repositories/exo-snapshots (id=repository.exoplatform.org,uniqueVersion=true)
      Deploying the main artifact exo.cs.demo-2.1.6-SNAPSHOT.pom
      [INFO] Deployment in dav:http://repository.exoplatform.org/content/repositories/exo-snapshots (id=repository.exoplatform.org,uniqueVersion=true)
      Deploying the main artifact exo.cs.demo.cometd-war-2.1.6-SNAPSHOT.war
      ERROR: Failed to deploy artifacts: Could not transfer artifact org.exoplatform.cs:exo.cs.demo.cometd-war:war:2.1.6-20110621.183004-8 from/to repository.exoplatform.org (dav:http://repository.exoplatform.org/content/repositories/exo-snapshots): PUT request for: org/exoplatform/cs/exo.cs.demo.cometd-war/2.1.6-SNAPSHOT/exo.cs.demo.cometd-war-2.1.6-20110621.183004-8.war to exo.cs.demo.cometd-war-2.1.6-SNAPSHOT.war failed
      org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact org.exoplatform.cs:exo.cs.demo.cometd-war:war:2.1.6-20110621.183004-8 from/to repository.exoplatform.org (dav:http://repository.exoplatform.org/content/repositories/exo-snapshots): PUT request for: org/exoplatform/cs/exo.cs.demo.cometd-war/2.1.6-SNAPSHOT/exo.cs.demo.cometd-war-2.1.6-20110621.183004-8.war to exo.cs.demo.cometd-war-2.1.6-SNAPSHOT.war failed
      	at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:141)
      	at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:148)
      	at hudson.maven.RedeployPublisher.perform(RedeployPublisher.java:146)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
      	at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:664)
      	at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:639)
      	at hudson.maven.MavenModuleSetBuild$RunnerImpl.post2(MavenModuleSetBuild.java:895)
      	at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:586)
      	at hudson.model.Run.run(Run.java:1400)
      	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:465)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:146)
      Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact org.exoplatform.cs:exo.cs.demo.cometd-war:war:2.1.6-20110621.183004-8 from/to repository.exoplatform.org (dav:http://repository.exoplatform.org/content/repositories/exo-snapshots): PUT request for: org/exoplatform/cs/exo.cs.demo.cometd-war/2.1.6-SNAPSHOT/exo.cs.demo.cometd-war-2.1.6-20110621.183004-8.war to exo.cs.demo.cometd-war-2.1.6-SNAPSHOT.war failed
      	at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:284)
      	at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:215)
      	at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:480)
      	at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:137)
      	... 11 more
      Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact org.exoplatform.cs:exo.cs.demo.cometd-war:war:2.1.6-20110621.183004-8 from/to repository.exoplatform.org (dav:http://repository.exoplatform.org/content/repositories/exo-snapshots): PUT request for: org/exoplatform/cs/exo.cs.demo.cometd-war/2.1.6-SNAPSHOT/exo.cs.demo.cometd-war-2.1.6-20110621.183004-8.war to exo.cs.demo.cometd-war-2.1.6-SNAPSHOT.war failed
      	at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:949)
      	at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:940)
      	at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.flush(WagonRepositoryConnector.java:864)
      	at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:466)
      	at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:278)
      	... 14 more
      Caused by: org.apache.maven.wagon.TransferFailedException: PUT request for: org/exoplatform/cs/exo.cs.demo.cometd-war/2.1.6-SNAPSHOT/exo.cs.demo.cometd-war-2.1.6-20110621.183004-8.war to exo.cs.demo.cometd-war-2.1.6-SNAPSHOT.war failed
      	at org.apache.maven.wagon.providers.webdav.WebDavWagon.put(WebDavWagon.java:343)
      	at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.run(WagonRepositoryConnector.java:825)
      	at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:465)
      	... 15 more
      Caused by: org.apache.commons.httpclient.ProtocolException: Unbuffered entity enclosing request can not be repeated.
      	at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:487)
      	at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2110)
      	at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1088)
      	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
      	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
      	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
      	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
      	at org.apache.maven.wagon.providers.webdav.CorrectedWebdavResource.putMethod(CorrectedWebdavResource.java:157)
      	at org.apache.maven.wagon.providers.webdav.WebDavWagon.put(WebDavWagon.java:290)
      	... 17 more
      [INFO] Deployment failed after 9 min 4 sec
      

      Searching a little bit we can find this issue (http://jira.codehaus.org/browse/WAGON-108) where it is said that it could be related to the version of the wagon used and the httpcommons-client.
      Digging in my server apache logs I can see that all uploads from jenkins are marked as :

      127.0.0.1 - - [21/Jun/2011:20:30:37 +0200] "PUT /content/repositories/exo-snapshots/org/exoplatform/cs/exo.cs.demo.cometd-war/2.1.6-SNAPSHOT/exo.cs.demo.cometd-war-2.1.6-20110621.183004-8.war HTTP/1.1" 400 386 "-" "Jakarta Commons-HttpClient/3.1-rc1"
      

      It is using "Jakarta Commons-HttpClient/3.1-rc1" while my maven builds are using the wagon org.apache.maven.wagon:wagon-webdav-jackrabbit:1.0-beta-7 which has a dependency to commons-httpclient:commons-httpclient:3.1
      I never had this upload error when I deployed from Maven itself thus there is either a classloader issue or something badly implemented which doesn't use the wagon defined in the project pom.

          [JENKINS-10076] post build deployment task fails with : Unbuffered entity enclosing request can not be repeated.

          Arnaud Héritier created issue -

          The culprit from maven-plugin deps analyzis :

          [INFO] +- org.jenkins-ci.main.maven:maven-agent:jar:1.2:compile
          [INFO] |  \- commons-httpclient:commons-httpclient:jar:3.1-rc1:compile
          [INFO] |     +- commons-logging:commons-logging:jar:1.0.4:compile
          [INFO] |     \- commons-codec:commons-codec:jar:1.2:compile
          

          I don't yet know if we don't use at all the wagon I asked to used in my build (org.apache.maven.wagon:wagon-webdav-jackrabbit:1.0-beta-7) as I can see several wagon deps :

          [INFO] +- org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-beta-7:compile
          [INFO] |  \- org.apache.maven.wagon:wagon-http-shared:jar:1.0-beta-7:compile
          [INFO] +- org.apache.maven.wagon:wagon-file:jar:1.0-beta-7:compile
          [INFO] +- org.apache.maven.wagon:wagon-ftp:jar:1.0-beta-7:compile
          [INFO] |  \- commons-net:commons-net:jar:2.0:compile
          [INFO] +- org.apache.maven.wagon:wagon-ssh:jar:1.0-beta-7:compile
          [INFO] |  +- com.jcraft:jsch:jar:0.1.38:compile
          [INFO] |  \- org.apache.maven.wagon:wagon-ssh-common:jar:1.0-beta-7:compile
          [INFO] |     \- org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-6:compile
          [INFO] +- org.apache.maven.wagon:wagon-ssh-external:jar:1.0-beta-7:compile
          [INFO] +- org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-7:compile
          

          Or if we use it but we have a classloader/deps issue which makes it use the wrong version of commons-httpclient

          Arnaud Héritier added a comment - The culprit from maven-plugin deps analyzis : [INFO] +- org.jenkins-ci.main.maven:maven-agent:jar:1.2:compile [INFO] | \- commons-httpclient:commons-httpclient:jar:3.1-rc1:compile [INFO] | +- commons-logging:commons-logging:jar:1.0.4:compile [INFO] | \- commons-codec:commons-codec:jar:1.2:compile I don't yet know if we don't use at all the wagon I asked to used in my build (org.apache.maven.wagon:wagon-webdav-jackrabbit:1.0-beta-7) as I can see several wagon deps : [INFO] +- org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-beta-7:compile [INFO] | \- org.apache.maven.wagon:wagon-http-shared:jar:1.0-beta-7:compile [INFO] +- org.apache.maven.wagon:wagon-file:jar:1.0-beta-7:compile [INFO] +- org.apache.maven.wagon:wagon-ftp:jar:1.0-beta-7:compile [INFO] | \- commons-net:commons-net:jar:2.0:compile [INFO] +- org.apache.maven.wagon:wagon-ssh:jar:1.0-beta-7:compile [INFO] | +- com.jcraft:jsch:jar:0.1.38:compile [INFO] | \- org.apache.maven.wagon:wagon-ssh-common:jar:1.0-beta-7:compile [INFO] | \- org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-6:compile [INFO] +- org.apache.maven.wagon:wagon-ssh-external:jar:1.0-beta-7:compile [INFO] +- org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-7:compile Or if we use it but we have a classloader/deps issue which makes it use the wrong version of commons-httpclient

          The real fix is to real use a Maven JVM like we could create one for a deploy:deploy to be sure to use MAVEN_OPTS options, the set of wagons configured in the build ....

          Arnaud Héritier added a comment - The real fix is to real use a Maven JVM like we could create one for a deploy:deploy to be sure to use MAVEN_OPTS options, the set of wagons configured in the build ....
          Arnaud Héritier made changes -
          Link New: This issue depends on JENKINS-9805 [ JENKINS-9805 ]

          Code changed in jenkins
          User: Olivier Lamy
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/2b8930c1d4f89a73526d647e4983d7b1c03c49ec
          Log:
          changelog for JENKINS-10076

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: changelog.html http://jenkins-ci.org/commit/jenkins/2b8930c1d4f89a73526d647e4983d7b1c03c49ec Log: changelog for JENKINS-10076

          I confirm the fix done deployments (using webdav) are done using "Jakarta Commons-HttpClient/3.1" and no more the RC1.
          I will deploy it in production to check that it solves the "Unbuffered entity enclosing request can not be repeated." error which for now occurs several times per day. We'll see the result tomorrow (hoping the master build isn't broken somewhere else )

          Arnaud Héritier added a comment - I confirm the fix done deployments (using webdav) are done using "Jakarta Commons-HttpClient/3.1" and no more the RC1. I will deploy it in production to check that it solves the "Unbuffered entity enclosing request can not be repeated." error which for now occurs several times per day. We'll see the result tomorrow (hoping the master build isn't broken somewhere else )

          a last question is that I don't know if it is better for webdav to use this wagon like nowadays :

              <dependency>
                <!-- commonly used wagon provider -->
                <groupId>org.jvnet.hudson</groupId>
                <artifactId>wagon-webdav</artifactId>
                <version>1.0-beta-2-hudson-1</version>
                <exclusions>
                  <exclusion>
                    <groupId>jdom</groupId>
                    <artifactId>jdom</artifactId>
                  </exclusion>
                </exclusions>
              </dependency>
          

          or maybe we could come back to a more standard one :

                    <dependency>
                      <groupId>org.apache.maven.wagon</groupId>
                      <artifactId>wagon-webdav-jackrabbit</artifactId>
                      <version>1.0-beta-7</version>
                    </dependency>
          

          ???

          Arnaud Héritier added a comment - a last question is that I don't know if it is better for webdav to use this wagon like nowadays : <dependency> <!-- commonly used wagon provider --> <groupId>org.jvnet.hudson</groupId> <artifactId>wagon-webdav</artifactId> <version>1.0-beta-2-hudson-1</version> <exclusions> <exclusion> <groupId>jdom</groupId> <artifactId>jdom</artifactId> </exclusion> </exclusions> </dependency> or maybe we could come back to a more standard one : <dependency> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-webdav-jackrabbit</artifactId> <version>1.0-beta-7</version> </dependency> ???
          Arnaud Héritier made changes -
          Assignee Original: Arnaud Héritier [ aheritier ] New: Olivier Lamy [ olamy ]

          Again the same error even with the usage of http client 3.1 final :

          127.0.0.1 - - [23/Jun/2011:01:04:29 +0200] "PUT /content/repositories/exo-private-snapshots/org/exoplatform/platform/exo.platform.sample.acme-website.ear/3.0.6-SNAPSHOT/exo.platform.sample.acme-website.ear-3.0.6-20110622.230351-10.pom HTTP/1.1" 400 386 "-" "Jakarta Commons-HttpClient/3.1"
          
          

          I will try on my instance to replace the webdav wagon org.jvnet.hudson:wagon-webdav:1.0-beta-2-hudson-1 by org.apache.maven.wagon:wagon-webdav-jackrabbit:1.0-beta-7

          Arnaud Héritier added a comment - Again the same error even with the usage of http client 3.1 final : 127.0.0.1 - - [23/Jun/2011:01:04:29 +0200] "PUT /content/repositories/exo- private -snapshots/org/exoplatform/platform/exo.platform.sample.acme-website.ear/3.0.6-SNAPSHOT/exo.platform.sample.acme-website.ear-3.0.6-20110622.230351-10.pom HTTP/1.1" 400 386 "-" "Jakarta Commons-HttpClient/3.1" I will try on my instance to replace the webdav wagon org.jvnet.hudson:wagon-webdav:1.0-beta-2-hudson-1 by org.apache.maven.wagon:wagon-webdav-jackrabbit:1.0-beta-7

          Arnaud Héritier added a comment - @olamy : please see : https://github.com/jenkinsci/jenkins/pull/177

            olamy Olivier Lamy
            aheritier Arnaud Héritier
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: