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

Backup plugin can't restore in Ubuntu with Unable to created directory

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: backup-plugin
    • Labels:
      None
    • Environment:
      OS: Ubuntu 10.04.1
      Jenkins: 1.456
      Backup Plugin: 1.6.1
    • Similar Issues:

      Description

      When restore, I got follow exception: 
      [ INFO] Restore started at [10/15/12 02:58:15]
      [ INFO] Working into /var/lib/jenkins_restore directory
      [ INFO] Uncompressing archive file...
      org.jvnet.hudson.plugins.backup.utils.compress.ArchiverException: Unable to created directory /var/lib/jenkins_restore
      at org.jvnet.hudson.plugins.backup.utils.compress.AbstractUnArchiver.unArchive(AbstractUnArchiver.java:52)
      at org.jvnet.hudson.plugins.backup.utils.RestoreTask.run(RestoreTask.java:94)
      at java.lang.Thread.run(Thread.java:679)
      Caused by: java.io.IOException: Unable to create directory /var/lib/jenkins_restore
      at org.apache.commons.io.FileUtils.forceMkdir(FileUtils.java:1488)
      at org.jvnet.hudson.plugins.backup.utils.compress.AbstractUnArchiver.unArchive(AbstractUnArchiver.java:48)
      ... 2 more
      [ERROR] Error uncompressing archive : Unable to created directory /var/lib/jenkins_restore

        Attachments

          Activity

          Hide
          coocoon James Yin added a comment -

          This problem is caused by permission limit to Create folder, a workaround is chmod -R 0777 /var/lib, to set all permission to all user.

          Show
          coocoon James Yin added a comment - This problem is caused by permission limit to Create folder, a workaround is chmod -R 0777 /var/lib, to set all permission to all user.
          Hide
          oldelvet Richard Mortimer added a comment -

          @James Yin. Your suggestion of a chmod -R is a bit too permissive. After you have done that you have made the entire contents of /var/lib writeable by anyone with login access to your machine. I really would caution against doing that.

          A better (untested) way would be to do

          sudo mkdir /var/lib/jenkins_restore
          sudo chown jenkins /var/lib/jenkins_restore
          

          or if that does not work and you really need to change the permissions of /var/lib then just do

          sudo chmod 777 /var/lib
          ... perform restore ...
          sudo chmod 755 /var/lib
          

          But certainly you do not need to supply the -R parameter to chmod.

          Show
          oldelvet Richard Mortimer added a comment - @James Yin. Your suggestion of a chmod -R is a bit too permissive. After you have done that you have made the entire contents of /var/lib writeable by anyone with login access to your machine. I really would caution against doing that. A better (untested) way would be to do sudo mkdir / var /lib/jenkins_restore sudo chown jenkins / var /lib/jenkins_restore or if that does not work and you really need to change the permissions of /var/lib then just do sudo chmod 777 / var /lib ... perform restore ... sudo chmod 755 / var /lib But certainly you do not need to supply the -R parameter to chmod.
          Hide
          thekarel Charles Szilagyi added a comment -

          Creating /var/lib/jenkins_restore is not enough:

          [ INFO] Restore started at [08/28/15 05:58:06]
          [ INFO] Working into /var/lib/jenkins_restore directory
          [ INFO] A old restore working dir exists, cleaning ...
          [ERROR] Unable to delete /var/lib/jenkins_restore
          

          For now chmod 0777 /var/lib seems to be the only option.

          Show
          thekarel Charles Szilagyi added a comment - Creating /var/lib/jenkins_restore is not enough: [ INFO] Restore started at [08/28/15 05:58:06] [ INFO] Working into / var /lib/jenkins_restore directory [ INFO] A old restore working dir exists, cleaning ... [ERROR] Unable to delete / var /lib/jenkins_restore For now chmod 0777 /var/lib seems to be the only option.

            People

            • Assignee:
              danielpetisme Daniel Petisme
              Reporter:
              coocoon James Yin
            • Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: