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

File overwrite option

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I would like the plugin to optionally overwrite existing files.

      We already have the Clean remote option but this removes the existing Dropbox sharing links to the removed files which is something I do not want. When I run a build without the Clean remote option, the build results as unstable with following exception stack trace in the Jenkins log:

      Srp 03, 2017 7:18:43 ODP. jenkins.plugins.publish_over.BPCallablePublisher invoke
      WARNING: Exception when publishing, exception message [Could not write file. Server message: Storing failed]
      jenkins.plugins.publish_over.BapPublisherException: Could not write file. Server message: Storing failed
      at org.jenkinsci.plugins.publishoverdropbox.domain.DropboxClient.transferFile(DropboxClient.java:103)
      at org.jenkinsci.plugins.publishoverdropbox.domain.DropboxClient.transferFile(DropboxClient.java:40)
      at jenkins.plugins.publish_over.BPTransfer.transferFile(BPTransfer.java:171)
      at jenkins.plugins.publish_over.BPTransfer.transfer(BPTransfer.java:155)
      at jenkins.plugins.publish_over.BPTransfer.transfer(BPTransfer.java:142)
      at jenkins.plugins.publish_over.BapPublisher$Performer.transfer(BapPublisher.java:276)
      at jenkins.plugins.publish_over.BapPublisher$Performer.perform(BapPublisher.java:232)
      at jenkins.plugins.publish_over.BapPublisher$Performer.access$000(BapPublisher.java:205)
      at jenkins.plugins.publish_over.BapPublisher.perform(BapPublisher.java:158)
      at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:64)
      at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:37)
      at hudson.FilePath.act(FilePath.java:998)
      at hudson.FilePath.act(FilePath.java:976)
      at jenkins.plugins.publish_over.BPInstanceConfig.perform(BPInstanceConfig.java:138)
      at jenkins.plugins.publish_over.BPPlugin.perform(BPPlugin.java:111)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:735)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:676)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1072)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:621)
      at hudson.model.Run.execute(Run.java:1760)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:542)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:405)
      Caused by: org.jenkinsci.plugins.publishoverdropbox.domain.model.RestException: Failed to open connection to server
      at org.jenkinsci.plugins.publishoverdropbox.domain.JsonObjectRequest.execute(JsonObjectRequest.java:189)
      at org.jenkinsci.plugins.publishoverdropbox.domain.DropboxV2.chunkedStore(DropboxV2.java:357)
      at org.jenkinsci.plugins.publishoverdropbox.domain.DropboxV2.storeFile(DropboxV2.java:304)
      at org.jenkinsci.plugins.publishoverdropbox.domain.DropboxClient.transferFile(DropboxClient.java:101)
      ... 23 more
      Caused by: org.jenkinsci.plugins.publishoverdropbox.domain.model.RestException: caused by {error = path, errorSummary = 'path/conflict/file/..'}
      at org.jenkinsci.plugins.publishoverdropbox.domain.JsonObjectRequest.execute(JsonObjectRequest.java:179)
      ... 26 more
      Caused by: java.io.IOException: HTTP 409 error path/conflict/file/..
      ... 27 more

      Reading path/conflict/file I presume the problem is an existing file from previous build. Can you please confirm this first? With the Clean remote option set, the build passes successfully.

       

      My builds started to fail recently. Everything was working before a certain ammount of time - the files were always replaced and the sharing still worked. The thing I want primarily is to preserve the sharing links (e.g. make them always share the most recent version of a project). Is this possible? Does it make sense?

        Attachments

          Activity

          Hide
          rcgroot René de Groot added a comment -

          I understand. My guess would be that this is possible, I'll give a try see if replacing works and keeps the original link working.

          Show
          rcgroot René de Groot added a comment - I understand. My guess would be that this is possible, I'll give a try see if replacing works and keeps the original link working.
          Hide
          jansvajcr Jan Švajcr added a comment - - edited

          Thanks for giving it a try. Something must have changed recently (in the plugin v1.2 or Dropbox services) because the files were discretely uploaded & replaced before. Now it's failing the build. Or did I reconfigure something wrongly in Jenkins? Who knows. Take this either as just a suggestion or an issue - depending how much time you want to dedicate to this.

           

          By the way, thank you for such a cool plugin!

          Show
          jansvajcr Jan Švajcr added a comment - - edited Thanks for giving it a try. Something must have changed recently (in the plugin v1.2 or Dropbox services) because the files were discretely uploaded & replaced before. Now it's failing the build. Or did I reconfigure something wrongly in Jenkins? Who knows. Take this either as just a suggestion or an issue - depending how much time you want to dedicate to this.   By the way, thank you for such a cool plugin!
          Hide
          jansvajcr Jan Švajcr added a comment - - edited

          I have found a workaround to this. I can share a folder instead. Non-Dropbox users can access it through the link. The plugin will clear the folder contents before uploading while preserving the sharing settings. But still, this leaves the original suggestion relevant.

          Show
          jansvajcr Jan Švajcr added a comment - - edited I have found a workaround to this. I can share a folder instead. Non-Dropbox users can access it through the link. The plugin will clear the folder contents before uploading while preserving the sharing settings. But still, this leaves the original suggestion relevant.
          Hide
          rcgroot René de Groot added a comment -

          Found out what was the cause of the strange behaviour. Overwrite is the default for the plugin uploads. But small files and large files (4MB+) use different upload calls to Dropbox. The large upload does not follow the default overwrite and give this error. Smaller files will use overwrite when a existing file is encountered.

          I will create and release a fix in the coming days.

           

          Show
          rcgroot René de Groot added a comment - Found out what was the cause of the strange behaviour. Overwrite is the default for the plugin uploads. But small files and large files (4MB+) use different upload calls to Dropbox. The large upload does not follow the default overwrite and give this error. Smaller files will use overwrite when a existing file is encountered. I will create and release a fix in the coming days.  
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Rene de Groot
          Path:
          src/main/java/org/jenkinsci/plugins/publishoverdropbox/domain/model/requests/SessionFinish.java
          http://jenkins-ci.org/commit/publish-over-dropbox-plugin/31d5e9b5950f4bdb2716062c68f4b7630b88480e
          Log:
          Large files should also overwrite like small files

          Fixes JENKINS-46533

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Rene de Groot Path: src/main/java/org/jenkinsci/plugins/publishoverdropbox/domain/model/requests/SessionFinish.java http://jenkins-ci.org/commit/publish-over-dropbox-plugin/31d5e9b5950f4bdb2716062c68f4b7630b88480e Log: Large files should also overwrite like small files Fixes JENKINS-46533
          Hide
          jansvajcr Jan Švajcr added a comment -

          My personal project exceeded 4MBs recently. Now it all makes sense. Thanks for your time!

          Show
          jansvajcr Jan Švajcr added a comment - My personal project exceeded 4MBs recently. Now it all makes sense. Thanks for your time!
          Hide
          rcgroot René de Groot added a comment -

          Fixed in release 1.2.1

          Show
          rcgroot René de Groot added a comment - Fixed in release 1.2.1

            People

            Assignee:
            rcgroot René de Groot
            Reporter:
            jansvajcr Jan Švajcr
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: