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

Unable to delete files with special characters when starting a build even if "Clean Build" is not checked

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • mercurial-plugin
    • Jenkins ver. 1.506; Mercurial plugin v. 1.44

      Note: "Clean Build" is NOT checked. But if I check it, the same problem happens.

      Error log:

      Started by user The User
      Building remotely on mybuildslave in workspace /jenkins-slave/workspace/MYPROJ-2.8.3
      ERROR: Failed to clean the repository checkout
      hudson.util.IOException2: remote file operation failed: /jenkins-slave/workspace/MYPROJ-2.8.3 at hudson.remoting.Channel@3d08761:mybuildslave
      at hudson.FilePath.act(FilePath.java:861)
      at hudson.FilePath.act(FilePath.java:838)
      at hudson.FilePath.deleteRecursive(FilePath.java:997)
      at hudson.plugins.mercurial.MercurialSCM.clone(MercurialSCM.java:547)
      at hudson.plugins.mercurial.MercurialSCM.checkout(MercurialSCM.java:389)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1353)
      at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:689)
      at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:594)
      at hudson.model.Run.execute(Run.java:1567)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:237)
      Caused by: java.io.IOException: Unable to delete /jenkins-slave/workspace/MYPROJ-2.8.3/war/WebContent/portais/suprimentos/servicos/catalogacao/img - files in dir: [/jenkins-slave/workspace/MYPROJ-2.8.3/war/WebContent/portais/suprimentos/servicos/catalogacao/img/Grafico_Cataloga??o_r1_c3.gif, /jenkins-slave/workspace/MYPROJ-2.8.3/war/WebContent/portais/suprimentos/servicos/catalogacao/img/Grafico_Cataloga??o_r1_c1_f2.gif,]
      at hudson.Util.deleteFile(Util.java:242)
      at hudson.Util.deleteRecursive(Util.java:293)
      at hudson.Util.deleteContentsRecursive(Util.java:204)
      at hudson.Util.deleteRecursive(Util.java:284)
      at hudson.Util.deleteContentsRecursive(Util.java:204)
      at hudson.Util.deleteRecursive(Util.java:284)
      at hudson.Util.deleteContentsRecursive(Util.java:204)
      at hudson.Util.deleteRecursive(Util.java:284)
      at hudson.Util.deleteContentsRecursive(Util.java:204)
      at hudson.Util.deleteRecursive(Util.java:284)
      at hudson.Util.deleteContentsRecursive(Util.java:204)
      at hudson.Util.deleteRecursive(Util.java:284)
      at hudson.Util.deleteContentsRecursive(Util.java:204)
      at hudson.Util.deleteRecursive(Util.java:284)
      at hudson.Util.deleteContentsRecursive(Util.java:204)
      at hudson.Util.deleteRecursive(Util.java:284)
      at hudson.FilePath$11.invoke(FilePath.java:1000)
      at hudson.FilePath$11.invoke(FilePath.java:997)
      at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2348)
      at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      at hudson.remoting.Request$2.run(Request.java:326)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:73)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)
      ERROR: Failed to clean the repository checkout
      Archiving artifacts
      Build step 'Dependency analysis' marked build as failure

          [JENKINS-17385] Unable to delete files with special characters when starting a build even if "Clean Build" is not checked

          Jesse Glick added a comment -

          Looks to be a bug in core, not the Mercurial plugin.

          Jesse Glick added a comment - Looks to be a bug in core, not the Mercurial plugin.

          Elifarley added a comment -

          Please look at this part of the stack trace:

          at hudson.FilePath.deleteRecursive(FilePath.java:997)
          at hudson.plugins.mercurial.MercurialSCM.clone(MercurialSCM.java:547)

          Should MercurialSCM.java:547 really call "FilePath.deleteRecursive"? Maybe the best approach would be to simply let mercurial do the cleaning as in the 2 lines below:

          hg up -C .
          hg --config extensions.purge= clean --all

          But there's another problem: since "Clean Build" is NOT checked, I guess there should be no need to perform the "clean --all" step; only "hg up -C ." should be enough, right?

          Elifarley added a comment - Please look at this part of the stack trace: at hudson.FilePath.deleteRecursive(FilePath.java:997) at hudson.plugins.mercurial.MercurialSCM.clone(MercurialSCM.java:547) Should MercurialSCM.java:547 really call "FilePath.deleteRecursive"? Maybe the best approach would be to simply let mercurial do the cleaning as in the 2 lines below: hg up -C . hg --config extensions.purge= clean --all But there's another problem: since "Clean Build" is NOT checked, I guess there should be no need to perform the "clean --all" step; only "hg up -C ." should be enough, right?

          Jesse Glick added a comment -

          The Purge extension is used when the Clean Build option is checked. That is not what is happening here. Rather, the plugin has decided it needs to do a fresh clone rather than an update. (Perhaps because .hg/hgrc is missing, or you turned the “sharing” feature on or off, or the remote URL changed.) As a first step in cloning, any existing files in the workspace (regardless of VCS status) are deleted. And that is failing in Jenkins core.

          Jesse Glick added a comment - The Purge extension is used when the Clean Build option is checked. That is not what is happening here. Rather, the plugin has decided it needs to do a fresh clone rather than an update. (Perhaps because .hg/hgrc is missing, or you turned the “sharing” feature on or off, or the remote URL changed.) As a first step in cloning, any existing files in the workspace (regardless of VCS status) are deleted. And that is failing in Jenkins core.

          Elifarley added a comment -

          Doesn't look like it's a duplicate of JENKINS-12610, since the other one doesn't say anything about having "Clean Build" unchecked.

          Elifarley added a comment - Doesn't look like it's a duplicate of JENKINS-12610 , since the other one doesn't say anything about having "Clean Build" unchecked.

          Jesse Glick added a comment -

          Please read my last comment.

          Jesse Glick added a comment - Please read my last comment.

          Elifarley added a comment -

          Thanks for the explanation.
          (Probably, I started writing my comment before you posted yours)

          Elifarley added a comment - Thanks for the explanation. (Probably, I started writing my comment before you posted yours)

            jglick Jesse Glick
            elifarley Elifarley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: