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

Wrong Error: SEVERE: Could not create backup directory. Backup cannot be performed

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: thinbackup-plugin
    • Labels:
      None
    • Environment:
      ThinBackup v1.7.4 on Ubuntu Precise
      Jenkins ver. 1.522
    • Similar Issues:

      Description

      When the thinBackup is configured to backup to a directory outside of Jenkins home (/var/lib/jenkins) causes the backup to fail with a a wrong error, as per below log dump.

      Checked permissions, and the jenkins user does have write access to the directory.

      Mounting the directory to ie: /var/lib/jenkins/backups using --bind, and changing the backup directory from /var/backups/jenkins to /var/lib/jenkins/backups and the backup succeeds.


      13-Mar-2014 17:24:40 org.jvnet.hudson.plugins.thinbackup.ThinBackupMgmtLink doBackupManual
      INFO: Starting manual backup.
      13-Mar-2014 17:24:40 org.jvnet.hudson.plugins.thinbackup.ThinBackupPeriodicWork backupNow
      WARNING: Do not wait until jenkins/hudson is idle to perform backup. This could cause corrupt backups.
      13-Mar-2014 17:24:40 org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup <init>
      INFO: No previous full backup found, thus creating one.
      13-Mar-2014 17:24:40 org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup backup
      SEVERE: Could not create backup directory. Backup cannot be performed.
      13-Mar-2014 17:24:40 org.jvnet.hudson.plugins.thinbackup.ThinBackupPeriodicWork backupNow
      SEVERE: Cannot perform a backup. Please be sure jenkins/hudson has write privileges in the configured backup path 'var/backups/jenkins'.
      java.io.IOException: Could not create backup directory. Backup cannot be performed.
      at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backup(HudsonBackup.java:137)
      at org.jvnet.hudson.plugins.thinbackup.ThinBackupPeriodicWork.backupNow(ThinBackupPeriodicWork.java:87)
      at org.jvnet.hudson.plugins.thinbackup.ThinBackupMgmtLink$1.execute(ThinBackupMgmtLink.java:76)
      at org.jvnet.hudson.plugins.thinbackup.hudson.model.AsyncPeriodicWork$1.run(AsyncPeriodicWork.java:53)
      at java.lang.Thread.run(Thread.java:679)
      13-Mar-2014 17:24:57 org.jvnet.hudson.plugins.thinbackup.ThinBackupMgmtLink doBackupManual
      INFO: Starting manual backup.
      13-Mar-2014 17:24:57 org.jvnet.hudson.plugins.thinbackup.ThinBackupPeriodicWork backupNow
      WARNING: Do not wait until jenkins/hudson is idle to perform backup. This could cause corrupt backups.
      13-Mar-2014 17:24:57 org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup <init>
      INFO: No previous full backup found, thus creating one.
      13-Mar-2014 17:24:57 org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup backup
      SEVERE: Could not create backup directory. Backup cannot be performed.
      13-Mar-2014 17:24:57 org.jvnet.hudson.plugins.thinbackup.ThinBackupPeriodicWork backupNow
      SEVERE: Cannot perform a backup. Please be sure jenkins/hudson has write privileges in the configured backup path '/var/backups/jenkins'.
      java.io.IOException: Could not create backup directory. Backup cannot be performed.
      at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backup(HudsonBackup.java:137)
      at org.jvnet.hudson.plugins.thinbackup.ThinBackupPeriodicWork.backupNow(ThinBackupPeriodicWork.java:87)
      at org.jvnet.hudson.plugins.thinbackup.ThinBackupMgmtLink$1.execute(ThinBackupMgmtLink.java:76)
      at org.jvnet.hudson.plugins.thinbackup.hudson.model.AsyncPeriodicWork$1.run(AsyncPeriodicWork.java:53)
      at java.lang.Thread.run(Thread.java:679)

        Attachments

          Activity

          Hide
          ibuclaw Iain Buclaw added a comment -

          Further diagnosis, when setting the backup directory as '/var/backups' the following error is flagged up:

          The directory exists, but is not writable.

          When setting to '/var/backups/jenkins', the warning is emitted:

          The directory does not exist, but will be created before the first run.

          However the directory does exist...

          Show
          ibuclaw Iain Buclaw added a comment - Further diagnosis, when setting the backup directory as '/var/backups' the following error is flagged up: The directory exists, but is not writable. When setting to '/var/backups/jenkins', the warning is emitted: The directory does not exist, but will be created before the first run. However the directory does exist...
          Hide
          tofuatjava Thomas Fürer added a comment -

          my configuration
          JENKINS_HOME=/var/local/jenkins
          BACKUP_PATH=/home/backup
          jenkins is runned with the jenkins user (system user without login permission)
          BACKUP_PATH owner is set to jenkins:jenkins and has r/w/x permissions, r for all others

          OS: Ubuntu Server 1310
          JENKINS: 1.532.1 LTS
          ThinBackup: 1.7.4

          in this configuration I cannot found a problem, I also have test configurations on windows and other linux systems but do not get this error.

          Show
          tofuatjava Thomas Fürer added a comment - my configuration JENKINS_HOME=/var/local/jenkins BACKUP_PATH=/home/backup jenkins is runned with the jenkins user (system user without login permission) BACKUP_PATH owner is set to jenkins:jenkins and has r/w/x permissions, r for all others OS: Ubuntu Server 1310 JENKINS: 1.532.1 LTS ThinBackup: 1.7.4 in this configuration I cannot found a problem, I also have test configurations on windows and other linux systems but do not get this error.
          Hide
          ibuclaw Iain Buclaw added a comment -

          I've set BACKUP_PATH in /etc/defaults/jenkins, restarted, and is still the same.

          /var/backups/jenkins is owned by: jenkins:nogroup, permissions 750 (rwx/rx//)

          JENKINS_USER is set as jenkins

          JENKINS_HOME is mounted from an iscsi disk, and BACKUP_PATH is on the main root system. But that should have no effect on this occurring.

          Show
          ibuclaw Iain Buclaw added a comment - I've set BACKUP_PATH in /etc/defaults/jenkins, restarted, and is still the same. /var/backups/jenkins is owned by: jenkins:nogroup, permissions 750 (rwx/rx//) JENKINS_USER is set as jenkins JENKINS_HOME is mounted from an iscsi disk, and BACKUP_PATH is on the main root system. But that should have no effect on this occurring.
          Hide
          tofuatjava Thomas Fürer added a comment -

          sorry for the missunderstanding, but BACKUP_PATH is not an environment variable nor a property. The only way how the backup path could be defined is to use the settings page.

          I'm not an expert with iscsi, but i think it must be something with the permissions or something else on system level. I do not have any possibility to test with iscsi, but with SMB and NFS it works fine for me.

          Have you tried to switch the user or extand the permissions to the directory?

          Show
          tofuatjava Thomas Fürer added a comment - sorry for the missunderstanding, but BACKUP_PATH is not an environment variable nor a property. The only way how the backup path could be defined is to use the settings page. I'm not an expert with iscsi, but i think it must be something with the permissions or something else on system level. I do not have any possibility to test with iscsi, but with SMB and NFS it works fine for me. Have you tried to switch the user or extand the permissions to the directory?
          Hide
          ibuclaw Iain Buclaw added a comment -

          Jenkins itself is working fine and is able to read from /usr/share/jenkins and write to /var/log/jenkins just fine. it just seems to be only for thinBackup that it's just not able to write/read.

          Tried with rwx on all but still the same problem. one thing I haven't thought to check is the permissions on /var/backups itself. Disallowing the jenkins user traverse permissions here could perhaps be a likely cause. I've already proven that there's nothing wrong with the permissions of the directory itself as its currently mounted as

          mount -o bind /var/backups/jenkins /var/lib/jenkins/backups
          Show
          ibuclaw Iain Buclaw added a comment - Jenkins itself is working fine and is able to read from /usr/share/jenkins and write to /var/log/jenkins just fine. it just seems to be only for thinBackup that it's just not able to write/read. Tried with rwx on all but still the same problem. one thing I haven't thought to check is the permissions on /var/backups itself. Disallowing the jenkins user traverse permissions here could perhaps be a likely cause. I've already proven that there's nothing wrong with the permissions of the directory itself as its currently mounted as mount -o bind / var /backups/jenkins / var /lib/jenkins/backups
          Hide
          markdebont mark de bont added a comment -

          I experience the same problem on Windows Jenkins LTS 1.554.1 and ThinBackup 1.7.4. Funny thing is that I have another, almost identical, instance of Jenkins running without any problem?!

          Show
          markdebont mark de bont added a comment - I experience the same problem on Windows Jenkins LTS 1.554.1 and ThinBackup 1.7.4. Funny thing is that I have another, almost identical, instance of Jenkins running without any problem?!
          Hide
          tofuatjava Thomas Fürer added a comment -

          reduced priority because a siple workaround is in lace -> move backup path to a local destination. also a different post shows that the problem must be a configuration thing and not a programming error.

          Show
          tofuatjava Thomas Fürer added a comment - reduced priority because a siple workaround is in lace -> move backup path to a local destination. also a different post shows that the problem must be a configuration thing and not a programming error.
          Hide
          markdebont mark de bont added a comment -

          Moving the location to a local destination resolves the problem. Doesn't explain why another instance, same Jenkins and plugin version, is accepting an external UNC path successfully?

          Show
          markdebont mark de bont added a comment - Moving the location to a local destination resolves the problem. Doesn't explain why another instance, same Jenkins and plugin version, is accepting an external UNC path successfully?

            People

            • Assignee:
              tofuatjava Thomas Fürer
              Reporter:
              ibuclaw Iain Buclaw
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: