Invalid Rar Header: 131. Sharpcompress file extract issue #379

Closed
opened 2026-01-29 22:10:58 +00:00 by claunia · 7 comments
Owner

Originally created by @Raja2984 on GitHub (Oct 9, 2019).

Unable to extract certain .rar files. Getting error message "Invalid Rar Header: 131" But i could extract few files with same code. Unable to extract files compressed using WinRAR 5.61 (64 bit)

Originally created by @Raja2984 on GitHub (Oct 9, 2019). Unable to extract certain .rar files. Getting error message "Invalid Rar Header: 131" But i could extract few files with same code. Unable to extract files compressed using WinRAR 5.61 (64 bit)
Author
Owner

@adamhathcock commented on GitHub (Oct 9, 2019):

If WinRAR won’t do it then it’s likely corrupt somehow. Not all entries are corrupt it seems which is why some things can be extracted.

@adamhathcock commented on GitHub (Oct 9, 2019): If WinRAR won’t do it then it’s likely corrupt somehow. Not all entries are corrupt it seems which is why some things can be extracted.
Author
Owner

@Raja2984 commented on GitHub (Oct 9, 2019):

Thank you for your quick turnaround. To be explain the issue in more detail, we used to receive .rar file on daily basis from our client. Unrar (through Sharpcompress dll) used to work for files till 18 Jul 2019, and suddenly throwing invalid Rar header from the file 19 Jul 2019. And we are unable to decompress any of the future files after 19th Jul 2019 using Sharecompress dll. When we checked with our client, they said, now they are compressing the files to .rar using WinRAR 5.61 (64 bit). But not sure, whether it is manual or automatic compression.

One more point to note, If i try to decompress manually using winrar, it is throwing error as unknown format. But when i use 7-zip to extract manually, i could successfully extract the content and view it. Kindly assist me how can i do programmatically, thanks in advance.

@Raja2984 commented on GitHub (Oct 9, 2019): Thank you for your quick turnaround. To be explain the issue in more detail, we used to receive .rar file on daily basis from our client. Unrar (through Sharpcompress dll) used to work for files till 18 Jul 2019, and suddenly throwing invalid Rar header from the file 19 Jul 2019. And we are unable to decompress any of the future files after 19th Jul 2019 using Sharecompress dll. When we checked with our client, they said, now they are compressing the files to .rar using WinRAR 5.61 (64 bit). But not sure, whether it is manual or automatic compression. One more point to note, If i try to decompress manually using winrar, it is throwing error as unknown format. But when i use 7-zip to extract manually, i could successfully extract the content and view it. Kindly assist me how can i do programmatically, thanks in advance.
Author
Owner

@adamhathcock commented on GitHub (Oct 9, 2019):

I guess I’d need more detail on what changed for them that day. Like RAR version from what to what.

If WinRAR itself can’t decompress, I’m not sure what I can do. 7Zip will extract everything?

I recommend moving to another format regardless. You shouldn’t be relying on a proprietary format. Look at LZip with Tar or just zip or tar.gz

@adamhathcock commented on GitHub (Oct 9, 2019): I guess I’d need more detail on what changed for them that day. Like RAR version from what to what. If WinRAR itself can’t decompress, I’m not sure what I can do. 7Zip will extract everything? I recommend moving to another format regardless. You shouldn’t be relying on a proprietary format. Look at LZip with Tar or just zip or tar.gz
Author
Owner

@Raja2984 commented on GitHub (Oct 9, 2019):

Yes, 7zip is extracting everything without corrupting them. The reason behind WinRAR is not extracting the content in my system is, I am having much older Licensed version (3.90). I am getting more information from them, what have they changed from that particular day. In the meantime, is there any work around i can try? You mean, i shouldn't rely on the format they provide, and should try something else? Kindly help, thanks.

@Raja2984 commented on GitHub (Oct 9, 2019): Yes, 7zip is extracting everything without corrupting them. The reason behind WinRAR is not extracting the content in my system is, I am having much older Licensed version (3.90). I am getting more information from them, what have they changed from that particular day. In the meantime, is there any work around i can try? You mean, i shouldn't rely on the format they provide, and should try something else? Kindly help, thanks.
Author
Owner

@adamhathcock commented on GitHub (Oct 9, 2019):

If you’re using WinRAR 3.90 then they’re probably using the new RAR5 format in WinRAR 5.

I would like to know why 7Zip works and SharpCompress doesn’t but I won’t be able to know anything without the file. Try upgrading WinRAR and try it and make sure SharpCompress is updated too.

They should just send you different format. Zip is just the easiest and well known.

@adamhathcock commented on GitHub (Oct 9, 2019): If you’re using WinRAR 3.90 then they’re probably using the new RAR5 format in WinRAR 5. I would like to know why 7Zip works and SharpCompress doesn’t but I won’t be able to know anything without the file. Try upgrading WinRAR and try it and make sure SharpCompress is updated too. They should just send you different format. Zip is just the easiest and well known.
Author
Owner

@Raja2984 commented on GitHub (Oct 9, 2019):

Ok thanks a lot. I will do like above. I have downloaded SharpCompress 0.24.0 now. Is that fine, or any more latest has come. Will try using the latest version, and let you know how it goes. Thank again, have a good day!!

@Raja2984 commented on GitHub (Oct 9, 2019): Ok thanks a lot. I will do like above. I have downloaded SharpCompress 0.24.0 now. Is that fine, or any more latest has come. Will try using the latest version, and let you know how it goes. Thank again, have a good day!!
Author
Owner

@tahir-ozdilek commented on GitHub (Jan 9, 2023):

I am having the similar problem (SharpCompress.Common.InvalidFormatException: 'Unknown Rar Header: 43') with latest version of sharpcompress. It works fine with rar4, but gives error with rar5.

@tahir-ozdilek commented on GitHub (Jan 9, 2023): I am having the similar problem (SharpCompress.Common.InvalidFormatException: 'Unknown Rar Header: 43') with latest version of sharpcompress. It works fine with rar4, but gives error with rar5.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#379