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

Jenkins cannot delete root-owned files/folders in jenkins-owned directories



    • Improvement
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • core


      We want to be able to wipe workspaces containing files created via Docker containers (and thus owned by root). In a shell, as jenkins, we can delete root-owned files/folders as long as they are within jenkins-owned directories. But this function ( https://github.com/jenkinsci/jenkins/blob/6c2fffb/core/src/main/java/hudson/Util.java#L299 ) fails in that case.

      Perhaps, it's due to a windowsOS java limitation which cannot delete a non-empty directory?

      Could it be possible to create a special implementation for unix, that allows deletion of non-empty directories and thus supports the use-case mentioned above?


        Issue Links


            pdupont Philippe Dupont created issue -
            pdupont Philippe Dupont made changes -
            Field Original Value New Value
            Summary Jenkins cannot delete files owned by root in folders he own Jenkins cannot delete root-owned files/folders in jenkins-owned directories
            danielbeck Daniel Beck made changes -
            Issue Type Bug [ 1 ] Improvement [ 4 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 157421 ] JNJira + In-Review [ 179575 ]
            jdupont Jules Dupont made changes -
            Comment [ +1 – I'm not sure if our setup is atypical, but we're running the jenkins user as non-root (to avoid potential security issues and because we're starting agents from the master node via SSH) and we're running docker as root to avoid to a bunch of problems that happen otherwise. As a result, this bug leads to the accumulation of hundreds of GBs of files on all of our Linux agents. This is definitely not minor for us. ]
            nickbrown Nicholas Brown made changes -
            Link This issue relates to JENKINS-64874 [ JENKINS-64874 ]


              Unassigned Unassigned
              pdupont Philippe Dupont
              11 Vote for this issue
              20 Start watching this issue