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

Jenkins JIRA | Hu bingyin | 2 years ago
  1. 0

    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);

    Jenkins JIRA | 2 years ago | Hu bingyin
    java.util.zip.ZipException: archive is not a ZIP archive
  2. 0

    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);

    Jenkins JIRA | 2 years ago | Hu bingyin
    java.util.zip.ZipException: archive is not a ZIP archive
  3. 0

    ZipException with 0.1.12 executing jrubyStorm task

    GitHub | 2 years ago | phrinx
    java.util.zip.ZipException: archive is not a ZIP archive
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Example Build failed at :ReactAndroid:prepareBoost because of 'boost_1_57_0.zip' is not a ZIP file

    GitHub | 10 months ago | jobsamuel
    org.gradle.api.GradleException: Could not expand ZIP '/home/jobsamuel/dev/react-native/ReactAndroid/build/downloads/boost_1_57_0.zip'.
  6. 0

    unable to create fatJar using gradle

    Stack Overflow | 4 months ago | Shashi
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':fatJar'.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.util.zip.ZipException

      archive is not a ZIP archive

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