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

.hg/hgrc file not closed, resulting in undeletable directory

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • mercurial-plugin
    • None
    • Platform: PC, OS: Windows XP

      the following error:

      ERROR: Failed to clean the workspace
      java.io.IOException: Unable to delete C:\home\duns\riscure\hg\riscure-hudson\jobs\riscure-
      inspector-drivers-3.0.x\workspace\.hg\hgrc
      at hudson.Util.deleteFile(Util.java:195)
      at hudson.Util.deleteRecursive(Util.java:226)
      at hudson.Util.deleteContentsRecursive(Util.java:161)
      at hudson.Util.deleteRecursive(Util.java:225)
      at hudson.Util.deleteContentsRecursive(Util.java:161)
      at hudson.Util.deleteRecursive(Util.java:225)
      at hudson.FilePath$6.invoke(FilePath.java:460)
      at hudson.FilePath$6.invoke(FilePath.java:458)
      at hudson.FilePath.act(FilePath.java:388)
      at hudson.FilePath.deleteRecursive(FilePath.java:458)
      at hudson.plugins.mercurial.MercurialSCM.clone(MercurialSCM.java:317)
      at hudson.plugins.mercurial.MercurialSCM.checkout(MercurialSCM.java:211)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:664)
      at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:260)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:234)
      at hudson.model.Run.run(Run.java:793)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:205)
      at hudson.model.ResourceController.execute(ResourceController.java:70)
      at hudson.model.Executor.run(Executor.java:88)
      finished: FAILURE

      happens because the .hg/hgrc file is not closed, while Hudson is checking if the workspace
      can be updated or needs a clone. It happens on "branches" since these (probably) need to be
      re-checked out.

      Add a r.close() statement to the HrRc.java file, ctor: HgRc(Reader input, File hgrc)
      and things start to work.

            kohsuke Kohsuke Kawaguchi
            wiredduns wiredduns
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: