Unable to Update Cities:Skylines in macOS Catalina
Sherlock Holmes and the mystery of the "Too many open files" or Why does Steam Client fails with Disk Write Error on macOS Catalina
Last updated
Was this helpful?
Sherlock Holmes and the mystery of the "Too many open files" or Why does Steam Client fails with Disk Write Error on macOS Catalina
Last updated
Was this helpful?
This is something which caused me some pain, especially as Steam Support can only post links to their FAQ as it seems.
But after trying my best Sherlock Holmes impression I got it solved.
Installing Cities:Skyline went fine and I could even start it, but it kept complaining about an update it wanted to do and a Disk Write Error.
I looked around the internet and tried Steam Support, which weren't helpful at all as they kept on quoting their troubleshooting FAQ and insisted it must be a hardware issue or something which could only be solved by a technician on my part.
Well of course there was an issue on my side, but other games installed fine. I even tried another new drive, I tried it on the boot device and I did any other thing I could think off.
But it looks like troubleshooting their product ends at supplying links to a FAQ if you use steam support instead of really solving the issue, and the problem is partly their issue.
So I started hunting for more information. A disk write error can be caused by a lot of things especially if it is so un-descriptive.
I checked if the virus scan was the culprit or if perhaps the source (not existing files) was the issue.. nope.
I figured out that 255710 is the ID code for Cities:Skylines and I also figured out that 851382354 is an asset from the workshop.
I deleted the cache etc and found now another file having issues, from asset 856897755, I asked the developer if he perhaps uses strange symbols and the declined. I even unpacked the CRP file to take a look on my side if there is an issue. Nothing.
So I went the route to figure out if there was really an issue of the filesystem.
In macOS you can see which processes are accessing the filesystem with opensnoop.
Will print out any errors caused by a program while accessing files.
So I let this run and tried updating again.
-1 is an error and 24 is the description of that error. Let's take a look at it:
Well, that is a lot more information just like Disk Write Error isn't it?
So should I talk to steam support now and let them fix their program?
Well, I will give them a link to this webpage because I doubt it will be handled correctly.
And I will also put a link in all of the threads I started so other people can solve the mystery.
Now the next search started, after figuring out that steam opens to many files during it's update process, how can you fix the issue.
BTW: I have LOT's of assets included in Cities:Skylines so I guess this is not a common issue.
So let's take a look into those open file limits first.
That is the maximum files allowed (I think at least)
The files per process, but there is more.
and there is
None of this maps in any way to the 2048 which would be the next successful file descriptor which opensnoop would return. BUT... that maxfiles 256 is still the culprit.
Hunting through the internet provides lot's of information on how to get rid of the "Too Many Files Open" issue.
One very good read and also useful is the answer on apple.stackexchange.com
That information comes in handy when you take a look at the solution, but there is more.
Should I really fiddle around with a nice and working Hackintosh (or macOS) because of a game? What can happen in a worst case scenario? A lot....
So let's gather all the material from the crime scene and retreat back into the lab.
So I created a macOS VM (which I wanted to do for testing nevertheless) in VMware Fusion and did take a closer look.
Well....
The VM only has 2 CPU kernels and 50 GB of harddrive space. So the values I showed you above might vary but the maxfiles is still 256
So in the stackexchange article above we learned that we have a softlimit (256) and a hardlimit (unlimited) of maxfiles.
How do we change the value of 256 to a value which works? And will this fix the issue?
It will
So, let's install steam and then City:Skylines.
Result:
Same issue, Disk Write Error when the Update is triggered. And again a "Too Many Open Files"
So we confirmed our suspicion:
It has nothing to do with the system being a hackintosh, the hardware or the phase of the moon. And neither is the butler the murder.
Figuring out how to change that maximum open files in macOS Catalina is again not that easy, most of the information available is for linux or older versions of macOS.
But truth behold there is something out there.
So let's try out the comment to run it in Catalina (which is really just the steps on how to get this load.sh created).
After that we restart the VM and take a look again at the values.
Also there is the issue with:
But is that an issue?
Looks like it could be if you read this answer.
So, because the issue is with the maximum open files I guess we should take a different approach.
Also what about the hardlimit of open files, it is not unlimited anymore? Remember the link I posted above? Does setting the hardlimit to 2147483647 solve our issue there?
Oh well, and what about the side effects? What does our doctor tell us?
I tried running lsof in the vm but it didn't cause the issues described. But are we sure about the behaviour in the long run?
So perhaps we could make this work temporarily? Would this work without changing maxproc ?
So let's see if the assumptions will hold up.
Running the following command in shell
will give you
Close steam, start steam, go do download, start update of Cities:Skylines.
Update is working! At least if you have more than 40GB of harddrive space in total 😀
A reboot will clear this value.
But now an other issue creeps up. Paradox Launcher will complain to not have access to the game directory.
Is that important? Don't know because afterwards it was fine.
Started Cities: Skylines which came up with another error.
Is that important?
And how will the Paradox Launcher behave when I use
Same behaviour for the Paradox Launcher and Cities:Skylines.
So it looks like those errors are not based on the maxfiles value.
Final Verdict isn't in yet.
There are two options:
1) keeping it temporary, so running the launchctl limit line every time I get the Disk Write Error again
2) Using the approach from the gist to keep those settings permanently configured.
I have edited the original gist mentioned above to only change the values for maxfiles, you can find the gist here.
But I still haven't decided which option to use.