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

full backups are saving symlink as directories, lead to incorrect installation when restored

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • periodicbackup-plugin
    • None
    • Windows Server 2008 R2 SP1, Jenkins 1.592, Periodic Backup plugin 1.3

    Description

      Hi.

      Am using periodic backup plugin to do full backup of our Jenkins installation on Windows. The symlink files (lastBuild, last SucessfulBuild, last FailedBuild etc), get saved as directories in the backup .zip file, and restored that way. These directories then cause errors in subsequent builds as Jenkins goes to update the symlinks and can't since they are directories.

      ln builds\lastSuccessfulBuild C:\Users\build_user\.jenkins\jobs\Disk_Monitor\lastSuccessful failed
      hudson.util.jna.WinIOException: Failed to create a symlink C:\Users\build_user\.jenkins\jobs\Disk_Monitor\lastSuccessful to builds\lastSuccessfulBuild error=183:Cannot create a file when that file already exists
      at hudson.util.jna.Kernel32Utils.createSymbolicLink(Kernel32Utils.java:93)
      at hudson.Util.createSymlink(Util.java:1132)
      at hudson.model.Run.createSymlink(Run.java:1865)
      at hudson.model.Run.updateSymlinks(Run.java:1846)
      at hudson.model.Run.execute(Run.java:1757)
      at hudson.matrix.MatrixBuild.run(MatrixBuild.java:306)
      at hudson.model.ResourceController.execute(ResourceController.java:89)
      at hudson.model.Executor.run(Executor.java:240)
      at hudson.model.OneOffExecutor.run(OneOffExecutor.java:43)

      The plugin should try to save these symlinks and restore them properly.

      Related: JENKINS-18924. https://issues.jenkins-ci.org/browse/JENKINS-18924

      Attachments

        Activity

          Code changed in jenkins
          User: Jonathan Kamens
          Path:
          src/main/java/org/jenkinsci/plugins/periodicbackup/FullBackup.java
          http://jenkins-ci.org/commit/periodicbackup-plugin/17c9607582007ca546bd7fc011fb8afd322fe1b5
          Log:
          [FIXED JENKINS-25887] - Don not follow symlinks in FullBackup (#9)

          JENKINS-25887 - Don not follow symlinks in FullBackup

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jonathan Kamens Path: src/main/java/org/jenkinsci/plugins/periodicbackup/FullBackup.java http://jenkins-ci.org/commit/periodicbackup-plugin/17c9607582007ca546bd7fc011fb8afd322fe1b5 Log: [FIXED JENKINS-25887] - Don not follow symlinks in FullBackup (#9) JENKINS-25887 - Don not follow symlinks in FullBackup
          oleg_nenashev Oleg Nenashev added a comment -

          Released in 1.4

          oleg_nenashev Oleg Nenashev added a comment - Released in 1.4

          People

            Unassigned Unassigned
            rickybobpat Rick Patterson
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: