Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve disk space check for sh installers #774

Closed
2 tasks done
marcoesters opened this issue Apr 19, 2024 · 0 comments · Fixed by #889
Closed
2 tasks done

Improve disk space check for sh installers #774

marcoesters opened this issue Apr 19, 2024 · 0 comments · Fixed by #889
Labels
type::feature request for a new feature or capability

Comments

@marcoesters
Copy link
Contributor

Checklist

  • I added a descriptive title
  • I searched open requests and couldn't find a duplicate

What is the idea?

The Anaconda QA team has found a few edge cases for when the sh installer checks for remaining disk space, which all lead to different error messages. See "Additional Context" for these edge cases.

I am not sure if the error message when there isn't enough space for displaying the license can be fixed, but the others can improve by:

  • Not creating a directory before checking the disk space.
  • Creating a more explicit error message, e.g., by adding human-readable sizes.

Why is this needed?

Consistent and clear error messages make it easier for users to understand why the installation failed.

If there is not enough space on disk, the installation should exit cleanly without artifacts.

What should happen?

Ideally, the error messages are consistent and no files should be written before disk space is checked.

Additional Context

If the space is fully consumed already and the user tries to run the installer

root@4b9aad66a111:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay          50G   50G     0 100% /
tmpfs            64M     0   64M   0% /dev
shm              64M     0   64M   0% /dev/shm
/dev/dasda1      50G   50G     0 100% /etc/hosts
tmpfs           2.0G     0  2.0G   0% /proc/scsi
tmpfs           2.0G     0  2.0G   0% /sys/firmware
root@4b9aad66a111:~# bash Miniconda3-py312_24.3.0-0-Linux-s390x.sh

Welcome to Miniconda3 py312_24.3.0-0

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>
Miniconda3-py312_24.3.0-0-Linux-s390x.sh: line 148: cannot create temp file for here-document: No space left on device
root@4b9aad66a111:~# ls -la

If the space is fully consumed but able to load the License

root@4b9aad66a111:~# ./Miniconda3-py312_24.3.0-0-Linux-s390x.sh

Welcome to Miniconda3 py312_24.3.0-0

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>
END USER LICENSE AGREEMENT

<license details>

Do you accept the license terms? [yes|no]
>>>        yes

Miniconda3 will now be installed into this location:
/root/miniconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/root/miniconda3] >>>
mkdir: cannot create directory ‘/root/miniconda3’: No space left on device
ERROR: Could not create directory: '/root/miniconda3'
root@4b9aad66a111:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay          50G   50G     0 100% /
tmpfs            64M     0   64M   0% /dev
shm              64M     0   64M   0% /dev/shm
/dev/dasda1      50G   50G     0 100% /etc/hosts
tmpfs           2.0G     0  2.0G   0% /proc/scsi
tmpfs           2.0G     0  2.0G   0% /sys/firmware
root@4b9aad66a111:~#

A disk error message appears if the instance has enough space to create an empty folder.

root@4b9aad66a111:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay          50G   48G     0 100% /
tmpfs            64M     0   64M   0% /dev
shm              64M     0   64M   0% /dev/shm
/dev/dasda1      50G   48G     0 100% /etc/hosts
tmpfs           2.0G     0  2.0G   0% /proc/scsi
tmpfs           2.0G     0  2.0G   0% /sys/firmware
root@4b9aad66a111:~# bash Miniconda3-py312_24.3.0-0-Linux-s390x.sh

Welcome to Miniconda3 py312_24.3.0-0

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>
END USER LICENSE AGREEMENT

<license details>

Do you accept the license terms? [yes|no]
>>>   yes

Miniconda3 will now be installed into this location:
/root/miniconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/root/miniconda3] >>>
ERROR: Not enough free disk space: -102400 < 931457
root@4b9aad66a111:~# ls -la
total 135616
drwx------ 1 root root      4096 Apr 15 20:34 .
drwxr-xr-x 1 root root      4096 Apr 15 20:31 ..
-rw-r--r-- 1 root root      3106 Dec  5  2019 .bashrc
drwxr-xr-x 2 root root      4096 Apr 15 20:34 miniconda3
-rw-r--r-- 1 root root 138838773 Apr 15 20:24 Miniconda3-py312_24.3.0-0-Linux-s390x.sh
-rw-r--r-- 1 root root       161 Dec  5  2019 .profile
-rw-r--r-- 1 root root       205 Apr 15 20:25 .wget-hsts

Steps to Reproduce:

  1. Download the Miniconda3 installer script for your desired Python version, e.g., Miniconda3-py312_24.3.0-0-Linux-s390x.sh
  2. Utilize the disk up to 100%.
  3. Run the script using bash Miniconda3-py312_24.3.0-0-Linux-s390x.sh.
@marcoesters marcoesters added the type::feature request for a new feature or capability label Apr 19, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in 🧭 Planning Apr 19, 2024
@github-project-automation github-project-automation bot moved this from 🆕 New to 🏁 Done in 🧭 Planning Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::feature request for a new feature or capability
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant