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

Backup process breaks due to FileNotFoundException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • thinbackup-plugin
    • None
    • Jenkins LTS 2.303.2
      Thin Backup Plugin 1.10
    • 1.14

      We see failing backups with the plugin with the following log message:

      2021-12-20 01:20:22.584+0000 [id=2126208]       SEVERE  o.j.h.p.t.ThinBackupPeriodicWork#backupNow: Cannot perform a backup. Please be sure jenkins/hudson 
      has write privileges in the configured backup path '/var/lib/jenkins/BACKUP'.
      java.io.FileNotFoundException: Source '/var/lib/jenkins/jobs/dirlevel1/jobs/dirlevel2/config.xml' does not exist
              at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1074)
              at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1038)
              at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJobsDirectory(HudsonBackup.java:227)
              at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJobsDirectory(HudsonBackup.java:228)
              at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJobs(HudsonBackup.java:209)
              at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backup(HudsonBackup.java:168)
              at org.jvnet.hudson.plugins.thinbackup.ThinBackupPeriodicWork.backupNow(ThinBackupPeriodicWork.java:89)
              at org.jvnet.hudson.plugins.thinbackup.ThinBackupPeriodicWork.execute(ThinBackupPeriodicWork.java:66)
              at org.jvnet.hudson.plugins.thinbackup.hudson.model.AsyncPeriodicWork.lambda$doRun$0(AsyncPeriodicWork.java:53)
              at java.lang.Thread.run(Thread.java:748)
      

      (The path to the missing file has been anonymized)

      The plugin expects the config.xml in a location where it doesn't exist. This is due to assumptions which are done in the plugin code and it seems those assumptions do not fit.

      The error also shows that some other plugins do not clean up properly as in the current case we had left over folders from a former pipeline (or multibranch pipeline) job. Those folders should have been deleted by the Jenkins logic once the user triggers the deletion or move, but seems to be buggy.

      Anyway, the plugin should be careful with trying to copy things which probably do not exist.

      I am gonna prepare a PR to alleviate this problem.

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

              Created:
              Updated:
              Resolved: