[tlbuild] tlmgr/install-tl bug: running out of disk space
Johannes Hielscher
jhielscher at posteo.de
Thu Mar 3 17:50:51 CET 2022
(posting this on the tlbuild list, since I found it while following
the call for testing the TL22 pretest, but it likely applies to regular
installations and tlmgr actions as well)
Stupid me has the pleasure to contribute an interesting data point to
the behaviour of tlmgr: I inadvertedly DoSed myself, by trying to
install the pretest (x86_64-linux via the install-tl.tar.gz from a
pretest server) on a too small drive, that ran out of space amidst
installation.
Many many many errors of the kind:
[…]
tar: tex/latex/newtx/uzmnmia.fd: Funktion open fehlgeschlagen: Datei
oder Verzeichnis nicht gefunden
tar: tlpkg/tlpobj/newtx.tlpobj: Funktion open fehlgeschlagen: Auf dem
Gerät ist kein Speicherplatz mehr verfügbar
tar: Beende mit Fehlerstatus aufgrund vorheriger Fehler
TLUtils::untar: tar xf /tmp/MDm7_exK5O/ZvQQvXnUhW/newtx.tar failed (in
/small/disk/2022/texmf-dist)
TLPDB::_install_data: untar failed for
https://ctan.ijs.si/mirror/tlpretest/archive/newtx.tar.xz
TLUtils::install_packages: Failed to install newtx
newtx will be retried later.
[…]
The installer is bravely attempting to install each new package, but it
was not hard to predict that the retries fail miserably too (with “file
not found” errors, since the package files are unavailable).
I don't know which heuristics apply to decide for retrying. Apparently
they are not clever enough to distinguish a failure of TLUtils::untar
due to a full target device, from a shaky internet connection. It is
also debatable which behaviour to expect in the case of running out of
disk space:
* Just abort the installation
* Delete everything (maybe except the installation profile) and
remind the user (BIG FAT RED BLINKING WARNING) to better choose a more
spacious destination next time.
* Attempt a minimal installation of the TL infrastructure, plus a
warning/recommendation to move TL to a larger disk, in case the user
intends to do something actually useful with the installation.
install-tl already has an install size estimation. I feel like it would
be appropriate (if technically feasible) that we check for space left
at the destination *before starting to do anything*. Local safeguards
are necessary per installed package, since it is still possible that
other processes use up the space on that disk. But what I think is the
majority of failure modes (= no other application writing to the disk,
tlmgr is the only baddie) would be covered by this precaution in
advance.
Anyhow. The situation was awkward, I could not stop install-tl from
stubbornly trying its thing. Repeated Ctrl-C does nothing, it just goes
on with unsuccessful tar calls. In the end, it displays:
Installation failed.
Rerunning the installer will try to restart the installation.
Or you can restart by running the installer with:
install-tl --repository https://ctan.ijs.si/mirror/tlpretest --profile
installation.profile [YOUR-EXTRA-ARGS]
./install-tl: Writing log in current directory:
/small/disk/_tmp/install-tl-20220303/install-tl.log
Warning: unable to close filehandle properly: No space left on device,
<STDIN> line 6 during global destruction.
The “Rerunning the installer will try to restart the installation.”
sounds optimistic, given that there apparently isn't even space to
write the installation profile on disk (it's an empty file).
We cannot expect people who are stupid enough to install TL on a too
small drive, to unpack install-tl.tar and run install-tl on a different
drive. Idk if pre-allocating storage space for installation.profile
makes any sense (it definitely doesn't on CoW filesystems); but a
read/file length check of the profile after abort might be in order to
complain in case of bad suspicions.
Best,
Johannes
More information about the tlbuild
mailing list.