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

File cleaning failure, old build and plugin update

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • core

      Version 2.157 on Ubuntu with Java Wrapper to start the isntance.

      I am running into an issue where old builds are not getting cleaned up automatically or manually.

      I notice that the folder is renamed with a dot. For example, build #4 the folder is renamed from 4 to .4

      And the cleaning failed.

      Deletion of the build failedRetry deleteShow reasonjenkins.util.io.CompositeIOException: Unable to delete '/var/opt/jenkins/runner/1.0/bin/linux-x86-64/../../data/jobs/tutorial_lombok/builds/.4'. Tried 3 times (of a maximum of 3) waiting 0,1 s between attempts.
      	at jenkins.util.io.PathRemover.forceRemoveRecursive(PathRemover.java:93)
      	at hudson.Util.deleteRecursive(Util.java:267)
      	at hudson.model.Run.delete(Run.java:1581)
      	at hudson.maven.MavenModuleSetBuild.delete(MavenModuleSetBuild.java:450)
      	at hudson.model.Run.doDoDelete(Run.java:2298)
      	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
      	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)
      	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408)
      	at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:77)
      	at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26)
      	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212)
      	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145)
      	at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:537)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
      	at org.kohsuke.stapler.MetaClass$9.dispatch(MetaClass.java:458)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
      	at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:282)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:668)
      	at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
      

       

      Moreover, when I upgraded some plugin, Jenkins failed to restart saying that the deploy plugin folder could not be deleted.

      After manually deleting the file .timestamp in the folder, it was OK.

       

       

      Seems there is an issue with file having name starting with a dot.

       

      Regards

       

      Etienne

          [JENKINS-55448] File cleaning failure, old build and plugin update

          Matt Sicker added a comment -

          Thanks rkoncier, I'll give that a try.

          Matt Sicker added a comment - Thanks rkoncier , I'll give that a try.

          Matt Sicker added a comment - - edited

          What I tried:

          1. Create a freestyle project using the git repo https://github.com/jvz/example-java-docker.git
          2. Under Build Environment, I checked "Delete workspace before build starts" and Advanced
          3. Under Advanced, I added an include pattern for build/classes/** and also apply to directories.
          4. Under Build, add an "invoke gradle script" step to build the project.
          5. Save, build now.
          6. No errors.

          Matt Sicker added a comment - - edited What I tried: Create a freestyle project using the git repo https://github.com/jvz/example-java-docker.git Under Build Environment, I checked "Delete workspace before build starts" and Advanced Under Advanced, I added an include pattern for build/classes/** and also apply to directories. Under Build, add an "invoke gradle script" step to build the project. Save, build now. No errors.

          Sorry jvz I forgot mention I linked Jenkins workspace from different folder:

          Robert Koncier added a comment - Sorry jvz I forgot mention I linked Jenkins workspace from different folder:

          Matt Sicker added a comment -

          Alright, I've discovered one regression so far where a path like /var/foo/bar/../baz will not delete due to order of delete operations being reversed here since the parent is attempted to be deleted first. I have an idea on how this might be fixed now.

          Matt Sicker added a comment - Alright, I've discovered one regression so far where a path like /var/foo/bar/../baz will not delete due to order of delete operations being reversed here since the parent is attempted to be deleted first. I have an idea on how this might be fixed now.

          Matt Sicker added a comment -

          Think I've discovered the root cause here. The File API automatically normalized some file names, while Path does not by default. I've pushed those changes to the PR.

          Matt Sicker added a comment - Think I've discovered the root cause here. The File API automatically normalized some file names, while Path does not by default. I've pushed those changes to the PR.

          Matt Sicker added a comment -

          I've discovered a regression in Util.isSymlink that relates to the can't delete files in a symbolically linked Jenkins home (or other symlink issues). Including in this fix.

          Matt Sicker added a comment - I've discovered a regression in Util.isSymlink that relates to the can't delete files in a symbolically linked Jenkins home (or other symlink issues). Including in this fix.

          The code that introduced this regression has been reverted and merged in Jenkins core master branch (https://github.com/jenkinsci/jenkins/pull/3845).
          An out-of-order release is being pushed out. Expect 2.159 in a few hours.

          https://github.com/jenkinsci/jenkins/pull/3841 then will be worked on again to reach a satisfying end state fixing the original issue at stake.

          Baptiste Mathus added a comment - The code that introduced this regression has been reverted and merged in Jenkins core master branch ( https://github.com/jenkinsci/jenkins/pull/3845 ). An out-of-order release is being pushed out. Expect 2.159 in a few hours. https://github.com/jenkinsci/jenkins/pull/3841 then will be worked on again to reach a satisfying end state fixing the original issue at stake.

          rupkumar p added a comment -

          thanks and working fine now.

          rupkumar p added a comment - thanks and working fine now.

          Thanks.

           

          It works for me also.

          Just to not say everything is perfect

          With the temporary regresssion, previous build were not cleanup. And I still have them in the job folder. For example :

           

          drwxr-xr-x 2 jenkins jenkins 4096 janv. 7 14:12 .1/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 01:41 .10/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 01:45 .11/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 16:24 .12/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 17:21 .13/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 17:42 .14/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 17:54 .15/
          lrwxrwxrwx 1 jenkins jenkins 2 janv. 14 13:15 15 -> 15
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 19:04 .16/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 20:44 .17/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 23:39 .18/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 9 10:55 .19/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 7 14:21 .2/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 9 11:34 .20/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 9 13:04 .21/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 10 19:05 .22/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 10 22:19 .23/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 10 22:34 .24/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 11 12:40 .25/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 11 13:20 .26/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 11 13:35 .27/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 14 13:15 .28/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 14 16:43 .29/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 7 20:55 .3/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 14 21:24 .30/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 15 12:55 35/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 15 13:05 36/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 15 13:45 37/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 15 22:35 38/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 16 13:20 39/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 7 21:23 .4/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 7 23:39 .5/
          lrwxrwxrwx 1 jenkins jenkins 1 janv. 8 01:45 5 -> 5
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 7 23:55 .6/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 00:34 .7/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 01:13 .8/
          drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 01:32 .9/
          lrwxrwxrwx 1 jenkins jenkins 2 janv. 7 23:55 lastFailedBuild -> -1
          lrwxrwxrwx 1 jenkins jenkins 2 janv. 16 13:20 lastStableBuild -> 39/
          lrwxrwxrwx 1 jenkins jenkins 2 janv. 16 13:20 lastSuccessfulBuild -> 39/
          lrwxrwxrwx 1 jenkins jenkins 2 janv. 15 22:35 lastUnstableBuild -> -1
          lrwxrwxrwx 1 jenkins jenkins 2 janv. 15 22:35 lastUnsuccessfulBuild -> -1
          -rw-r--r-- 1 jenkins jenkins 0 janv. 7 14:12 legacyIds 
          

           

          And also in all modules folders.

           

          But not really a big deal. This is not a big things to do manually

          Etienne Jouvin added a comment - Thanks.   It works for me also. Just to not say everything is perfect With the temporary regresssion, previous build were not cleanup. And I still have them in the job folder. For example :   drwxr-xr-x 2 jenkins jenkins 4096 janv. 7 14:12 .1/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 01:41 .10/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 01:45 .11/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 16:24 .12/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 17:21 .13/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 17:42 .14/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 17:54 .15/ lrwxrwxrwx 1 jenkins jenkins 2 janv. 14 13:15 15 -> 15 drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 19:04 .16/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 20:44 .17/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 23:39 .18/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 9 10:55 .19/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 7 14:21 .2/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 9 11:34 .20/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 9 13:04 .21/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 10 19:05 .22/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 10 22:19 .23/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 10 22:34 .24/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 11 12:40 .25/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 11 13:20 .26/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 11 13:35 .27/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 14 13:15 .28/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 14 16:43 .29/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 7 20:55 .3/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 14 21:24 .30/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 15 12:55 35/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 15 13:05 36/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 15 13:45 37/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 15 22:35 38/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 16 13:20 39/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 7 21:23 .4/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 7 23:39 .5/ lrwxrwxrwx 1 jenkins jenkins 1 janv. 8 01:45 5 -> 5 drwxr-xr-x 2 jenkins jenkins 4096 janv. 7 23:55 .6/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 00:34 .7/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 01:13 .8/ drwxr-xr-x 2 jenkins jenkins 4096 janv. 8 01:32 .9/ lrwxrwxrwx 1 jenkins jenkins 2 janv. 7 23:55 lastFailedBuild -> -1 lrwxrwxrwx 1 jenkins jenkins 2 janv. 16 13:20 lastStableBuild -> 39/ lrwxrwxrwx 1 jenkins jenkins 2 janv. 16 13:20 lastSuccessfulBuild -> 39/ lrwxrwxrwx 1 jenkins jenkins 2 janv. 15 22:35 lastUnstableBuild -> -1 lrwxrwxrwx 1 jenkins jenkins 2 janv. 15 22:35 lastUnsuccessfulBuild -> -1 -rw-r--r-- 1 jenkins jenkins 0 janv. 7 14:12 legacyIds    And also in all modules folders.   But not really a big deal. This is not a big things to do manually

          Daniel Beck added a comment -

          Fixed in 2.159.

          Daniel Beck added a comment - Fixed in 2.159.

            jvz Matt Sicker
            ejouvin Etienne Jouvin
            Votes:
            17 Vote for this issue
            Watchers:
            21 Start watching this issue

              Created:
              Updated:
              Resolved: