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

cloudbees-disk-usage-simple-plugin doesn't work on read-only JENKINS_HOME

    • 203.v3f46a_7462b_1a_

      When running Jenkins from a read-only JENKINS_HOME, disk usage collection won't work, since it wants to touch the JENKINS_HOME directory.

      This happens when running Jenkins in a containerized environment with a read-only root filesystem, where all the writable paths (i.e. workspace, cache, tmp etc.) are mounted to writable filesystems.

      Is it maybe a possibility to opt-out of that touch to JENKINS_HOME?

          [JENKINS-66197] cloudbees-disk-usage-simple-plugin doesn't work on read-only JENKINS_HOME

          Tom Wieczorek created issue -

          Might be related to JENKINS-66250: cloudbees-disk-usage-simple-plugin produces lots of entries in the jobConfigHistory data - looks like actual disk usage data are stored in the plugin configuration space

          Marcin Cieślak added a comment - Might be related to JENKINS-66250: cloudbees-disk-usage-simple-plugin produces lots of entries in the jobConfigHistory data - looks like actual disk usage data are stored in the plugin configuration space
          Marcin Cieślak made changes -
          Link New: This issue relates to JENKINS-66250 [ JENKINS-66250 ]

          Pierre Beitz added a comment -

          The result of the computation is indeed serialized and written to disk under the `JENKINS_HOME`.

          I'm not sure about your setup though, how are the rest of the plugins working if they cannot write their configuration under `$JENKINS_HOME/*.xml`?

          Pierre Beitz added a comment - The result of the computation is indeed serialized and written to disk under the `JENKINS_HOME`. I'm not sure about your setup though, how are the rest of the plugins working if they cannot write their configuration under `$JENKINS_HOME/*.xml`?
          Pierre Beitz made changes -
          Assignee New: Pierre Beitz [ pierrebtz ]

          Tom Wieczorek added a comment - - edited

          The paths below JENKINS_HOME are writable. What doesn't work is the touching of JENKINS_HOME itself. It's a mountpoint inside a container.

          Tom Wieczorek added a comment - - edited The paths below JENKINS_HOME are writable. What doesn't work is the touching of JENKINS_HOME itself . It's a mountpoint inside a container.
          Chris made changes -
          Attachment New: image-2022-08-03-07-45-03-653.png [ 58632 ]

          Chris added a comment -

          We're seeing the same when running Jenkins in OpenShift (kubernetes) where JENKINS_HOME (/var/lib/jenkins) is mounted in the pod using a PVC backed persistent storage.

          We get these dumps in the Jenkins log

          2022-08-03 07:24:40 INFO    com.cloudbees.simplediskusage.QuickDiskUsagePlugin$2 run Re-estimating disk usage2022-08-03 07:24:50 INFO    com.cloudbees.simplediskusage.QuickDiskUsagePlugin$2 run Unable to run disk usage checkjava.io.IOException: Failed to set the timestamp of /var/lib/jenkins to 1659525890594  at hudson.FilePath$Touch.invoke(FilePath.java:1745)  at hudson.FilePath$Touch.invoke(FilePath.java:1733)  at hudson.FilePath.act(FilePath.java:1171)  at hudson.FilePath.act(FilePath.java:1154)  at hudson.FilePath.touch(FilePath.java:1731)  at com.cloudbees.simplediskusage.UsageComputation$1.preVisitDirectory(UsageComputation.java:79)  at com.cloudbees.simplediskusage.UsageComputation$1.preVisitDirectory(UsageComputation.java:67)  at java.base/java.nio.file.Files.walkFileTree(Files.java:2732)  at java.base/java.nio.file.Files.walkFileTree(Files.java:2797)  at com.cloudbees.simplediskusage.UsageComputation.computeUsage(UsageComputation.java:67)  at com.cloudbees.simplediskusage.UsageComputation.compute(UsageComputation.java:51)  at com.cloudbees.simplediskusage.QuickDiskUsagePlugin$2.run(QuickDiskUsagePlugin.java:258)  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)  at java.base/java.lang.Thread.run(Thread.java:829)
           

          And running in the script console produces the same.

          Chris added a comment - We're seeing the same when running Jenkins in OpenShift (kubernetes) where JENKINS_HOME (/var/lib/jenkins) is mounted in the pod using a PVC backed persistent storage. We get these dumps in the Jenkins log 2022-08-03 07:24:40 INFO com.cloudbees.simplediskusage.QuickDiskUsagePlugin$2 run Re-estimating disk usage2022-08-03 07:24:50 INFO com.cloudbees.simplediskusage.QuickDiskUsagePlugin$2 run Unable to run disk usage checkjava.io.IOException: Failed to set the timestamp of / var /lib/jenkins to 1659525890594 at hudson.FilePath$Touch.invoke(FilePath.java:1745) at hudson.FilePath$Touch.invoke(FilePath.java:1733) at hudson.FilePath.act(FilePath.java:1171) at hudson.FilePath.act(FilePath.java:1154) at hudson.FilePath.touch(FilePath.java:1731) at com.cloudbees.simplediskusage.UsageComputation$1.preVisitDirectory(UsageComputation.java:79) at com.cloudbees.simplediskusage.UsageComputation$1.preVisitDirectory(UsageComputation.java:67) at java.base/java.nio.file.Files.walkFileTree(Files.java:2732) at java.base/java.nio.file.Files.walkFileTree(Files.java:2797) at com.cloudbees.simplediskusage.UsageComputation.computeUsage(UsageComputation.java:67) at com.cloudbees.simplediskusage.UsageComputation.compute(UsageComputation.java:51) at com.cloudbees.simplediskusage.QuickDiskUsagePlugin$2.run(QuickDiskUsagePlugin.java:258) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang. Thread .run( Thread .java:829) And running in the script console produces the same.
          Tom Wieczorek made changes -
          Attachment New: remove-fs-freeze-check.patch [ 58671 ]

          Tom Wieczorek added a comment -

          I attached remove-fs-freeze-check.patch, which fixes the problem for me. Note that this is not a proper solution. It bluntly removes the code that tries to set the last modified date of the JENKINS_HOME folder.

          Tom Wieczorek added a comment - I attached remove-fs-freeze-check.patch , which fixes the problem for me. Note that this is not a proper solution. It bluntly removes the code that tries to set the last modified date of the JENKINS_HOME folder.

            pierrebtz Pierre Beitz
            twz123 Tom Wieczorek
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: