-
Notifications
You must be signed in to change notification settings - Fork 980
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
Header checksum is invalid #160
Comments
I just had the same problem. For future Googlers: My problem turned out to be that I actually had a |
I got the same issue on a tar file. I untar the file using 7-zip, retar them using 7-zip Add to Archive, choose Archive Format as tar, set Compression Level as Storage, and untar it using ICharpCode. The error was gone. |
Yeah, this seems to be related to unexpected data at the end of the input stream. I could take a look at it, but someone needs to attach an archive that produces this problem :) You can upload it to github by just dragging it to the comment textbox. |
Well, my archive is just too large 💦 |
@msvprogs Hm, what is the size of the .tar and the content when extracted? (you can use @bradleyasdf You don't happen to still have the "bad" file and be willing to upload it by any chance? |
It's an OVA virtual machine, above 700 Mb, not compressed. |
You should be able to extract the contents of the OVA like any other tar-file. |
Hi! I've been dealing with Header checksum invalid problem for a week and I don't know what else to try. I'm having issues only on IOS devices. I need to download a tar.gz compressed file, I'm using UnityWebRequest to download the file and I've tried to extract it using the Simple full extract from a TGZ (.tar.gz) example, and basically all other examples posted, but for some reason I keep getting this error when the GetNextEntry method is called either in ListContents or ExtractContents from inputTarArchive. Apparently on IOS when the header makes a ParseBuffer with the tarHeader received the checkSum obtained with the parseOctal method is different from the MakeCheckSum method and I can't figure out why, please I need help. |
@silviaPixowl I actually think this is another issue. Could you make a new issue with the code you are using to extract, and if possible provide a sample file? Also, have you tried it in the simulator? (I don't have any iPhones at hand atm. to test on) The original issue has to do with tar archives that don't stop after the last entry. If there is data left in the buffer and that data is not just null bytes, the library will try to read that data as a new entry, but since it's not actually another entry it just throws because the checksum is invalid. We should be able to handle this a bit more gracefully though. The amount of bytes is correct for @msvprogs file (1,436,140 blocks á 512 byte = 735,303,680 byte, 1 block per file and one ending padding block), so it's not the length itself, but rather that the padding block isn't just |
Thanks very much, I've created the issue #514 |
I did some experiments with this, but was not able to reproduce it (using OVAs created by VirtualBox). So the app creating those OVA files is probably something else. Whatever it is, I think it's not writing the end block(s), perhaps just leaving the original data in those blocks? @msvprogs What software produced those files? |
@piksel I believe I have a minimal reproduction of this issue. For me it is not happening with a regular ".tar" file but with a ".tar.lz4". I am attempting to use the K4os.Compression.LZ4 library to inflate the file in stream and then SharpZipLib to unzip the tar. Code for this can be found here: https://gist.github.com/RLashofRegas/f572b7fc0a5a1b1a11cddc33be0ab2ae I cannot attach the file here because GitHub does not support uploading lz4, however it is simple to create it. The tar consists of 4 text files (test1.txt, test2.txt, etc) each one is simply 11,468,800 bytes of the letter "a" all in a directory called "TestFiles". I tarred and lz4'd the directory using this port of 7-zip that supports lz4: https://github.com/mcmilk/7-Zip-zstd Code throws "Header checksum is invalid" exception on call to GetNextEntry() after getting through the first two entries in the tar. 7-zip can deflate and extract it just fine. It may be important to note that if I first inflate it with lz4 and save the tar to an intermediate file it works to extract that tar. If you think this is a separate issue happy to open one. |
Then try to diff the If it only happens when streaming from a 3rd-party library, I doubt the problem is inside |
Thanks I think I determined the issue is not a SharpZipLib issue. Seems like the lz4 file created from 7-zip differs from that created using the K4os library. Still not sure why... |
I came upon this thread while searching for a solution to the same exception (Header checksum illegal) that I am getting. I am attaching a zip file where, after reading it into a byte array (it is actually stored in a DB table in my application), on the first iteration of the code below, I get the exception on the call to Read(). Any help would be greatly appreciated. As you can see, the file opens fine using zip (I use 7-Zip)
|
@lweisberg The issue is a about |
Steps to reproduce
Expected behavior
File should extract without errors.
Actual behavior
"Header checksum is invalid" error is thrown.
Version of SharpZipLib
0.86.0
Obtained from (place an x between the brackets for all that apply)
The text was updated successfully, but these errors were encountered: