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

Moving a Folder into another folder breaks jobs build results folder on disk

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Ubuntu server 16.4 LTS
      Jenkins LTS 2.222.4
      Folder plugin 6.14

      Hello

      while moving a folder "space-projetA", containing several FreeStyle jobs, into a parent folder "entity-projects", i faced a weird issue with build results folder copy on local file system.

      It seems like when copying, Jenkins is dereferencing symlinks (lastStableBuild, ...) and replacing by symlink target content.

      It also fails when symlink does not point to anything (ex: lastFailedBuild -> -1)

      We are using the system property https://www.jenkins.io/doc/book/managing/system-properties/#jenkins-model-jenkins-buildsdir to store build results on a dedicated drive:

      -Djenkins.model.Jenkins.buildsDir=/sd/jenkins_builds/jenkins/${ITEM_FULL_NAME}/builds
      

       Error on jenkins logs is the following:

      Jul 07, 2020 12:25:57 PM INFO com.cloudbees.hudson.plugins.folder.AbstractFolder$3 call
      Loading job entity-projects/space-projetA/job1 (112.8%)
      Jul 07, 2020 12:25:58 PM SEVERE hudson.model.Job$SubItemBuildsLocationImpl onLocationChanged
      Failed to move /sd/jenkins_builds/jenkins/space-projetA/job1/builds to /sd/jenkins_builds/jenkins/entity-projects/space-projetA/job1/builds
      java.io.FileNotFoundException: /sd/jenkins_builds/jenkins/space-projetA/job1/builds/lastFailedBuild (No such file or directory)
      

      Content of space-projetA/job1/builds:

      me@me:/sd/jenkins_builds/jenkins/space-projetA/job1/builds$ ls -Ral
      .:
      total 32
      drwxrwxr-x 7 jenkins jenkins 4096 Jul  1 09:56 .
      drwxrwxr-x 3 jenkins jenkins 4096 Feb 18  2019 ..
      drwxrwxr-x 2 jenkins jenkins 4096 Feb 18  2019 5
      drwxrwxr-x 2 jenkins jenkins 4096 Mar  6  2019 6
      drwxrwxr-x 2 jenkins jenkins 4096 Mar  6  2019 7
      drwxrwxr-x 2 jenkins jenkins 4096 Oct 30  2019 8
      drwxrwxr-x 2 jenkins jenkins 4096 Oct 30  2019 9
      lrwxrwxrwx 1 jenkins jenkins    2 Apr 14  2019 lastFailedBuild -> -1
      lrwxrwxrwx 1 jenkins jenkins    1 Oct 30  2019 lastStableBuild -> 9
      lrwxrwxrwx 1 jenkins jenkins    1 Oct 30  2019 lastSuccessfulBuild -> 9
      lrwxrwxrwx 1 jenkins jenkins    2 Feb 18  2019 lastUnstableBuild -> -1
      lrwxrwxrwx 1 jenkins jenkins    1 Oct 30  2019 lastUnsuccessfulBuild -> 8
      -rw-rw-r-- 1 jenkins jenkins    0 Apr 14  2019 legacyIds
      -rw-rw-r-- 1 jenkins jenkins   80 Jul  1 09:56 permalinks
      
      ./5:
      total 92
      drwxrwxr-x 2 jenkins jenkins  4096 Feb 18  2019 .
      drwxrwxr-x 7 jenkins jenkins  4096 Jul  1 09:56 ..
      -rw-rw-r-- 1 jenkins jenkins  2867 Feb 18  2019 build.xml
      -rw-rw-r-- 1 jenkins jenkins     0 Feb 18  2019 changelog.xml
      -rw-rw-r-- 1 jenkins jenkins  2846 Feb 18  2019 injectedEnvVars.txt
      -rw-rw-r-- 1 jenkins jenkins 72836 Feb 18  2019 log
      
      ./6:
      total 20
      drwxrwxr-x 2 jenkins jenkins 4096 Mar  6  2019 .
      drwxrwxr-x 7 jenkins jenkins 4096 Jul  1 09:56 ..
      -rw-rw-r-- 1 jenkins jenkins 1814 Mar  6  2019 build.xml
      -rw-rw-r-- 1 jenkins jenkins 2899 Mar  6  2019 injectedEnvVars.txt
      -rw-rw-r-- 1 jenkins jenkins 2386 Mar  6  2019 log
      
      ./7:
      total 92
      drwxrwxr-x 2 jenkins jenkins  4096 Mar  6  2019 .
      drwxrwxr-x 7 jenkins jenkins  4096 Jul  1 09:56 ..
      -rw-rw-r-- 1 jenkins jenkins  3212 Mar  6  2019 build.xml
      -rw-rw-r-- 1 jenkins jenkins     0 Mar  6  2019 changelog.xml
      -rw-rw-r-- 1 jenkins jenkins  2899 Mar  6  2019 injectedEnvVars.txt
      -rw-rw-r-- 1 jenkins jenkins 72931 Mar  6  2019 log
      
      ./8:
      total 180
      drwxrwxr-x 2 jenkins jenkins   4096 Oct 30  2019 .
      drwxrwxr-x 7 jenkins jenkins   4096 Jul  1 09:56 ..
      -rw-rw-r-- 1 jenkins jenkins   3565 Oct 30  2019 build.xml
      -rw-rw-r-- 1 jenkins jenkins      0 Oct 30  2019 changelog.xml
      -rw-rw-r-- 1 jenkins jenkins   3953 Oct 30  2019 injectedEnvVars.txt
      -rw-rw-r-- 1 jenkins jenkins 162055 Oct 30  2019 log
      
      ./9:
      total 92
      drwxrwxr-x 2 jenkins jenkins  4096 Oct 30  2019 .
      drwxrwxr-x 7 jenkins jenkins  4096 Jul  1 09:56 ..
      -rw-rw-r-- 1 jenkins jenkins  2959 Oct 30  2019 build.xml
      -rw-rw-r-- 1 jenkins jenkins     0 Oct 30  2019 changelog.xml
      -rw-rw-r-- 1 jenkins jenkins  3953 Oct 30  2019 injectedEnvVars.txt
      -rw-rw-r-- 1 jenkins jenkins 73347 Oct 30  2019 log
      

      Content of space-projetA/job1/builds:

      me@me:/sd/jenkins_builds/jenkins/entity-projects/space-projetA/job1/builds$ ls -Ral
      .:
      total 20
      drwxrwxr-x 4 jenkins jenkins 4096 Jul  7 12:26 .
      drwxrwxr-x 3 jenkins jenkins 4096 Jul  7 12:25 ..
      drwxrwxr-x 2 jenkins jenkins 4096 Oct 30  2019 8
      drwxrwxr-x 2 jenkins jenkins 4096 Oct 30  2019 lastStableBuild
      -rw-rw-r-- 1 jenkins jenkins  129 Jul  7 12:26 permalinks
      
      ./8:
      total 180
      drwxrwxr-x 2 jenkins jenkins   4096 Oct 30  2019 .
      drwxrwxr-x 4 jenkins jenkins   4096 Jul  7 12:26 ..
      -rw-rw-r-- 1 jenkins jenkins   3565 Oct 30  2019 build.xml
      -rw-rw-r-- 1 jenkins jenkins      0 Oct 30  2019 changelog.xml
      -rw-rw-r-- 1 jenkins jenkins   3953 Oct 30  2019 injectedEnvVars.txt
      -rw-rw-r-- 1 jenkins jenkins 162055 Oct 30  2019 log
      
      ./lastStableBuild:
      total 92
      drwxrwxr-x 2 jenkins jenkins  4096 Oct 30  2019 .
      drwxrwxr-x 4 jenkins jenkins  4096 Jul  7 12:26 ..
      -rw-rw-r-- 1 jenkins jenkins  2959 Oct 30  2019 build.xml
      -rw-rw-r-- 1 jenkins jenkins     0 Oct 30  2019 changelog.xml
      -rw-rw-r-- 1 jenkins jenkins  3953 Oct 30  2019 injectedEnvVars.txt
      -rw-rw-r-- 1 jenkins jenkins 73347 Oct 30  2019 log
      

      Hopefully, it is possible to fix the problem by going on the file system and performing a manual "cp -ar <source> <target>"
       

            fcojfernandez Francisco Fernández
            geoffroyjabouley Geoffroy Jabouley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: