Just ran into this same issue on Ubuntu 20.04.2, latest July 30th Steam Client beta, with Omno and even the latest Proton Experimental, similar lines in content_log.txt for both apps.
[2021-08-02 18:23:32] AppID 1686450 update changed : Running,
[2021-08-02 18:23:32] AppID 1686450 update started : download 1274989264/1884205488, store 0/0, reuse 0/0, delta 0/0, stage 2881567184/4242800593
[2021-08-02 18:23:32] AppID 1686450 update changed : Running,Downloading,Staging,
[2021-08-02 18:23:32] Downloading 7257 chunks from depot 1686451
[2021-08-02 18:24:16] HTTP (CDN,11) - steampipe.akamaized.net (23.63.246.145:443 / 23.63.246.145:443, host: steampipe.akamaized.net): Received 504 (G
ateway Time-out) HTTP response for depot 1686451
[2021-08-02 18:24:16] HTTP (CDN,11) - steampipe.akamaized.net (23.63.246.145:443 / 23.63.246.145:443, host: steampipe.akamaized.net): Closing connect
ion
[2021-08-02 18:24:16] Got 2 download sources and 0 caching proxies via ContentServerDirectoryService::BYieldingGetServersForSteamPipe (CellID 25 / La
uncher 0)
[2021-08-02 18:24:16] Created download interface of type 'SteamCache' (7) to host cache6-gru1.steamcontent.com (cache6-gru1.steamcontent.com)
[2021-08-02 18:24:16] Created download interface of type 'CDN' (2) to host f3b7q2p3.ssl.hwcdn.net (f3b7q2p3.ssl.hwcdn.net)
[2021-08-02 18:24:17] HTTP (CDN,4) - f3b7q2p3.ssl.hwcdn.net (0.0.0.0:0 / 0.0.0.0:0, host: f3b7q2p3.ssl.hwcdn.net): AuthenticateDepotID (1686451) - Su
ccess!
[2021-08-02 18:24:29] Current download rate: 9.121 Mbps
[2021-08-02 18:24:43] CGenericAsyncFileIOThread::AllocateResource() failed for CFileWriter: errno: 24, File: /home/pedrohlc/.local/share/Steam/steama
pps/downloading/1686450/NanosWorld/Content/NanosWorld/Thumbnails/SM_Shoes.jpg
[2021-08-02 18:24:43] CGenericAsyncFileIOThread::AllocateResource() failed for CFileWriter: errno: 24, File: /home/pedrohlc/.local/share/Steam/steama
pps/downloading/1686450/NanosWorld/Content/NanosWorld/Thumbnails/SM_Toolbox_06.jpg
[2021-08-02 18:24:43] CGenericAsyncFileIOThread::AllocateResource() failed for CFileWriter: errno: 24, File: /home/pedrohlc/.local/share/Steam/steama
pps/downloading/1686450/NanosWorld/Content/NanosWorld/Thumbnails/SM_Torch.jpg
[2021-08-02 18:24:44] Failed to write chunk in file "NanosWorld\Content\NanosWorld\Thumbnails\SM_Shoes.jpg", 9439 bytes at offset 0 (File Not Found)
[2021-08-02 18:24:44] AppID 1686450 update canceled : Failed updating depot 1686451 while writing chunk, offset 0 (File Not Found) (Disk write failur
e) "/home/pedrohlc/.local/share/Steam/steamapps/downloading/1686450/NanosWorld/Content/NanosWorld/Thumbnails/SM_Shoes.jpg"
[2021-08-02 18:24:44] AppID 1686450 update changed : Running,Downloading,Staging,Stopping,
[2021-08-02 18:24:44] AppID 1686450 update changed : Running,Stopping,
[2021-08-02 18:24:44] AppID 1686450 update changed : None
[2021-08-02 18:24:44] AppID 1686450 state changed : Update Required,Update Queued,Update Started, (Disk write failure)
[2021-08-02 18:24:44] AppID 1686450 state changed : Update Required,Update Paused,Update Started,
[2021-08-02 18:24:44] AppID 1686450 scheduler finished : removed from schedule (result Disk write failure, state 0x602)
If you keep retrying it eventually finishes... Validating the files after it shows no files to redownload.
It spawns like 100 fds per sec in /proc/$pid/fd/...
If you keep retrying it eventually finishes...
I found this is also true in my case, also I guess I should also mention that my filesystem is also ZFS, in case this is somehow a component.
I don't think the specific filesystem is significant here (it's certainly not ZFS-specific, the system for which I reported this is using btrfs for the Steam library). errno 24 is EMFILE, which is to do with a resource limit that's enforced generically across all filesystems.
The Aug 2nd beta update brought the open files count during download back down. This problem may be less prevalent now. It's possible we are leaking fds though so we'll keep an eye on it. Bumping up the open file limit as @smcv describes will be a good thing to do either way.
@TTimo the Aug 2nd beta probably helps but doesn't seem to be enough. I just tried to download a 160MB update for Wreckfest (228380) and it failed after just 1.6 MB with the content_log.txt filled with hundreds of CGenericAsyncFileIOThread::AllocateResource() failed for CFileWriter: errno: 24.
I'm no longer able to reproduce it with built Aug 2, 2021, 23:01. But I can see it opened 1600+ file descriptors.
@TTimo the Aug 2nd beta probably helps but doesn't seem to be enough. I just tried to download a 160MB update for Wreckfest (228380) and it failed after just 1.6 MB with the
content_log.txtfilled with hundreds ofCGenericAsyncFileIOThread::AllocateResource() failed for CFileWriter: errno: 24.
Yep I had the exact same issue with the Wreckfest update. Spamming retry make it install eventually. I am running the Aug 2 2021 Beta Client.
This was supposedly fixed the August 3rd update: https://steamcommunity.com/groups/SteamClientBeta/announcements/detail/2974050185364403546
The August 3rd update seems to have resolved this. I uninstalled Civ VI and was able to re-download it on the first attempt.
With the August 3rd update I notice that the soft limit for game subprocesses is higher than 1024 (slightly more than 2000, varying). This is likely to make some games crash (particularly if they're using select()) or run slowly. I'd recommend resetting the soft limit to be <= 1024 when executing any subprocess.
proton experimentalx1 2021-07proton 6.3x1 2021-07
Your system information
Please describe your issue in as much detail as possible:
Downloading Civ VI gets paused after a while with "Disk write error". Looking at
~/.steam/root/logs/content_log.txtI see this:errno 24 is
EMFILE, "Too many open files", which meansRLIMIT_NOFILEis being reached, i.e. Steam is trying to open a very large number of file descriptors. Looking in/proc/$pid/fd/for the main Steam process, I can see that there are about 1000 fds just before it fails.By default, Debian sets most user processes to have a
RLIMIT_NOFILEsoft limit of 1024, and a hard limit of 1024*1024. This is the same as the recommendation in Proton's Wine esync branch, and similar to systemd recommendations (systemd actually defaults to a hard limit of 512*1024, but the exact number doesn't really matter).The main reason why the soft limit is only 1024 is that programs that use
select(2)will fail horribly under anyRLIMIT_NOFILEhigher than that. A few other programs, notably Java interpreters, also cope badly with high numbers.There are two ways that Steam can avoid this bug:
EMFILEis reached, or at the very latest, whenEMFILEis reached. A few hundred files open is probably plenty - if Steam is downloading a lot of files in parallel, there are going to be diminishing returns.-and/or-
RLIMIT_NOFILEfor Steam, but not its subprocessespoll()or epoll, and neverselect()RLIMIT_NOFILEback down to 1024 when launching any subprocess whose code is not entirely under Valve's control, in particular games and diagnostic toolsSteps for reproducing this issue:
RLIMIT_NOFILE: soft limit 1024, hard limit 1024*1024 (other distributions that use soft limit 1024 and hard limit 512*1024 would probably also trigger this, it's the soft limit of 1024 that matters)