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

zip step hangs while recursively zipping the zipfile itself

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Labels:
      None
    • Environment:
      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
    • Similar Issues:

      Description

      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.

       

       

        Attachments

          Activity

          Hide
          peteboyrocket Pete W added a comment -
          Show
          peteboyrocket Pete W added a comment - Perhaps a duplicate of  https://issues.jenkins.io/browse/JENKINS-62928 ?

            People

            Assignee:
            rsandell rsandell
            Reporter:
            lorenzodv Lorenzo Dalla Vecchia
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated: