• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • thinbackup-plugin
    • None
    • Jenkins 2.387.1 (LTS)
      thinBackup plugin version 1.17
    • 1.18

      We have configured the ThinBackup plugin to only keep one backup. That means that the plugin takes care to delete older backup folders in the usual "BACKUP" folder.

      In our instance this process fails, the plugin logic is not deleting the old ones, because I think it runs into failures that keeps it from progressing accordingly.

      There are different ERROR log messages that we see:

      2023-07-03 01:05:42.747+0000 [id=7826577]       SEVERE  o.j.h.p.t.ThinBackupPeriodicWork#backupNow: Cannot perform a backup. Please be sure Jenkins h
      as write privileges in the configured backup path '/var/lib/jenkins/BACKUP'.
      java.io.IOException: Failed to copy full contents from '/var/lib/jenkins/jobs/XXX/jobs/XXX/jobs/XXX/build
      s/4270/atomic17828955692041612780.tmp' to '/var/lib/jenkins/BACKUP/FULL-2023-07-03_00-00/jobs/XXX/jobs/XXX/jobs/XXX
      /builds/4270/atomic17828955692041612780.tmp' Expected length: 53248 Actual: 53134
              at org.apache.commons.io.FileUtils.requireEqualSizes(FileUtils.java:2684)
              at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:853)
              at org.apache.commons.io.FileUtils.doCopyDirectory(FileUtils.java:1312)
              at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:699)
              at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:630)
              at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:580)
              at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupBuildFiles(HudsonBackup.java:458)
              at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupBuildsFor(HudsonBackup.java:421)
              at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJob(HudsonBackup.java:285)
              at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJobsDirectory(HudsonBackup.java:268)
              at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJobsDirectory(HudsonBackup.java:266)
              at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJobsDirectory(HudsonBackup.java:266)
              at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJobs(HudsonBackup.java:243)
              at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backup(HudsonBackup.java:175)
              at org.jvnet.hudson.plugins.thinbackup.ThinBackupPeriodicWork.backupNow(ThinBackupPeriodicWork.java:90)
              at org.jvnet.hudson.plugins.thinbackup.ThinBackupPeriodicWork.execute(ThinBackupPeriodicWork.java:67)
              at hudson.model.AsyncPeriodicWork.lambda$doRun$0(AsyncPeriodicWork.java:102)
              at java.base/java.lang.Thread.run(Thread.java:829)
      
      2023-06-30 04:09:08.678+0000 [id=6529555]       SEVERE  h.i.i.InstallUncaughtExceptionHandler$DefaultUncaughtExceptionHandler#uncaughtException: A th
      read (ThinBackup Worker Thread thread/6529555) died unexpectedly due to an uncaught exception, this may leave your Jenkins in a bad way and is usuall
      y indicative of a bug in the code.
      java.nio.file.NoSuchFileException: /var/lib/jenkins/jobs/XXX/jobs/XXX/XXX/branches/PR-9903/workspace@script/6b
      b589dce5049c807fd916524d9602a43c2b77b63ca73f92b1bc97f5a37671e0/lib/modules/areas/lib/util/__tests__/__snapshots__/areas-util-test.js.snap
              at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
              at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
              at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
              at java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
              at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:149)
              at java.base/sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
              at java.base/java.nio.file.Files.readAttributes(Files.java:1764)
              at java.base/java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:219)
              at java.base/java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:276)
              at java.base/java.nio.file.FileTreeWalker.next(FileTreeWalker.java:373)
              at java.base/java.nio.file.Files.walkFileTree(Files.java:2761)
              at org.apache.commons.io.FileUtils.listAccumulate(FileUtils.java:2076)
              at org.apache.commons.io.FileUtils.listFiles(FileUtils.java:2132)
      Caused: java.io.UncheckedIOException: /var/lib/jenkins/jobs/XXX/jobs/XXX/jobs/XXX/branches
              at org.apache.commons.io.FileUtils.listFiles(FileUtils.java:2135)
              at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.findAllConfigurations(HudsonBackup.java:367)
              at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJob(HudsonBackup.java:306)
              at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJobsDirectory(HudsonBackup.java:268)
              at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJobsDirectory(HudsonBackup.java:266)
              at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJobsDirectory(HudsonBackup.java:266)
              at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJobs(HudsonBackup.java:243)
              at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backup(HudsonBackup.java:175)
              at org.jvnet.hudson.plugins.thinbackup.ThinBackupPeriodicWork.backupNow(ThinBackupPeriodicWork.java:90)
              at org.jvnet.hudson.plugins.thinbackup.ThinBackupPeriodicWork.execute(ThinBackupPeriodicWork.java:67)
              at hudson.model.AsyncPeriodicWork.lambda$doRun$0(AsyncPeriodicWork.java:102)
              at java.base/java.lang.Thread.run(Thread.java:829)
      

      There is no more log output that would tell me that the backup process failed or ended and even no message about skipping the clean up of old backup folders. I can just see that the old backup folders remain from day to day and disc usage grows.

          [JENKINS-71587] Deleting old backup folders fails

          Stephan Krull added a comment -

          The attached shows the settings of the plugin in our instance.

          Stephan Krull added a comment - The attached shows the settings of the plugin in our instance.

          Stephan Krull added a comment -

          I plan to provide a PR to tackle the error messages from above in a way that the plugin keeps progressing and removes old backup files.

          Stephan Krull added a comment - I plan to provide a PR to tackle the error messages from above in a way that the plugin keeps progressing and removes old backup files.

          Stephan Krull added a comment -

          Stephan Krull added a comment - Provided a PR with a solution in https://github.com/jenkinsci/thin-backup-plugin/pull/112

          Stephan Krull added a comment -

          For completeness:

          • issue has been fixed by introducing a new check box in the plugin configuration to fail the backup fast (default: true, to keep backwards compatibility):
          • if this is configured to be false, then exceptions, which occur during the file handling the different backup steps, will be caught and logged accordingly and ... the backup continues processing

          Stephan Krull added a comment - For completeness: issue has been fixed by introducing a new check box in the plugin configuration to fail the backup fast (default: true, to keep backwards compatibility): if this is configured to be false, then exceptions, which occur during the file handling the different backup steps, will be caught and logged accordingly and ... the backup continues processing

            krulls Stephan Krull
            krulls Stephan Krull
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: