minigalaxy icon indicating copy to clipboard operation
minigalaxy copied to clipboard

Download error: Not enough disk space to install game

Open Zlopez opened this issue 3 years ago • 16 comments

I have this error when I'm trying to download Witcher III GOTY. It stays in in queue state for some time and then throws this error.

I checked the disk and I have around 760 GB of free space and didn't saw this issue with any other game.

I'm using the flatpak version of Minigalaxy.

Zlopez avatar Jan 19 '22 19:01 Zlopez

See https://github.com/sharkwouter/minigalaxy/issues/424

minigalaxy downloads games into ~/.cache and if the drive where that folder lies is full, it fails

cactushydrocodone avatar Jan 22 '22 19:01 cactushydrocodone

I looked at #424 and I don't think this is the same issue, I only have one disk and I'm not aware of any limit for any folder. Thus I don't understand why there would be issue when using default cache location.

Zlopez avatar Jan 22 '22 20:01 Zlopez

Could you post the output of df -h?

sharkwouter avatar Jan 23 '22 12:01 sharkwouter

@sharkwouter Here it is

Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        4,0M     0  4,0M   0% /dev
tmpfs            32G  134M   32G   1% /dev/shm
tmpfs            13G  9,9M   13G   1% /run
/dev/nvme0n1p3  1,9T  1,1T  741G  61% /sysroot
tmpfs            32G  232K   32G   1% /tmp
/dev/nvme0n1p3  1,9T  1,1T  741G  61% /var/home
/dev/nvme0n1p2  976M  153M  757M  17% /boot
/dev/nvme0n1p1  599M  8,6M  591M   2% /boot/efi
tmpfs           6,3G     0  6,3G   0% /run/user/978
tmpfs           6,3G   66M  6,3G   2% /run/user/1000

Zlopez avatar Jan 23 '22 18:01 Zlopez

same on SteamDeck happens

isopix avatar Mar 27 '22 09:03 isopix

I'm getting the same error, even though I have plenty of available space. Running minigalaxy 1.1.0, flatpak installation. If the underlying mechanism is unreliable (and outside minigalaxy's control) could this check be made an optional?

Is there any workaround in the meantime?

$ df -h
Filesystem                 Size  Used Avail Use% Mounted on
udev                       7.6G     0  7.6G   0% /dev
tmpfs                      1.6G  3.1M  1.6G   1% /run
/dev/mapper/vgubuntu-root  467G  189G  255G  43% /
tmpfs                      7.6G  4.6M  7.6G   1% /dev/shm
tmpfs                      5.0M  4.0K  5.0M   1% /run/lock
tmpfs                      7.6G     0  7.6G   0% /sys/fs/cgroup
/dev/nvme0n1p2             705M  255M  399M  39% /boot
/dev/nvme0n1p1             511M   13M  499M   3% /boot/efi
tmpfs                      1.6G  3.3M  1.6G   1% /run/user/1000
tmpfs                      1.0M     0  1.0M   0% /var/snap/lxd/common/ns
/dev/loop0                 939M  939M     0 100% /snap/android-studio/118
/dev/loop2                  83M   83M     0 100% /snap/beekeeper-studio/146
...

lofidevops avatar Apr 03 '22 12:04 lofidevops

FWIW I can't find any references to minigalaxy in $HOME/.cache

I can find various contents in $HOME/.var/app/io.github.sharkwouter.Minigalaxy/cache but nothing in $HOME/.var/app/io.github.sharkwouter.Minigalaxy/cache/minigalaxy/download

I don't believe any of these folders are mounted in an unusual way. (Happy to verify given instructions.)

lofidevops avatar Apr 03 '22 12:04 lofidevops

I'm running into a similar error, and one of my guesses (and it really is a guess, I don't know much about the inner workings of Flatpak) is that the Flatpak may be be using a folder that tends to be mounted as a tmpfs to download games into before running the installer (possibly /run?). I've tried the workaround in #424 and it didn't work, I kept getting the same error. For what it's worth, I'm on a relatively fresh install of Fedora Silverblue 36. Here's my df -h:

Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        4.0M     0  4.0M   0% /dev
tmpfs           7.8G     0  7.8G   0% /dev/shm
tmpfs           3.2G   10M  3.2G   1% /run
/dev/dm-0       488G   89G  396G  19% /sysroot
tmpfs           7.8G  3.8M  7.8G   1% /tmp
/dev/dm-0       488G   89G  396G  19% /var
/dev/sdb2       974M   82M  825M  10% /boot
/dev/dm-0       488G   89G  396G  19% /var/home
/dev/sda1       938G  750G  142G  85% /var/mnt/Sandisk
/dev/sdb1       599M  9.8M  590M   2% /boot/efi
tmpfs           1.6G  420K  1.6G   1% /run/user/1000
/dev/sdc1       1.9T  1.5T  379G  80% /run/media/miracleorange/WD My Passport

I'm gonna put this in the Flatpak repo too, just for some added visibility because this does seem to be an issue specifically with the Flatpak.

crebwyllion avatar May 27 '22 02:05 crebwyllion

Additionally, I found a workaround! If you set "Keep installers" in the preferences, download the installer from the website (I'm assuming games above half your RAM? Mine is 16, which means Stellaris at 9GB would be too big), put it in a folder with the name Minigalaxy uses for that game, and put that folder in the "installer" folder in your game installation folder (for my example, default would be ~/GOG Games/installer/Stellaris/stellaris_3_4_3_55929.sh). You should be able to install the game without having to download it through Minigalaxy.

crebwyllion avatar May 27 '22 20:05 crebwyllion

Thanks for the report guys. I will be looking into this. Are all of you using Flatpak?

I'm running into a similar error, and one of my guesses (and it really is a guess, I don't know much about the inner workings of Flatpak) is that the Flatpak may be be using a folder that tends to be mounted as a tmpfs to download games into before running the installer (possibly /run?).

That is an interesting theory. It could probably be tested by using the --command option with the flatpak run command to either do some tests with python or to run df -h from the flatpak.

sharkwouter avatar May 30 '22 09:05 sharkwouter

Yes, it seems all of us are using flatpak.

I ran df -h from the flatpak environment and here's my output (FYI, /var/mnt/Sandisk/gog is my installation directory):

df: /run/flatpak/doc: Operation not permitted
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           7.8G  140K  7.8G   1% /etc/timezone
/dev/dm-0       488G   81G  404G  17% /usr
tmpfs           7.8G     0  7.8G   0% /app/dlls
tmpfs           7.8G     0  7.8G   0% /app/lib/i386-linux-gnu/GL
tmpfs           7.8G     0  7.8G   0% /usr/lib/extensions/vulkan
tmpfs           7.8G     0  7.8G   0% /usr/lib/x86_64-linux-gnu/GL
tmpfs           7.8G     0  7.8G   0% /usr/share/runtime/share/themes
/dev/dm-0       488G   81G  404G  17% /etc/machine-id
/dev/dm-0       488G   81G  404G  17% /var/data
tmpfs           1.6G  332K  1.6G   1% /run/host/monitor
devtmpfs        4.0M     0  4.0M   0% /dev
tmpfs           7.8G     0  7.8G   0% /dev/shm
tmpfs           7.8G     0  7.8G   0% /var/home/miracleorange/.local/share/flatpak
/dev/sda1       938G  757G  134G  86% /var/mnt/Sandisk/gog
tmpfs           7.8G     0  7.8G   0% /tmp/.X11-unix
tmpfs           7.8G   16K  7.8G   1% /tmp/.X11-unix/X99
tmpfs           3.2G   10M  3.2G   1% /run/systemd/journal/socket

So it looks like a lot of stuff is mounted as an 8GB tmpfs (which I think makes sense considering I have 16GB RAM). I'm not sure where the installers are downloading to, maybe somewhere in ~/.local/share/flatpak, but it seems my theory is seeming a little more plausible?

EDIT: Also, just as a note, I'm not very experienced with programming, so I'm not sure I could be very helpful as far as running Python tests.

crebwyllion avatar May 30 '22 20:05 crebwyllion

@crebwyllion thanks for the df output. I think this confirms your hypothesis. This might take some effort to fix unfortunately. Is there are easy way to detect Flatpak in python?

sharkwouter avatar May 31 '22 10:05 sharkwouter

I think this should be solved on the flatpak side rather than detecting if the minigalaxy is running inside flatpak. It should be easy to do it, just adding the write permissions to whenever the minigalaxy is downloading the installers.

Zlopez avatar May 31 '22 11:05 Zlopez

Or use standard XDG Download directory for it.

Zlopez avatar May 31 '22 11:05 Zlopez

@Zlopez can you check if this still affects version 1.2.1?

sharkwouter avatar Sep 25 '22 22:09 sharkwouter

Without any extensive testing, I'm still having the same issue. As for a solution, I'm not so sure this--

It should be easy to do it, just adding the write permissions to whenever the minigalaxy is downloading the installers.

--is a solution. The tmpfs issue may be something difficult to work around because it's fairly embedded into how Flatpak works as far as I can see; each app seems to only get a set amount of memory to work with, even when file permissions outside the sandbox are allowed. I've tried to do a bit of research (Flatpak does NOT have great documentation), and there's not been much I could see as solving this issue.

The way I see it, while the Windows installers are separated into 4GB parts, the Linux installers tend to be one large file. Instead of downloading 4 or 5 separate 4GB files for Stellaris, for example, I have to download 1 big 16GB file. If there were some way to slice the downloads into parts and rejoin them (which is I think how Steam and most web browsers and stuff do it), that would solve the problem. I don't know how involved that would be, though, because I'm not a programmer, just a nerd trying to help.

EDIT: Just to be clear, this all rests on the assumption that minigalaxy doesn't download files in parts. If it does, apologies for wasting y'all's time. I'm just thinking there has to be something minigalaxy isn't doing that other programs are doing, and this was the only thing I could think of.

~~EDIT 2: This is basically what I'm talking about.~~

EDIT 3: Ignore the last edit, I just looked at download-manager.py and the stream flag is already there. I still think something is happening where memory management of the download is getting weird.

crebwyllion avatar Sep 25 '22 23:09 crebwyllion

This is a bug in minigalaxy. It doesn't check the available space at the installation target, but in the parent directory:

https://github.com/sharkwouter/minigalaxy/blob/07a331dfb1366e07d81c2c1f0d7ea81821412b16/minigalaxy/installer.py#L19

Instead of checking ~/GOG Games it checks ~, which in Flatpak is just a temporary filesystem with little space.

Unrud avatar Jul 27 '23 21:07 Unrud