You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

unzip error 22: invalid argument

Upgraded to MacOS Catalina and now I cannot unzip any zipped file. I had no problems before. Also, moving the file or redownloading is not fixing it. Multiple files of different sizes failed. MacBook user here.

MacBook

Posted on Oct 13, 2019 10:08 PM

Reply
Question marked as Top-ranking reply

Posted on Feb 10, 2020 10:56 PM

Working solution: The Unarchiver is a free Zip/Unzip program for Mac which handles these files perfect in Catalina, it solved this issue for me. Good luck.


https://apps.apple.com/se/app/the-unarchiver/id425424353?mt=12

77 replies

Oct 15, 2019 9:35 AM in response to galking

galking wrote:

After testing, I found that it was under windows, and the file contained the Chinese, this problem occurred when unzip. I unzipped it with catalina own zip tool.


Not sure what that sequence is, but guessing there’s an encoding problem with the Catalina GUI tools that are providing unzip support on Catalina, and you’ll want to log some feedback with Apple with as much detail on the character encoding and the rest of a reproducer as can be available.

Oct 24, 2019 7:45 AM in response to btihen

There are various schemes for Extended ASCII and character sets with eight or more bits lit and that aren’t UTF-8 or UTF-16 and Unicode, and that’s all an increasingly dead-end for portability, outside of maybe existing ISO Latin 1 ISO 8859-1 use. Microsoft Windows had (has?) its own extensions to ISO Latin 1.


Seems the GUI unzip tool has a problem (“limitation”?) with the character encoding in the filename.


Or the archive-generating tool (whatever tool and version that is, here) isn’t tagging the encoding correctly.


Package up the details and a reproducer and a link to this thread and lob some feedback at Apple, or call Apple Support with the details, or log a bug directly if you should have developer access to the bug reporter.

Nov 7, 2019 2:24 PM in response to perharstrom

Definitely looks to be a known mess.

The archive appears technically corrupt as created, whether something has tightened in Catalina or not.

And it does appear that something has tightened.

An older macOS version booted as a guest or booted on an external device would be another workaround.

Based on another report of this problem, it seems ditto and unarchiver might be other potential workarounds.

The local High Sierra testing system is HFS+ and not APFS, which is probably why I'm not seeing this.

Which implies an external HFS+ disk might be another workaround, albeit with bad characters.

Nov 8, 2019 6:21 AM in response to RandolSchoenberg

Good that it’s working, then...


Just noticed there were two different reporters in this thread, too. No wonder it was getting a little confusing to me.


Even though y’all seem to have your unzipping of these zips with non-ASCII filenames now either working or with work-arounds, y’all might want to log some feedback with Apple around the crashes.

Nov 23, 2019 5:43 AM in response to heiko1960

heiko1960 wrote:

what´s going on here? I have the same problem.
I cannot unzip any zipped file.


Did you read the whole thread through, or do you want folks here to go back through the whole thread with you too, asking and answering the same questions for a third time?


If this is the third report of the same issue—and not something new and different—then some Windows zip tools are producing a questionable or bad zip archive file. This zip archive containing invalid character encoding for the filenames. Encountering one of these zip files is causing the (rewritten?) Mac unzip tool to crash. Pending a fix for this unzip from the zip provider and/or from Apple—log feedback, reference this thread—launch Terminal.app and use ditto from the command line. Links to the ditto command are included in a previous reply of mine here.


If this is a different or unrelated unzip crash, then we’ll need more details. Tools used, versions, platforms, commands used, that sort of thing. Starting a new thread is probably a good idea, too. Maybe also referencing this thread and that the zip filename encoding as what the problem isn’t, if ditto and such doesn’t work with your particular zip archive file.

Jan 20, 2020 9:53 AM in response to Mackytack

Okay, so you’ve somehow gotten zipped files? You’re not creating and transferring these around intentionally? If so, that’s something else. Quite possibly completely different than this whole preceding discussion.



As for the previous questions—and the following answers may not even be relevant here, given this apparently isn’t the intentional transfer of zip archives around among various computers—then you’re probably headed for somebody that can provide you with some custom scripts or tools to deal with whatever sequence and transfers you’re working with here. Otherwise, you’re going to be learning more about the command line and related scripting.


Apple has some dated command line primer documentation available, but little new documentation covering the shell they’re now using. Exactly none of which is likely appropriate for your situation and requirements here.


So... how are these zips appearing, and from where?



Feb 21, 2020 12:04 PM in response to macalienz

macalienz wrote:

Same issue. I can't unzip many folders since I installed Catalina (iMac retina 4K, 21,5 inch, 2017 - MacOs Catalina 10.15.3). I can open the same folders with my old iMac (20 inch, late 2007 - MacOs El Capitan 10.11.6!).

Please see the earlier discussions for the variations, and for the work-arounds.


Log some feedback for Apple too as those reporte seem to work rather like votes, rather than adding the me-toos here and which may or may not get noticed by Apple.

Jan 20, 2020 10:57 AM in response to MrHoffman

Ok so maybe I should start over. I updated my MacBook to Catalina. My microsoft word no longer works, and I am looking to upgrade. (this doesn't matter, but I thought i'd fill you in) I opened up a folder to print something for my class, and saw my files were zipped. (the example I sent you shows that some are, and some are not). When I clicked to open, the automatic zip app created another doc, but cannot be opened. Now I have installed The Unarchiver and tried that, but it seems my documents duplicate themselves, though can still not be opened. They don't look zipped, but they still don't open. The duplicate folders show all kinds of stuff I don't understand, but I still can't retrieve any of the documents themselves.


Mar 16, 2020 6:39 PM in response to MrHoffman

I have a whole bunch of Karaoke songs in .zip format. The author of the Karaoke program (kJams) is still working at converting his program to 64-bit. Until then, I boot up to a SSD with Mojave to run his program.


I recently discovered that if I click on one of those files I get the following error:


I booted to Mojave and clicked on the file with Finder and it unzipped correctly.

I tried several other .zipped songs in both Mojave and Catalina and get consistent results.


Oct 15, 2019 8:47 AM in response to galking

It’s either a corrupt zip archive, or your installed zip is old, or whatever is pretending to be zip is buggy.

Use zip -v and unzip -v and see if it’s older than InfoZip zip 3.0 and unzip 6.0.

If older, upgrade using homebrew or otherwise.

And if it’s not InfoZip zip and unzip you’re finding, homebrew yourself copies of InfoZip zip and unzip, and check again.

Oct 21, 2019 2:04 AM in response to galking

It is NOT just Chinese Characters. All zipped files within the zip that have either extended ASCII letters or UTF in the filenames will not expand - at least if one uses the cli to unzip -- then the filenames with only ASCII in the names DO expand and are usable.


I have used the apple feedback link listed below.

Oct 23, 2019 9:13 AM in response to Chemostat

I just spoke to support. I was told this is happening because Catalina no longer reads 32 bit and if the file was compressed on a Microsoft computer a Mac running Catalina will not be able to read it. I was not given any fix for this, I guess they just assume the 32 bit will be phased out. I was told to try 7zip as a workaround, about to try that.

Oct 23, 2019 10:03 AM in response to saul613

32-bit apps and 32-bit archives are entirely different topics.


zip archives are transportable across a wide variety of platforms, and zip and unzip was 32-bit until zip 3 / unzip 6. (I’m still playing Whac-A-Mole with some folks running older versions, too.)


If the “real” unzip tool is hitting this crash, then there’s a bug or incompatibility in whatever tool compressed the file, or there’s a bug or limit in unzip, or a hole in the zip archive design. And it’ll still be necessary to read the older 32-bit zip archives for the foreseeable future, too.


Do you have an example zip archive file you can post somewhere? Folks here can take a look, and maybe this then gets identified and maybe then involves the Info-Zip folks? Also details on what OS and tool and command was used to generate it?


Based solely on what’s been posted, I’m wondering if there’s a filename-encoding incompatibility somewhere. Which would be entirely unrelated to 32-bit apps.

unzip error 22: invalid argument

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.