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

Backup process breaks due to FileNotFoundException

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Critical
    • Resolution: Fixed
    • thinbackup-plugin
    • None
    • Jenkins LTS 2.303.2
      Thin Backup Plugin 1.10
    • 1.14

    Description

      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.

      Attachments

        Issue Links

          Activity

            krulls Stephan Krull created issue -
            krulls Stephan Krull made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-12098 [ JENKINS-12098 ]
            krulls Stephan Krull made changes -
            Link This issue is related to JENKINS-65516 [ JENKINS-65516 ]
            krulls Stephan Krull made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            krulls Stephan Krull made changes -
            Assignee Thomas Fürer [ tofuatjava ] Stephan Krull [ krulls ]
            krulls Stephan Krull made changes -
            Remote Link This issue links to "https://github.com/jenkinsci/thin-backup-plugin/pull/33 (Web Link)" [ 27322 ]

            2022-02-14 04:20:41.294+0000 [id=9515] 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 '/opt/jenkins_backup'.
            java.io.FileNotFoundException: Source '/var/lib/jenkins/jobs/.git/indexing' does not exist
            at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1368)
            at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1261)
            at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1230)
            at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJob(HudsonBackup.java:266)
            at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJobsDirectory(HudsonBackup.java:230)
            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.ThinBackupMgmtLink$1.execute(ThinBackupMgmtLink.java:83)
            at org.jvnet.hudson.plugins.thinbackup.hudson.model.AsyncPeriodicWork.lambda$doRun$0(AsyncPeriodicWork.java:53)
            at java.lang.Thread.run(Thread.java:750)

            Here also getting same issue. The plugin expects the indexing in a location where it doesn't exist. Due to missing file Full backup is failed and old backup were not moved to ZIP files, there was no plugins, nodes, user content in backup folder as configured.

            Jenkins - 2.319.3
            Plugin version- 1.10

            shivabeepeta shiva krishna beepeta added a comment - 2022-02-14 04:20:41.294+0000 [id=9515] 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 '/opt/jenkins_backup'. java.io.FileNotFoundException: Source '/var/lib/jenkins/jobs/.git/indexing' does not exist at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1368) at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1261) at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1230) at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJob(HudsonBackup.java:266) at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJobsDirectory(HudsonBackup.java:230) 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.ThinBackupMgmtLink$1.execute(ThinBackupMgmtLink.java:83) at org.jvnet.hudson.plugins.thinbackup.hudson.model.AsyncPeriodicWork.lambda$doRun$0(AsyncPeriodicWork.java:53) at java.lang.Thread.run(Thread.java:750) Here also getting same issue. The plugin expects the indexing in a location where it doesn't exist. Due to missing file Full backup is failed and old backup were not moved to ZIP files, there was no plugins, nodes, user content in backup folder as configured. Jenkins - 2.319.3 Plugin version- 1.10
            stefan_spieker Stefan Spieker made changes -
            Released As 1.14
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Fixed but Unreleased [ 10203 ]
            stefan_spieker Stefan Spieker made changes -
            Status Fixed but Unreleased [ 10203 ] Resolved [ 5 ]

            People

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

              Dates

                Created:
                Updated:
                Resolved: