conda-forge / miniforge

A conda-forge distribution.
https://conda-forge.org/download
Other
6.6k stars 335 forks source link

Install with prefix fails to unpack payload #214

Open johnmdonich opened 3 years ago

johnmdonich commented 3 years ago

Issue:


Environment (conda list):

``` $ conda list ```


Details about conda and system ( conda info ):

``` $ conda info ```

When trying to install .Mambaforge-MacOSX-x86_64.sh with the following command.

./Mambaforge-MacOSX-x86_64.sh -b -p $HOME/miniconda

The following error was raised:

PREFIX=$HOME/miniconda
Unpacking payload ...
ERROR   Expected environment not found at prefix: $HOME/miniconda
ERROR   Aborting.
./Mambaforge-MacOSX-x86_64.sh: line 364: $HOME/miniconda/preconda.tar.bz2: No such file or directory

Removing the -p from the install command allowed for the installation to complete successfully. Just wanted to raising the issue here in case it is not an odd local issue.

isuruf commented 3 years ago

Did you have $CONDA_PREFIX set before installing?

isuruf commented 3 years ago

cc @wolfv

wolfv commented 3 years ago

Thanks for the ping. I'll have a look at this issue and #199 tomorrow.

johnmdonich commented 3 years ago

@isuruf. I did not set $CONDA_PREFIX. I have always just used the flag on install.

isuruf commented 3 years ago

Do you have a directory named $HOME/miniconda already?

johnmdonich commented 3 years ago

@isuruf No the directory did not exist at the time of running the installer. There is a different error when the director already exists.

hmaarrfk commented 3 years ago

I think that this is the same as: https://github.com/conda-forge/miniforge/issues/127#issuecomment-917484985

I don't know what much I can do seeing as upstream still hasn't had time to review the patch i submitted

hmaarrfk commented 3 years ago

My guess is that it has to do with the multiple cases in the ncurses package: https://github.com/microsoft/WSL/issues/101#issuecomment-370293978

wolfv commented 3 years ago

@hmaarrfk there is an open issue here, too: https://github.com/mamba-org/mamba/issues/1144

I am not sure I understand how this is related to this error, though.

hmaarrfk commented 3 years ago

Sorry wrong thread. I was confused with the WSL bugs.

danschef commented 3 years ago

Same issue here on Ubuntu 20.04 with Mambaforge-Linux-x86_64.sh. However, in my case, there is also a warning about an unexpected checksum (also persists after re-downloading):

danschef@xxxxx:$ bash Mambaforge-Linux-x86_64.sh -p /path/to/target/mambaforge/ -f -b
PREFIX=/path/to/target/mambaforge
WARNING: md5sum mismatch of tar archive
expected: a874c6919e8eecd8cf252628fa889f9d
     got: d41d8cd98f00b204e9800998ecf8427e  -
Unpacking payload ...
Mambaforge-Linux-x86_64.sh: line 365: /path/to/target/mambaforge/preconda.tar.bz2: No such file or directory

Is there any workaround for this - something like an old installer or so? Somehow, I need to get it installed..

johnmdonich commented 3 years ago

I was able to install to the default path ($HOME/mambaforge). You should be able to move the install to the preferred location after install.

danschef commented 3 years ago

No,bash Mambaforge-Linux-x86_64.sh -f -b also does not work for me (same error). I also just tried the older releases from here. Does not seem to change anything.

hmaarrfk commented 3 years ago

Maybe this can help? https://github.com/conda-forge/miniforge/issues/218#issuecomment-935734831

danschef commented 3 years ago

Unfortunately not - PYTHONPATH and CONDA_PREFIX are both not set. TMP is set to /tmp (drwxrwxrwt permissions). The provided prefix directory (-p) also has drwxrwxrwt permissions. Probably, it is related to this.

However, if really Linux permissions are the problem, it would be useful if the Mambaforge installer would raise a permission error. The prefix directory that I pass with -p looks like this after running the installer:

$ ls -l
total 12
6275962 4 drwxrwxrwx  3 danschef mefe 4096 Oct  7 18:21 .
6276029 4 drwxrwxrwx 20 danschef mefe 4096 Oct  7 18:21 ..
6193892 0 -rwxrwxrwx  1 danschef mefe    0 Oct  7 18:27 conda.exe
6275963 4 drwxrwxrwx  2 danschef mefe 4096 Oct  7 18:21 install_tmp

The install_tmp directory is empty and the conda.exe has a size of 0 bytes, so I guess the payload was not properly unpacked (due to file permissions?).

wolfv commented 3 years ago

@danschef the conda.exe file is 0 bytes?

danschef commented 3 years ago

Yes, the file is created but without any content.

wolfv commented 3 years ago

Is your disk full by any chance?

danschef commented 3 years ago

No, there is enough free space.

Maybe also the md5 mismatch (see above) is related to that. However, the filesize of the installer is exactly the same like on another machine where everything works fine and I also re-downloaded the installer without any change.

wolfv commented 3 years ago

you coudl compare the md5 or sha256 sums: sha256sum Mambaforge...sh

danschef commented 3 years ago

sha256sum Mambaforge-Linux-x86_64.sh returns: c63907ba0971d2ca9a8775bd7ea48b635b2bdce4838b2f2d3a8e751876849595 Mambaforge-Linux-x86_64.sh

RISHIKESHAVAN commented 2 years ago

Hi, I faced the same issue with Miniforge3-MacOSX-arm64.sh. Due to time constraint, I tried installing with brew and it worked. Would love to know why the problem occurred though.

minrk commented 2 years ago

FWIW, I ran into this today and did have CONDA_PREFIX set (to the install prefix, since I was clearing and re-installing my conda install) and unset CONDA_PREFIX worked. This was mambaforge-MacOSX-4.11.0-4-x86_64.sh.

A simple test after clearing my conda env variables:

# clear everything
$ unset $(env | awk -F '=' '{print $1}' | grep CONDA)
$ CONDA_PREFIX=/tmp/test bash ~/Downloads/Mambaforge-4.11.0-4-MacOSX-x86_64.sh -b -p /tmp/test
PREFIX=/tmp/test
Unpacking payload ...
info     ****************** Backtrace Start ******************
debug    Loading configuration
trace    Compute configurable 'create_base'
trace    Compute configurable 'no_env'
trace    Compute configurable 'no_rc'
trace    Compute configurable 'rc_files'
trace    Compute configurable 'root_prefix'
trace    Get RC files configuration from locations up to HomeDir
trace    Configuration not found at '/Users/benjaminrk/.mambarc'
trace    Configuration found at '/Users/benjaminrk/.condarc'
trace    Configuration not found at '/Users/benjaminrk/.conda/condarc.d'
trace    Configuration not found at '/Users/benjaminrk/.conda/condarc'
trace    Configuration not found at '/Users/benjaminrk/.conda/.condarc'
trace    Configuration not found at '/Users/benjaminrk/micromamba/.mambarc'
trace    Configuration not found at '/Users/benjaminrk/micromamba/condarc.d'
trace    Configuration not found at '/Users/benjaminrk/micromamba/condarc'
trace    Configuration not found at '/Users/benjaminrk/micromamba/.condarc'
trace    Configuration not found at '/var/lib/conda/.mambarc'
trace    Configuration not found at '/var/lib/conda/condarc.d/'
trace    Configuration not found at '/var/lib/conda/condarc'
trace    Configuration not found at '/var/lib/conda/.condarc'
trace    Configuration not found at '/etc/conda/.mambarc'
trace    Configuration not found at '/etc/conda/condarc.d/'
trace    Configuration not found at '/etc/conda/condarc'
trace    Configuration not found at '/etc/conda/.condarc'
trace    Update configurable 'no_env'
trace    Compute configurable 'file_specs'
trace    Compute configurable 'spec_file_env_name'
trace    Compute configurable 'env_name'
trace    Compute configurable 'envs_dirs'
trace    Compute configurable 'use_target_prefix_fallback'
trace    Compute configurable 'target_prefix'
trace    Get RC files configuration from locations up to TargetPrefix
trace    Configuration not found at '/private/tmp/test/.mambarc'
trace    Configuration not found at '/private/tmp/test/condarc.d'
trace    Configuration not found at '/private/tmp/test/condarc'
trace    Configuration not found at '/private/tmp/test/.condarc'
trace    Configuration not found at '/Users/benjaminrk/.mambarc'
trace    Configuration found at '/Users/benjaminrk/.condarc'
trace    Configuration not found at '/Users/benjaminrk/.conda/condarc.d'
trace    Configuration not found at '/Users/benjaminrk/.conda/condarc'
trace    Configuration not found at '/Users/benjaminrk/.conda/.condarc'
trace    Configuration not found at '/Users/benjaminrk/micromamba/.mambarc'
trace    Configuration not found at '/Users/benjaminrk/micromamba/condarc.d'
trace    Configuration not found at '/Users/benjaminrk/micromamba/condarc'
trace    Configuration not found at '/Users/benjaminrk/micromamba/.condarc'
trace    Configuration not found at '/var/lib/conda/.mambarc'
trace    Configuration not found at '/var/lib/conda/condarc.d/'
trace    Configuration not found at '/var/lib/conda/condarc'
trace    Configuration not found at '/var/lib/conda/.condarc'
trace    Configuration not found at '/etc/conda/.mambarc'
trace    Configuration not found at '/etc/conda/condarc.d/'
trace    Configuration not found at '/etc/conda/condarc'
trace    Configuration not found at '/etc/conda/.condarc'
trace    Update configurable 'no_env'
trace    Compute configurable 'target_prefix_checks'
error    Expected environment not found at prefix: /private/tmp/test
critical Aborting.
info     ****************** Backtrace End ********************
/Users/benjaminrk/Downloads/Mambaforge-4.11.0-4-MacOSX-x86_64.sh: line 365: /tmp/test/preconda.tar.bz2: No such file or directory
$ rm -rf /tmp/test # clear the partial install leftover
# try again, no $CONDA_PREFIX
$ ~/Downloads/Mambaforge-4.11.0-4-MacOSX-x86_64.sh -b -p /tmp/test
...
success
wolfv commented 2 years ago

Linking this to the mamba repo -- we'll look into it! https://github.com/mamba-org/mamba/issues/1543

danschef commented 2 years ago

FYI: We could solve this issue with an additional --login parameter on our SUSE servers:

bash --login Mambaforge-Linux-x86_64.sh

shka commented 2 years ago

--login works also for MacOSX-arm64.

evonreis commented 2 years ago

--login does not solve the problem for me on Debian 11

Edit: never mind. I had deleted the conda directory prior to install but did not notice my shell was still active in it.