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

zip step hangs while recursively zipping the zipfile itself

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • Mac OSX 10.12.6 (64 bit)
      Oracle JDK 1.8.0_181
      Jenkins 2.235.1
      Pipeline Utility Steps 2.6.1
      Running Jenkins via SSH from a Windows Server master

      The zip pipeline step hangs forever on OSX, apparently because it is trying to ZIP the target output file itself. When the job times out I find a corrupt ZIP file weighing many gigabytes.

      I am running zip inside a dir block. The steps are run on a separate node and the resulting zip file should be archived to the master. My pipeline script looks like the following.

       

      pipeline {
        // ...
        stages {
          stage('Build') {
            parallel {
              // ...
              stage('Build on Macosx') {
                agent { 
                  label 'osx'
                }
                // ...
                steps {
                  // ...
                  dir('output/dist') {
                    zip zipFile: 'dist.zip', dir: '.', archive: true
                  }
                }
              }
              // ...
            }
          }
        }
      }
      

      I can work around the problem by creating the ZIP outside of the zipped directory.

      dir('output') {
        zip zipFile: 'dist.zip', dir: 'dist', archive: true
      }
      

      The same pipeline was running just fine before upgrading Jenkins and the Utility Steps plugin.

      I think that this regression may have been introduced by this commit that started using Java NIO in ZipStepExecution
      https://github.com/jenkinsci/pipeline-utility-steps-plugin/commit/c093b94d2ef3dc7f8b2329d397f7ca3cc27664a7#diff-753a1862b4e0b68a0a8223c23d45e2d8

      Maybe the canonical path comparison is no longer accurate in all cases.

       

       

            allan_burdajewicz Allan BURDAJEWICZ
            lorenzodv Lorenzo Dalla Vecchia
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: