Solvedsteam for linux Cannot update games over NFS (locking issue?)

Your system information

  • Steam client version: Sep 26 2018, at 22:21:27
  • Distribution: Debian unstable, kernel 4.16.5
  • Opted into Steam client beta?: Yes
  • Have you checked for system updates?: Yes

Please describe your issue in as much detail as possible:

I started Steam today after not using it for a couple of weeks, only to find that game updates were failing with "disk write error". Poking it with strace revealed this:

5092 openat(AT_FDCWD, ".../.steam/SteamApps/downloading/state_250820_250823.patch", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0777 <unfinished ...>
5092 <... openat resumed> ) = 54
5092 flock(54, LOCK_SH) = -1 EBADF (Bad file descriptor)

Trying to start SteamVR from the title bar gives an error dialog with that file name, so this seems to be a likely culprit.

I made a simple test program which opens a file in write-only mode and tries to acquire a shared lock on it. It works on a local filesystem but fails on NFS. The manpage for flock says that the open mode should not matter, so it seems the actual error is in the Linux kernel. However I've so far been unable to trace the exact location of the check that causes this error. It does seems a bit strange to use a shared lock with a write-only file, and LOCK_EX actually does work over NFS.

52 Answers

✔️Accepted Answer

Sorry, this fell through the cracks. Next Steam client beta (> Dec 20) will have a fix.

Other Answers:

My workaround - because I run Steam on a diskless system and I don't have enough space in my tmpfs.

fakeflock.c:

int flock()
{
    return 0;
}

Compile as a 32-bit lib:

gcc -shared -m32 -o libfakeflock.so fakeflock.c

and then run Steam with LD_PRELOAD=/path/to/libfakelock.so.

Same problem with debian unstable, kernel 4.17.0-3 or 4.18.0-1, with steam stable or beta client.

A possible workaround is moving the downloadings directory in a local filesystem :

cd .steam/steam/steamapps/
mv downloading /var/tmp/
ln -s /var/tmp/downloading

Games are now downloading normally.

Hello, per "Fix for Steam Library on some NFS mounts" in the 2019-01-09 Steam client beta update, please opt into Steam's beta and retest.

Same issue here on Ubuntu 16.04. Workaround of LubosD worked for me.
Command that I used to compile the library is
gcc -shared -o libfakeflock.so fakeflock.c -m32
I had to install gcc-multilib package.

More Issues: