ContinuumIO / anaconda-issues

Anaconda issue tracking
646 stars 220 forks source link

updated conda-rpm-deb package breaks installation #13240

Closed maurerle closed 1 year ago

maurerle commented 1 year ago

Checklist

Impacted product

What happened?

I did sudo apt update && sudo apt upgrade and installed the latest version of conda through the conda-rpm-deb repository listed here: https://docs.conda.io/projects/conda/en/latest/user-guide/install/rpm-debian.html

Somehow a lot of files started with a wrong shebang, namely: #!/home/runner/work/conda-rpm-deb/conda-rpm-deb/conda-prefix/opt/conda/bin/conda instead of #!/opt/conda/bin/conda which produced a lot of errors when running conda or conda env.

I had to adjust this in /opt/conda/bin/conda-env /opt/conda/etc/profile.d/conda.sh and another two files I did not remember to get conda working again.

Additionally, I'd like to mention that the installed 23.1 version is far from the latest conda version available and should also be updated..?

I did not reproduce this issue on a fresh install yet.

Expected behavior or outcome

Installing the latest version should

  1. install the latest available version (~23.7)
  2. should not break existing working installs
➜  ~ apt list conda -a
Listing... Done
conda/stable,now 23.1.0-1 amd64 [installed]
conda/stable 23.1.0-0 amd64
conda/stable 4.12.0-0 amd64
conda/stable 4.11.0-0 amd64
conda/stable 4.9.2-0 amd64
conda/stable 4.8.4-0 amd64
conda/stable 4.8.3-0 amd64
conda/stable 4.7.10-0 amd64
conda/stable 4.6.14-0 amd64
conda/stable 4.5.12-0 amd64
conda/stable 4.5.11-0 amd64

while apt changelog conda shows that 23.1.0-1 has been just released at the 04.08.23, which caused the faulted installation:

conda (23.1.0-1) ; urgency=medium
  * Package created with FPM.
 -- distribution_team@anaconda.com  Fri, 04 Aug 2023 18:00:10 +0000

I am running Gnome and latest Debian 12 Bookworm.

Conda info

active environment : None
            shell level : 0
       user config file : /home/maurer/.condarc
 populated config files : 
          conda version : 23.1.0
    conda-build version : not installed
         python version : 3.10.12.final.0
       virtual packages : __archspec=1=x86_64
                          __glibc=2.36=0
                          __linux=6.1.0=0
                          __unix=0=0
       base environment : /opt/conda  (read only)
      conda av data dir : /opt/conda/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /opt/conda/pkgs
                          /home/maurer/.conda/pkgs
       envs directories : /home/maurer/.conda/envs
                          /opt/conda/envs
               platform : linux-64
             user-agent : conda/23.1.0 requests/2.31.0 CPython/3.10.12 Linux/6.1.0-10-amd64 debian/12 glibc/2.36
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False

Conda config

empty

Conda list

# packages in environment at /opt/conda:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main    defaults
_openmp_mutex             5.1                       1_gnu    defaults
attrs                     23.1.0                   pypi_0    pypi
brotlipy                  0.7.0           py310h7f8727e_1002    defaults
bzip2                     1.0.8                h7b6447c_0    defaults
ca-certificates           2023.05.30           h06a4308_0    defaults
certifi                   2023.7.22       py310h06a4308_0    defaults
cffi                      1.15.0                   pypi_0    pypi
charset-normalizer        2.0.4                    pypi_0    pypi
colorama                  0.4.6                    pypi_0    pypi
conda                     4.14.0                   pypi_0    pypi
conda-package-handling    2.2.0           py310h06a4308_0    defaults
conda-package-streaming   0.9.0           py310h06a4308_0    defaults
cryptography              41.0.2                   pypi_0    pypi
cytoolz                   0.12.0          py310h5eee18b_0    defaults
et-xmlfile                1.1.0                    pypi_0    pypi
idna                      3.4             py310h06a4308_0    defaults
importlib-metadata        6.6.0                    pypi_0    pypi
jaraco-classes            3.2.3                    pypi_0    pypi
jeepney                   0.8.0                    pypi_0    pypi
keyring                   23.13.1                  pypi_0    pypi
ld_impl_linux-64          2.38                 h1181459_1    defaults
libffi                    3.3                  he6710b0_2    defaults
libgcc-ng                 11.2.0               h1234567_1    defaults
libgomp                   11.2.0               h1234567_1    defaults
libstdcxx-ng              11.2.0               h1234567_1    defaults
libuuid                   1.41.5               h5eee18b_0    defaults
lxml                      4.9.2                    pypi_0    pypi
more-itertools            9.1.0                    pypi_0    pypi
ncurses                   6.4                  h6a678d5_0    defaults
numpy                     1.23.3                   pypi_0    pypi
openconnect-sso           0.7.3                    pypi_0    pypi
openpyxl                  3.1.2                    pypi_0    pypi
openssl                   3.0.10               h7f8727e_0    defaults
pandas                    1.5.0                    pypi_0    pypi
pip                       23.2.1          py310h06a4308_0    defaults
pluggy                    1.0.0           py310h06a4308_1    defaults
prompt-toolkit            3.0.38                   pypi_0    pypi
pycosat                   0.6.3                    pypi_0    pypi
pycparser                 2.21                     pypi_0    pypi
pyopenssl                 23.2.0          py310h06a4308_0    defaults
pyqt5                     5.15.9                   pypi_0    pypi
pyqt5-qt5                 5.15.2                   pypi_0    pypi
pyqt5-sip                 12.12.1                  pypi_0    pypi
pyqtwebengine             5.15.6                   pypi_0    pypi
pyqtwebengine-qt5         5.15.2                   pypi_0    pypi
pysocks                   1.7.1           py310h06a4308_0    defaults
python                    3.10.12              h955ad1f_0    defaults
python-dateutil           2.8.2                    pypi_0    pypi
python-docx               0.8.11                   pypi_0    pypi
pytz                      2022.2.1                 pypi_0    pypi
pyxdg                     0.27                     pypi_0    pypi
readline                  8.2                  h5eee18b_0    defaults
requests                  2.31.0          py310h06a4308_0    defaults
ruamel.yaml               0.16.10         py310h7f8727e_1    defaults
ruamel.yaml.clib          0.2.6           py310h7f8727e_0    defaults
secretstorage             3.3.3                    pypi_0    pypi
setuptools                68.0.0          py310h06a4308_0    defaults
six                       1.16.0                   pypi_0    pypi
sqlite                    3.41.2               h5eee18b_0    defaults
structlog                 21.1.0                   pypi_0    pypi
tk                        8.6.12               h1ccaba5_0    defaults
toml                      0.10.2                   pypi_0    pypi
toolz                     0.12.0          py310h06a4308_0    defaults
tqdm                      4.64.1                   pypi_0    pypi
tzdata                    2023c                h04d1e81_0    defaults
urllib3                   1.26.11                  pypi_0    pypi
wcwidth                   0.2.6                    pypi_0    pypi
wheel                     0.38.4          py310h06a4308_0    defaults
xz                        5.4.2                h5eee18b_0    defaults
zipp                      3.15.0                   pypi_0    pypi
zlib                      1.2.13               h5eee18b_0    defaults
zstandard                 0.15.2                   pypi_0    pypi

Additional information

No response

d-vogel commented 1 year ago

Hit the same issue today on a Bookworm system. Automatically fixed with:

root@host:/opt/conda# grep -rlIi '/home/runner/work/conda-rpm-deb/conda-rpm-deb/conda-prefix' * | xargs -i@ sed -i 's_/home/runner/work/conda-rpm-deb/conda-rpm-deb/conda-prefix__g' @
KyeDon commented 1 year ago

Same issue on RHEL based systems.

EllisLambda commented 1 year ago

Same issue on Opensuse Tumbleweed.

liopeer commented 1 year ago

same issue on Ubuntu 20.04

liopeer commented 1 year ago

Hit the same issue today on a Bookworm system. Automatically fixed with:

root@host:/opt/conda# grep -rlIi '/home/runner/work/conda-rpm-deb/conda-rpm-deb/conda-prefix' * | xargs -i@ sed -i 's_/home/runner/work/conda-rpm-deb/conda-rpm-deb/conda-prefix__g' @

Did not work for me, now the conda command just fails with the following message: bash: /opt/conda/bin/conda: /opt/conda/bin/conda: bad interpreter: Too many levels of symbolic links Could you explain what this is supposed to do @d-vogel ?

d-vogel commented 1 year ago

I tested again and it works for me. Be sure to exit the shell and rejoin (ie, close/re-open your terminal if you're working locally). If you don't it won't work (although not the error you cited...).

Here is a tear-down: in the install dir from conda:

root@host:/opt/conda#

find all occurrences from this broken path (someone messed the build script of the package with the wrong variable, referring the build location relative to the local root rather then the package root. However I could not fine the packaging script, and don't know enough about debian packaging to fix it myself):

grep -rlIi '/home/runner/work/conda-rpm-deb/conda-rpm-deb/conda-prefix' *

take each filename from the result:

 xargs -i@

remove the problematic string. (typically the shebang was: #!/home/runner/work/conda-rpm-deb/conda-rpm-deb/conda-prefix/opt/conda/bin/conda but should be #!/opt/conda/bin/conda):

 sed -i 's_/home/runner/work/conda-rpm-deb/conda-rpm-deb/conda-prefix__g' @

If you've wrecked the conda install you can sudo apt-get --reinstall install conda

d-vogel commented 1 year ago

Demo: Right after upgrading conda this is the symtom of the issue:

user@hostname:~$ conda env
-bash: /home/runner/work/conda-rpm-deb/conda-rpm-deb/conda-prefix/opt/conda/bin/conda: No such file or directory

We want to modify files in /opt/conda, so we need to be root

user@hostname:~$ su
Password: 

VERY important, don't forget to move there:

root@hostname:/home/user# cd /opt/conda/

Actually do the modification:

root@hostname:/opt/conda# grep -rlIi '/home/runner/work/conda-rpm-deb/conda-rpm-deb/conda-prefix' * | xargs -i@ sed -i 's_/home/runner/work/conda-rpm-deb/conda-rpm-deb/conda-prefix__g' @

Back to normal user:

root@hostname:/opt/conda# 
exit

Let's try:

user@hostname:~$ conda env
-bash: /home/runner/work/conda-rpm-deb/conda-rpm-deb/conda-prefix/opt/conda/bin/conda: No such file or directory

Still no luck, because the envs variables were brocken (from the start actually, the prompt did not have the (base) prefix).

So we need to reopen the shell:

(base) user@host:~$ conda env
usage: conda-env [-h] {create,export,list,remove,update,config} ......

This time we see we have the prefix, and conda works.

pseudoyim commented 1 year ago

@maurerle thank you for reporting this issue, and @d-vogel thank you for posting the workaround. We have rebuilt the .deb and .rpm package for conda-23.1.0 (latest has build number 2; look for conda-23.1.0-2). This rebuild fixes the shebang issue.

Please let us know if you have any other questions or concerns. Thanks again.

maurerle commented 1 year ago

@pseudoyim thank you, the new package works well. I indeed still have two questions: Can the source of the packaging be published as well? Why is there no up to date version of conda available in the deb/rpm?