Steam-Headless / docker-steam-headless

A Headless Steam Docker image supporting NVIDIA GPU and accessible via Web UI
GNU General Public License v2.0
734 stars 80 forks source link

[Bug]: Unable to install games into /mnt/games mounted Docker volume #57

Closed tnielsen2 closed 11 months ago

tnielsen2 commented 12 months ago

Describe the Bug

Problem: The container cannot write to the /mnt/games Docker volume mount, although permissions appear correct.

Upon fresh install of the container using docker-compose, everything works except the /mnt/games folder is not visible in the Steam client.

After following the troubleshooting steps here, I was then able to see the games folder named: "Mounted Games", but unable to read/write to the folder, being met with the following error:

An error occurred while installing <game>: "disk write error"

Steps to Reproduce

  1. sudo docker stop <container>
  2. sudo docker rm <container>
  3. sudo docker rmi <image>
  4. cd /opt/container-data/steam-headless/home
  5. sudo rm -rf ~/.local/share/flatpak
  6. cd /opt/container-services/steam-headless
  7. sudo docker-compose up -d --force-recreate

Expected Behavior

Being able to install games to the volume mount.

Screenshots

image image image image

Relevant Settings

docker-compose relevant mount config:

    # VOLUMES:
    volumes:
      # The location of your home directory.
      - /opt/container-data/steam-headless/home/:/home/default/:rw
      # The location where all games should be installed.
      # This path needs to be set as a library path in Steam after logging in.
      # Otherwise, Steam will store games in the home directory above.
      - /mnt/games/:/mnt/games/:rw
      # Input devices used for mouse and joypad support inside the container.
      - /dev/input/:/dev/input/:ro
      # The Xorg socket. This will be shared with other containers so they can access the X server.
      - /opt/container-data/steam-headless/.X11-unix/:/tmp/.X11-unix/:rw
      # Pulse audio socket. This will be shared with other containers so they can access the audio sink.
      - /opt/container-data/steam-headless/pulse/:/tmp/pulse/:rw
      # Store dind var files in a volume
      - steam-headless-var-lib-docker:/var/lib/docker/:rw
      # Store flatpak var files in a volume
      - steam-headless-var-lib-flatpak:/var/lib/flatpak/:rw

Version

Build: [2023-07-10 08:33:45] [master] [3be80a920e0ca242e71562f959bcad9155fd43cf] [debian]

Platform

Relevant log output

No logs found in docker logs, and I was unable to see/find any logs in the steam app when attempting a game install.
tnielsen2 commented 12 months ago

As a troubleshooting step, I have tried completely removing all folders within the /mnt/games folder, to see what happened. The container recreated the GameLibrary/SteamLibrary folders and also recreated the libraryfolder.vdf file, but the problem still exists.

tnielsen2 commented 12 months ago

After further digging, I was able to find the installer log here within the container: /home/default/.var/app/com.valvesoftware.Steam/.steam/steam/logs/content_log.txt

It showed the following log entry indicating it couldn't write to a missing folder:


[2023-07-10 15:51:21] Client version: 1687386907
[2023-07-10 15:51:21] Loaded Steam library folders configuration: /home/default/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/libraryfolders.vdf
[2023-07-10 15:51:22] Loaded 3 apps from install folder "/home/default/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps\appmanifest_*.acf".
[2023-07-10 15:51:22] Loaded 0 apps from install folder "/mnt/games/GameLibrary/SteamLibrary/steamapps\appmanifest_*.acf".
[2023-07-10 15:51:22] Triggered async write of Steam library folders configuration (2 libraries).
[2023-07-10 15:54:17] Library folder "/mnt/games/GameLibrary/SteamLibrary/steamapps" is not writable (Disk write failure).
[2023-07-10 15:54:17] Failed installing AppID 424840 (Disk write failure)
[2023-07-10 17:54:27] Library folder "/mnt/games/GameLibrary/SteamLibrary/steamapps" is not writable (Disk write failure).
[2023-07-10 17:54:27] Failed installing AppID 424840 (Disk write failure)

By creating the /mnt/games/GameLibrary/SteamLibrary/steamapps folder, I was then able to install to the /mnt/games folder.

sudo mkdir /mnt/games/GameLibrary/SteamLibrary/steamapps
sudo chmod -R 777 /mnt/games
sudo chown -R trent:trent /mnt/games

This is now a writable/usable folder. Can anything be done as part of the installer script to create this directory? If not, I can submit a PR to the instructions for docker-compose and close this issue.

Josh5 commented 12 months ago

If we add that, we need to add it in a way that first checks if steam has been configured. It should only run to create the missing directories if that libraryconfig file is missing (so on the firat run). Otherwise the container will create this directory for everyone all the time even if they dont want it.

tnielsen2 commented 12 months ago

PR submitted to address this. LMK if you have any better idea/way to accomplish this.

Josh5 commented 11 months ago

PR submitted to address this. LMK if you have any better idea/way to accomplish this.

Legend