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

1,156 views
Skip to first unread message

672162494

unread,
May 26, 2015, 3:04:37 AM5/26/15
to jenkinsci-dev
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);



    





672162494

unread,
May 26, 2015, 7:25:56 AM5/26/15
to jenkinsci-dev

my dev plugin version 1.480


------------------ 原始邮件 ------------------
发件人: "我自己的邮箱";<6721...@qq.com>;
发送时间: 2015年5月26日(星期二) 下午3:04
收件人: "jenkinsci-dev"<jenkin...@googlegroups.com>;
主题: java.util.zip.ZipException: archive is not a ZIP archive
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/tencent_040F57D267A4645A5A6BC356%40qq.com.
For more options, visit https://groups.google.com/d/optout.

672162494

unread,
May 27, 2015, 4:11:40 AM5/27/15
to jenkinsci-dev
my dev plugin version 1.480

672162494

unread,
Jun 1, 2015, 6:05:35 AM6/1/15
to jenkinsci-dev
my dev plugin version 1.614

Vinodhini Vijay

unread,
Jan 30, 2017, 4:56:05 AM1/30/17
to Jenkins Developers, 6721...@qq.com
Hello,

I get the same Exception. Any clue? Was this issue solved?

Thanks in advance!

Regards
Reply all
Reply to author
Forward
0 new messages