Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZipException while extracting, despite unzip, 7z and Windows Explorer extracts well #27

Closed
dem1tris opened this issue Jul 26, 2019 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@dem1tris
Copy link

Hi!

I use your library and just stumbled a problem archive, which causes exception during extracting, despite other archivers works with it normally and even without any warnings.

Stacktrace:

net.lingala.zip4j.exception.ZipException: Could not read corresponding local file header for file header: Some folder/lib/

	at net.lingala.zip4j.tasks.AbstractExtractFileTask.verifyNextEntry(AbstractExtractFileTask.java:85)
	at net.lingala.zip4j.tasks.AbstractExtractFileTask.extractFile(AbstractExtractFileTask.java:47)
	at net.lingala.zip4j.tasks.ExtractAllFilesTask.executeTask(ExtractAllFilesTask.java:35)
	at net.lingala.zip4j.tasks.ExtractAllFilesTask.executeTask(ExtractAllFilesTask.java:13)
	at net.lingala.zip4j.tasks.AsyncZipTask.performTaskWithErrorHandling(AsyncZipTask.java:41)
	at net.lingala.zip4j.tasks.AsyncZipTask.execute(AsyncZipTask.java:35)
	at net.lingala.zip4j.ZipFile.extractAll(ZipFile.java:431)

Original archive contained some files, but I modified it via Windows Explorer and 7z and got almost empty sample (empty1.zip), which causes same behavior.

@srikanth-lingala srikanth-lingala self-assigned this Jul 28, 2019
@srikanth-lingala srikanth-lingala added the bug Something isn't working label Jul 29, 2019
@srikanth-lingala
Copy link
Owner

Thanks for the sample zip file. It helps me a lot to investigate. Fix for this was supposed to be simple, but this is having some side-effects. I am working on it and will update this thread when I have a fix ready.

@srikanth-lingala
Copy link
Owner

Fixed in v2.1.2

@johnybillson
Copy link

Hello,
I have the exact same error ("Could not read corresponding local file header for file header: ...") with the latest version (2.2.1), when trying to unzip files that had been zipped with another library (java.util.zip for exemple).
It always happen after unzipping between 4.5 and 5.1 GB
I work with a large amount of files, i don't know if this has an incidence.

It works fine with files that have been zipped with zip4j in the first place.

@srikanth-lingala
Copy link
Owner

@johnybillson I was able to reproduce this issue. I opened a new issue here. Please follow it. I will make a fix and a release in the next few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants