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

    Details

    • Similar Issues:

      Description

      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

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

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

            Show
            jglick Jesse Glick added a comment - Looks to be a bug in core, not the Mercurial plugin.
            Hide
            elifarley 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?

            Show
            elifarley 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?
            Hide
            jglick 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.

            Show
            jglick 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.
            Hide
            elifarley 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.

            Show
            elifarley 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.
            Hide
            jglick Jesse Glick added a comment -

            Please read my last comment.

            Show
            jglick Jesse Glick added a comment - Please read my last comment.
            Hide
            elifarley Elifarley added a comment -

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

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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: