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

Exception about java.util.zip.ZipException: archive is not a ZIP archive

XMLWordPrintable

      my dev plugin version 1.614

      The error below occurs intermittently, with low frequency.
      but I have this zip file and can upzip it properly, I am not sure why this error pops up.
      pls reply ,thx !

      java.util.zip.ZipException: archive is not a ZIP archive
      at org.apache.tools.zip.ZipFile.positionAtCentralDirectory(ZipFile.java:481)
      at org.apache.tools.zip.ZipFile.populateFromCentralDirectory(ZipFile.java:320)
      at org.apache.tools.zip.ZipFile.<init>(ZipFile.java:186)
      at org.apache.tools.zip.ZipFile.<init>(ZipFile.java:163)
      at org.apache.tools.zip.ZipFile.<init>(ZipFile.java:124)
      at hudson.FilePath.unzip(FilePath.java:571)
      at hudson.FilePath.access$300(FilePath.java:191)
      at hudson.FilePath$3.invoke(FilePath.java:496)
      at hudson.FilePath$3.invoke(FilePath.java:492)
      at hudson.FilePath.act(FilePath.java:989)
      at hudson.FilePath.act(FilePath.java:967)
      at hudson.FilePath.unzip(FilePath.java:492)
      at com.wangyin.ci.performance.PerformanceReporterPublisher.copyReportsToMaster(PerformanceReporterPublisher.java:742)
      at com.wangyin.ci.performance.PerformanceReporterPublisher.perform(PerformanceReporterPublisher.java:334)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
      at hudson.model.Build$BuildExecution.post2(Build.java:183)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
      at hudson.model.Run.execute(Run.java:1766)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:374)

      My code:(PerformanceReporterPublisher.copyReportsToMaster)

      private void copyReportsToMaster(AbstractBuild<?, ?> build, PrintStream logger, FilePath[] listfilFilePaths, String parserDisplayName) throws IOException, InterruptedException {
      FilePath remoteZipDir = null;
      FilePath remoteZip = null;
      try {
      String zipString = "report-result.zip";
      String zipDirString = "report-result";
      remoteZipDir = new FilePath(build.getModuleRoot(), zipDirString);
      remoteZipDir.mkdirs();
      logger.println("copy remote report to remote report-result dir....");
      for (FilePath src : listfilFilePaths)

      { src.copyTo(new FilePath(remoteZipDir, src.getName())); }

      remoteZip = new FilePath(remoteZipDir.getParent(), zipString);
      logger.println("compress remote report-result dir ....");
      remoteZipDir.zip(remoteZip);
      File localReport = getPerformanceReport(build, parserDisplayName, zipString);

      FilePath localReportFilePath = new FilePath(localReport);
      logger.println("copy report-result zip to locate....");
      remoteZip.copyTo(localReportFilePath);
      FilePath resultDir = new FilePath(localReportFilePath.getParent(), zipDirString);
      localReportFilePath.unzip(resultDir);

            gbossert gbossert
            nabokil Hu bingyin
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: