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

CLONE -java.io.IOException: Unable to delete <FOLDER_NAME> - files in dir: [<WEB_REFERENCE_FILE>]

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Critical
    • Resolution: Duplicate
    • core
    • None
    • Platform: All, OS: All

    Description

      I receive the following error when building about 90% of my builds. The other
      10% it works fine. I make no changes between the times it succeeds and the
      times it fails. I'm building in IE6 accessing the Hudson admin section. The
      delete is occurring because it is wiping out the workspace each time; but
      obviously failing.

      Started by user anonymous
      [workspace] $ e:\tfs\tf.exe workspaces -format:brief -
      server:http://<server>:8080 ********
      No workspace matching *;<USER_ID> on computer <COMPUTER_NAME> found in Team
      Foundation Server http://<server>:8080.
      FATAL: Unable to delete <FOLDER_NAME_IN_PROJECT> - files in dir:
      <WEB_REFERENCE_FILE_IN_PROJECT>
      java.io.IOException: Unable to delete <FOLDER_NAME> - files in dir:
      [<WEB_REFERENCE_FILE>]
      at hudson.Util.deleteFile(Util.java:218)
      at hudson.Util.deleteRecursive(Util.java:251)
      at hudson.Util.deleteContentsRecursive(Util.java:185)
      at hudson.Util.deleteRecursive(Util.java:250)
      at hudson.Util.deleteContentsRecursive(Util.java:185)
      at hudson.Util.deleteRecursive(Util.java:250)
      at hudson.Util.deleteContentsRecursive(Util.java:185)
      at hudson.FilePath$11.invoke(FilePath.java:719)
      at hudson.FilePath$11.invoke(FilePath.java:717)
      at hudson.FilePath.act(FilePath.java:635)
      at hudson.FilePath.deleteContents(FilePath.java:717)
      at hudson.plugins.tfs.actions.CheckoutAction.checkout
      (CheckoutAction.java:40)
      at hudson.plugins.tfs.TeamFoundationServerScm.checkout
      (TeamFoundationServerScm.java:143)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:830)
      at hudson.model.AbstractBuild$AbstractRunner.checkout
      (AbstractBuild.java:314)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:266)
      at hudson.model.Run.run(Run.java:927)
      at hudson.model.Build.run(Build.java:112)
      at hudson.model.ResourceController.execute(ResourceController.java:93)
      at hudson.model.Executor.run(Executor.java:119)

      Attachments

        Issue Links

          Activity

            njsf njsf created issue -
            njsf njsf added a comment -

            Hudson 1.374 under Tomcat in a Redhat 5 EL box.

            I believe this must be an issue with usage of UTF-8 encoded files, in my case the failure is with a files created by a test case that creates directories and files with UTF-8 encoded characters. Once I manually removed this directory (and some other files with UTF-8 characters) all was well:

            Started by user anonymous
            Clearing workspace...

            java.io.IOException: Unable to delete <OMITTED/linux_rhAS50-x86-64/debug/dmthudson_11726> - files in dir: [<OMMITED/linux_rhAS50-x86-64/debug/dmthudson_11726/save_f%EF%BF%BD%EF%BF%BD_dir]>
            at hudson.Util.deleteFile(Util.java:259)
            at hudson.Util.deleteRecursive(Util.java:302)
            at hudson.Util.deleteContentsRecursive(Util.java:221)
            at hudson.Util.deleteRecursive(Util.java:301)
            at hudson.Util.deleteContentsRecursive(Util.java:221)
            at hudson.Util.deleteRecursive(Util.java:301)
            at hudson.Util.deleteContentsRecursive(Util.java:221)
            at hudson.Util.deleteRecursive(Util.java:301)
            at hudson.Util.deleteContentsRecursive(Util.java:221)
            at hudson.Util.deleteRecursive(Util.java:301)
            at hudson.Util.deleteContentsRecursive(Util.java:221)
            at hudson.FilePath$10.invoke(FilePath.java:833)
            at hudson.FilePath$10.invoke(FilePath.java:831)
            at hudson.FilePath.act(FilePath.java:753)
            at hudson.FilePath.act(FilePath.java:735)
            at hudson.FilePath.deleteContents(FilePath.java:831)
            at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:476)
            at hudson.model.AbstractProject.checkout(AbstractProject.java:1061)
            at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479)
            at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411)
            at hudson.model.Run.run(Run.java:1272)
            at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
            at hudson.model.ResourceController.execute(ResourceController.java:88)
            at hudson.model.Executor.run(Executor.java:129)
            Retrying after 10 seconds

            In a previous failure it was complaining about the following:
            Started by an SCM change
            Clearing workspace...
            java.io.IOException: Unable to delete <OMITTED/linux_rhAS50-x86-64/debug/dmthudson_11726/logs> - files in dir: [<OMITTED/linux_rhAS50-x86-64/debug/dmthudson_11726/logs/EXTSTRING_TEST_f%EF%BF%BD%EF%BF%BD_11726_91_dmthudson_en_US_UTF-8.log]>
            at hudson.Util.deleteFile(Util.java:259)
            at hudson.Util.deleteRecursive(Util.java:302)
            at hudson.Util.deleteContentsRecursive(Util.java:221)
            at hudson.Util.deleteRecursive(Util.java:301)
            at hudson.Util.deleteContentsRecursive(Util.java:221)
            at hudson.Util.deleteRecursive(Util.java:301)
            at hudson.Util.deleteContentsRecursive(Util.java:221)
            at hudson.Util.deleteRecursive(Util.java:301)
            at hudson.Util.deleteContentsRecursive(Util.java:221)
            at hudson.Util.deleteRecursive(Util.java:301)
            at hudson.Util.deleteContentsRecursive(Util.java:221)
            at hudson.Util.deleteRecursive(Util.java:301)
            at hudson.Util.deleteContentsRecursive(Util.java:221)
            at hudson.FilePath$10.invoke(FilePath.java:833)
            at hudson.FilePath$10.invoke(FilePath.java:831)
            at hudson.FilePath.act(FilePath.java:753)
            at hudson.FilePath.act(FilePath.java:735)
            at hudson.FilePath.deleteContents(FilePath.java:831)
            at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:476)
            at hudson.model.AbstractProject.checkout(AbstractProject.java:1061)
            at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479)
            at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411)
            at hudson.model.Run.run(Run.java:1272)
            at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
            at hudson.model.ResourceController.execute(ResourceController.java:88)
            at hudson.model.Executor.run(Executor.java:129)
            Retrying after 10 seconds

            njsf njsf added a comment - Hudson 1.374 under Tomcat in a Redhat 5 EL box. I believe this must be an issue with usage of UTF-8 encoded files, in my case the failure is with a files created by a test case that creates directories and files with UTF-8 encoded characters. Once I manually removed this directory (and some other files with UTF-8 characters) all was well: Started by user anonymous Clearing workspace... java.io.IOException: Unable to delete <OMITTED/linux_rhAS50-x86-64/debug/dmthudson_11726> - files in dir: [<OMMITED/linux_rhAS50-x86-64/debug/dmthudson_11726/save_f%EF%BF%BD%EF%BF%BD_dir] > at hudson.Util.deleteFile(Util.java:259) at hudson.Util.deleteRecursive(Util.java:302) at hudson.Util.deleteContentsRecursive(Util.java:221) at hudson.Util.deleteRecursive(Util.java:301) at hudson.Util.deleteContentsRecursive(Util.java:221) at hudson.Util.deleteRecursive(Util.java:301) at hudson.Util.deleteContentsRecursive(Util.java:221) at hudson.Util.deleteRecursive(Util.java:301) at hudson.Util.deleteContentsRecursive(Util.java:221) at hudson.Util.deleteRecursive(Util.java:301) at hudson.Util.deleteContentsRecursive(Util.java:221) at hudson.FilePath$10.invoke(FilePath.java:833) at hudson.FilePath$10.invoke(FilePath.java:831) at hudson.FilePath.act(FilePath.java:753) at hudson.FilePath.act(FilePath.java:735) at hudson.FilePath.deleteContents(FilePath.java:831) at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:476) at hudson.model.AbstractProject.checkout(AbstractProject.java:1061) at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411) at hudson.model.Run.run(Run.java:1272) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:129) Retrying after 10 seconds In a previous failure it was complaining about the following: Started by an SCM change Clearing workspace... java.io.IOException: Unable to delete <OMITTED/linux_rhAS50-x86-64/debug/dmthudson_11726/logs> - files in dir: [<OMITTED/linux_rhAS50-x86-64/debug/dmthudson_11726/logs/EXTSTRING_TEST_f%EF%BF%BD%EF%BF%BD_11726_91_dmthudson_en_US_UTF-8.log] > at hudson.Util.deleteFile(Util.java:259) at hudson.Util.deleteRecursive(Util.java:302) at hudson.Util.deleteContentsRecursive(Util.java:221) at hudson.Util.deleteRecursive(Util.java:301) at hudson.Util.deleteContentsRecursive(Util.java:221) at hudson.Util.deleteRecursive(Util.java:301) at hudson.Util.deleteContentsRecursive(Util.java:221) at hudson.Util.deleteRecursive(Util.java:301) at hudson.Util.deleteContentsRecursive(Util.java:221) at hudson.Util.deleteRecursive(Util.java:301) at hudson.Util.deleteContentsRecursive(Util.java:221) at hudson.Util.deleteRecursive(Util.java:301) at hudson.Util.deleteContentsRecursive(Util.java:221) at hudson.FilePath$10.invoke(FilePath.java:833) at hudson.FilePath$10.invoke(FilePath.java:831) at hudson.FilePath.act(FilePath.java:753) at hudson.FilePath.act(FilePath.java:735) at hudson.FilePath.deleteContents(FilePath.java:831) at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:476) at hudson.model.AbstractProject.checkout(AbstractProject.java:1061) at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411) at hudson.model.Run.run(Run.java:1272) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:129) Retrying after 10 seconds
            njsf njsf added a comment -

            I actually misspoke.

            While Hudson thinks the file/dir has the sequence f%EF%BF%BD%EF%BF%BD it should really have the sequence f%F6%F6.

            This is because this filename is actually intended to be encoded in ISO-8859-1 not UTF-8 and somehow when Hudson tried to remove it it ended up with %EF%BF%BD%EF%BF%BD

            I can't really change that filename because that is the purpose of the unit test, to verify that we deal properly (inside the test case the encoding is properly set to ISO-8859-1 etc...)

            Any recommendations on how to make Hudson properly delete the file ?

            BTW, this removal was triggered by the option on the P4 plugin to clean the workspace.

            njsf njsf added a comment - I actually misspoke. While Hudson thinks the file/dir has the sequence f%EF%BF%BD%EF%BF%BD it should really have the sequence f%F6%F6. This is because this filename is actually intended to be encoded in ISO-8859-1 not UTF-8 and somehow when Hudson tried to remove it it ended up with %EF%BF%BD%EF%BF%BD I can't really change that filename because that is the purpose of the unit test, to verify that we deal properly (inside the test case the encoding is properly set to ISO-8859-1 etc...) Any recommendations on how to make Hudson properly delete the file ? BTW, this removal was triggered by the option on the P4 plugin to clean the workspace.
            redsolo redsolo added a comment -

            From your comments, it seems that you think this is a hudson core problem and not a problem in the TFS plugin? The description contains a dos prompt and your other comment seems to mention linux, is it the same problem?

            redsolo redsolo added a comment - From your comments, it seems that you think this is a hudson core problem and not a problem in the TFS plugin? The description contains a dos prompt and your other comment seems to mention linux, is it the same problem?
            njsf njsf added a comment -

            After looking at the code, I now actually think this is a problem with java.io.File
            I noticed how you do dir.getFiles() and then call delete on the elements of the File[] returned.
            I think there is some transcoding of filenames happening there, which IMO should not happen.

            njsf njsf added a comment - After looking at the code, I now actually think this is a problem with java.io.File I noticed how you do dir.getFiles() and then call delete on the elements of the File[] returned. I think there is some transcoding of filenames happening there, which IMO should not happen.
            gjeudy gjeudy added a comment -

            I'm getting a very similar stacktrace with hudson 1.379 running on tomcat 6.0.29 with java 5. I also have not made any changes to the job config. The error was triggered by the CloneSCM plugin:

            java.io.IOException: Unable to delete /home/scripts/hudson/jobs/Stella-UI_start_selenium_tests/workspace/trunk/UI/src/main/webapp/Stella/Html/Pricing/MassPriceEventAsyncOverrides.jsp
            at hudson.Util.deleteFile(Util.java:260)
            at hudson.Util.deleteRecursive(Util.java:302)
            at hudson.Util.deleteContentsRecursive(Util.java:221)
            at hudson.Util.deleteRecursive(Util.java:301)
            at hudson.Util.deleteContentsRecursive(Util.java:221)
            at hudson.Util.deleteRecursive(Util.java:301)
            at hudson.Util.deleteContentsRecursive(Util.java:221)
            at hudson.Util.deleteRecursive(Util.java:301)
            at hudson.Util.deleteContentsRecursive(Util.java:221)
            at hudson.Util.deleteRecursive(Util.java:301)
            at hudson.Util.deleteContentsRecursive(Util.java:221)
            at hudson.Util.deleteRecursive(Util.java:301)
            at hudson.Util.deleteContentsRecursive(Util.java:221)
            at hudson.Util.deleteRecursive(Util.java:301)
            at hudson.Util.deleteContentsRecursive(Util.java:221)
            at hudson.Util.deleteRecursive(Util.java:301)
            at hudson.Util.deleteContentsRecursive(Util.java:221)
            at hudson.Util.deleteRecursive(Util.java:301)
            at hudson.Util.deleteContentsRecursive(Util.java:221)
            at hudson.FilePath$10.invoke(FilePath.java:833)
            at hudson.FilePath$10.invoke(FilePath.java:831)
            at hudson.FilePath.act(FilePath.java:753)
            at hudson.FilePath.act(FilePath.java:735)
            at hudson.FilePath.deleteContents(FilePath.java:831)
            at hudson.plugins.cloneworkspace.CloneWorkspaceSCM.checkout(CloneWorkspaceSCM.java:125)
            at hudson.model.AbstractProject.checkout(AbstractProject.java:1082)
            at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479)
            at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411)
            at hudson.model.Run.run(Run.java:1280)
            at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:293)
            at hudson.model.ResourceController.execute(ResourceController.java:88)
            at hudson.model.Executor.run(Executor.java:137)

            I went to check the actual file through a terminal session and it has weird statuses:

            ls -l

            br-xrwS-w- 263 1230008912 1347223560 116, 115 Mar 10 1973 MassPriceEventAsyncOverrides.jsp

            file -i MassPriceEventAsyncOverrides.jsp
            MassPriceEventAsyncOverrides.jsp: application/x-not-regular-file

            gjeudy gjeudy added a comment - I'm getting a very similar stacktrace with hudson 1.379 running on tomcat 6.0.29 with java 5. I also have not made any changes to the job config. The error was triggered by the CloneSCM plugin: java.io.IOException: Unable to delete /home/scripts/hudson/jobs/Stella-UI_start_selenium_tests/workspace/trunk/UI/src/main/webapp/Stella/Html/Pricing/MassPriceEventAsyncOverrides.jsp at hudson.Util.deleteFile(Util.java:260) at hudson.Util.deleteRecursive(Util.java:302) at hudson.Util.deleteContentsRecursive(Util.java:221) at hudson.Util.deleteRecursive(Util.java:301) at hudson.Util.deleteContentsRecursive(Util.java:221) at hudson.Util.deleteRecursive(Util.java:301) at hudson.Util.deleteContentsRecursive(Util.java:221) at hudson.Util.deleteRecursive(Util.java:301) at hudson.Util.deleteContentsRecursive(Util.java:221) at hudson.Util.deleteRecursive(Util.java:301) at hudson.Util.deleteContentsRecursive(Util.java:221) at hudson.Util.deleteRecursive(Util.java:301) at hudson.Util.deleteContentsRecursive(Util.java:221) at hudson.Util.deleteRecursive(Util.java:301) at hudson.Util.deleteContentsRecursive(Util.java:221) at hudson.Util.deleteRecursive(Util.java:301) at hudson.Util.deleteContentsRecursive(Util.java:221) at hudson.Util.deleteRecursive(Util.java:301) at hudson.Util.deleteContentsRecursive(Util.java:221) at hudson.FilePath$10.invoke(FilePath.java:833) at hudson.FilePath$10.invoke(FilePath.java:831) at hudson.FilePath.act(FilePath.java:753) at hudson.FilePath.act(FilePath.java:735) at hudson.FilePath.deleteContents(FilePath.java:831) at hudson.plugins.cloneworkspace.CloneWorkspaceSCM.checkout(CloneWorkspaceSCM.java:125) at hudson.model.AbstractProject.checkout(AbstractProject.java:1082) at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411) at hudson.model.Run.run(Run.java:1280) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:293) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:137) I went to check the actual file through a terminal session and it has weird statuses: ls -l br-xrwS-w- 263 1230008912 1347223560 116, 115 Mar 10 1973 MassPriceEventAsyncOverrides.jsp file -i MassPriceEventAsyncOverrides.jsp MassPriceEventAsyncOverrides.jsp: application/x-not-regular-file
            redsolo redsolo added a comment -

            Changing the component to core as it seems that the issue comes from file name encoding and not the tfs plugin. Or could it be a master-slave issue?

            redsolo redsolo added a comment - Changing the component to core as it seems that the issue comes from file name encoding and not the tfs plugin. Or could it be a master-slave issue?
            redsolo redsolo made changes -
            Field Original Value New Value
            Component/s core [ 15593 ]
            Component/s tfs [ 15521 ]
            Assignee redsolo [ redsolo ]
            njsf njsf added a comment -

            In my case there is no slave involved, it happens on the sole Hudson instance, which is in a local ext3 file system, so no NFS or other network mount is at play.

            njsf njsf added a comment - In my case there is no slave involved, it happens on the sole Hudson instance, which is in a local ext3 file system, so no NFS or other network mount is at play.
            ohtake_tomohiro OHTAKE Tomohiro made changes -
            Link This issue is related to JENKINS-3813 [ JENKINS-3813 ]

            I can see a bit different stack trace on Jenkins ver. 1.505

            Mar 17, 2013 2:06:39 PM hudson.model.Run execute
            SEVERE: Failed to save build record
            java.io.IOException: Unable to delete /home/ci/mst/jobs/Infrastructure_free_space_monitoring/configurations/axis-label/ingot/builds/2013-03-17_14-06-01/build.xml
                    at hudson.util.AtomicFileWriter.commit(AtomicFileWriter.java:112)
                    at hudson.XmlFile.write(XmlFile.java:184)
                    at hudson.model.Run.save(Run.java:1702)
                    at hudson.model.Run.execute(Run.java:1623)
                    at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
                    at hudson.model.ResourceController.execute(ResourceController.java:88)
                    at hudson.model.Executor.run(Executor.java:237)
            
            nickolay_martinov Nikolay Martynov added a comment - I can see a bit different stack trace on Jenkins ver. 1.505 Mar 17, 2013 2:06:39 PM hudson.model.Run execute SEVERE: Failed to save build record java.io.IOException: Unable to delete /home/ci/mst/jobs/Infrastructure_free_space_monitoring/configurations/axis-label/ingot/builds/2013-03-17_14-06-01/build.xml at hudson.util.AtomicFileWriter.commit(AtomicFileWriter.java:112) at hudson.XmlFile.write(XmlFile.java:184) at hudson.model.Run.save(Run.java:1702) at hudson.model.Run.execute(Run.java:1623) at hudson.matrix.MatrixRun.run(MatrixRun.java:146) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237)
            danielbeck Daniel Beck added a comment -

            Too little information in the original report and some of the comments to investigate further.

            One of the comments seems to essentially duplicate JENKINS-12610.

            Due to the age and nature of this issue, I'm resolving this as duplicate. If this is still an issue for you on current Jenkins versions (1.554.x or 1.56x), please file a new issue and provide as much information as you can. If you're on Windows or otherwise locking file systems, disable search indexer, antivirus, and similar processes.

            danielbeck Daniel Beck added a comment - Too little information in the original report and some of the comments to investigate further. One of the comments seems to essentially duplicate JENKINS-12610 . Due to the age and nature of this issue, I'm resolving this as duplicate. If this is still an issue for you on current Jenkins versions (1.554.x or 1.56x), please file a new issue and provide as much information as you can. If you're on Windows or otherwise locking file systems, disable search indexer, antivirus, and similar processes.
            danielbeck Daniel Beck made changes -
            Resolution Duplicate [ 3 ]
            Status Open [ 1 ] Resolved [ 5 ]
            danielbeck Daniel Beck made changes -
            Link This issue duplicates JENKINS-12610 [ JENKINS-12610 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 137587 ] JNJira + In-Review [ 187577 ]

            People

              Unassigned Unassigned
              njsf njsf
              Votes:
              4 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: