conda-forge / miniforge

A conda-forge distribution.
https://conda-forge.org/miniforge
Other
6.47k stars 329 forks source link

"error while loading shared libraries" #643

Closed rzelle-lallemand closed 1 month ago

rzelle-lallemand commented 1 month ago

Solution to issue cannot be found in the documentation.

Issue

We're in the process of setting up a new VM (RHEL 9.4 with SELinux enabled) for use with conda. I installed Miniforge3 24.3.0-0 with the following per-user configuration:

eval "$(/path-to-conda-directory/bin/conda shell.bash hook)"
conda config --set auto_activate_base false
(base) $ conda init
conda config --add channels bioconda
conda config --add channels conda-forge
conda config --set channel_priority strict

I skipped the "defaults" channel as it's recommended here to avoid licensing requirements by conda: https://prefix.dev/blog/towards_a_vendor_lock_in_free_conda_experience

We installed the "blast" software (https://anaconda.org/bioconda/blast) in conda, but when we try to run this software we get errors like:

$ blastn
blastn: error while loading shared libraries: libxcleanup.so: cannot open shared object file: No such file or directory
$ which blastn
/path-to-conda-directory/envs/test-blast/bin/blastn

We first suspected SELinux but disabling it didn't help. I next discovered that the standalone version of blast (https://www.ncbi.nlm.nih.gov/books/NBK52640/) runs fine. After downloading and extracting https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.16.0/ncbi-blast-2.16.0+-x64-linux.tar.gz:

$ ~/Downloads/ncbi-blast-2.16.0+/bin/blastn
BLAST query/options error: Either a BLAST database or subject sequence(s) must be specified
Please refer to the BLAST+ user manual.

Could this be a conda/miniforge issue? We haven't seen this error for any other of our conda packages.

Installed packages

# packages in environment at /path-to-conda-directory/envs/test-blast:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
blast                     2.16.0               hc155240_2    bioconda
bzip2                     1.0.8                h4bc722e_7    conda-forge
c-ares                    1.33.1               heb4867d_0    conda-forge
ca-certificates           2024.8.30            hbcca054_0    conda-forge
curl                      8.10.0               hbbe4b11_0    conda-forge
entrez-direct             22.4                 he881be0_0    bioconda
gettext                   0.22.5               he02047a_3    conda-forge
gettext-tools             0.22.5               he02047a_3    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
krb5                      1.21.3               h659f571_0    conda-forge
libasprintf               0.22.5               he8f35ee_3    conda-forge
libasprintf-devel         0.22.5               he8f35ee_3    conda-forge
libcurl                   8.10.0               hbbe4b11_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 hd590300_2    conda-forge
libgcc                    14.1.0               h77fa898_1    conda-forge
libgcc-ng                 14.1.0               h69a702a_1    conda-forge
libgettextpo              0.22.5               he02047a_3    conda-forge
libgettextpo-devel        0.22.5               he02047a_3    conda-forge
libgomp                   14.1.0               h77fa898_1    conda-forge
libidn2                   2.3.7                hd590300_0    conda-forge
libnghttp2                1.58.0               h47da74e_1    conda-forge
libsqlite                 3.46.1               hadc24fc_0    conda-forge
libssh2                   1.11.0               h0841786_0    conda-forge
libstdcxx                 14.1.0               hc0a3c3a_1    conda-forge
libstdcxx-ng              14.1.0               h4852527_1    conda-forge
libunistring              0.9.10               h7f98852_0    conda-forge
libxcrypt                 4.4.36               hd590300_1    conda-forge
libzlib                   1.3.1                h4ab18f5_1    conda-forge
ncbi-vdb                  3.1.1                h4ac6f70_2    bioconda
ncurses                   6.5                  he02047a_1    conda-forge
openssl                   3.3.2                hb9d3cd8_0    conda-forge
perl                      5.32.1          7_hd590300_perl5    conda-forge
perl-archive-tar          2.40            pl5321hdfd78af_0    bioconda
perl-carp                 1.50            pl5321hd8ed1ab_0    conda-forge
perl-common-sense         3.75            pl5321hd8ed1ab_0    conda-forge
perl-compress-raw-bzip2   2.201           pl5321h166bdaf_0    conda-forge
perl-compress-raw-zlib    2.202           pl5321h166bdaf_0    conda-forge
perl-encode               3.21            pl5321hd590300_0    conda-forge
perl-exporter             5.74            pl5321hd8ed1ab_0    conda-forge
perl-exporter-tiny        1.002002        pl5321hd8ed1ab_0    conda-forge
perl-extutils-makemaker   7.70            pl5321hd8ed1ab_0    conda-forge
perl-io-compress          2.201           pl5321hdbdd923_2    bioconda
perl-io-zlib              1.14            pl5321hdfd78af_0    bioconda
perl-json                 4.10            pl5321hdfd78af_1    bioconda
perl-json-xs              4.03            pl5321h4ac6f70_3    bioconda
perl-list-moreutils       0.430           pl5321hdfd78af_0    bioconda
perl-list-moreutils-xs    0.430           pl5321h031d066_2    bioconda
perl-parent               0.241           pl5321hd8ed1ab_0    conda-forge
perl-pathtools            3.75            pl5321h166bdaf_0    conda-forge
perl-scalar-list-utils    1.63            pl5321h166bdaf_0    conda-forge
perl-storable             3.15            pl5321hb9d3cd8_0    conda-forge
perl-types-serialiser     1.01            pl5321hdfd78af_0    bioconda
rpsbproc                  0.5.0                h6a68c12_0    bioconda
wget                      1.21.4               hda4d442_0    conda-forge
zlib                      1.3.1                h4ab18f5_1    conda-forge
zstd                      1.5.6                ha6fb4c9_0    conda-forge

Environment info

active environment : test-blast
    active env location : /path-to-conda-directory/envs/test-blast
            shell level : 3
       user config file : /home/rzelle/.condarc
 populated config files : /path-to-conda-directory/.condarc
                          /home/rzelle/.condarc
          conda version : 24.7.1
    conda-build version : not installed
         python version : 3.10.14.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=icelake
                          __conda=24.7.1=0
                          __glibc=2.34=0
                          __linux=5.14.0=0
                          __unix=0=0
       base environment : /path-to-conda-directory  (writable)
      conda av data dir : /path-to-conda-directory/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://conda.anaconda.org/bioconda/linux-64
                          https://conda.anaconda.org/bioconda/noarch
          package cache : /path-to-conda-directory/pkgs
                          /home/rzelle/.conda/pkgs
       envs directories : /path-to-conda-directory/envs
                          /home/rzelle/.conda/envs
               platform : linux-64
             user-agent : conda/24.7.1 requests/2.32.3 CPython/3.10.14 Linux/5.14.0-427.26.1.el9_4.x86_64 rhel/9.4 glibc/2.34 solver/libmamba conda-libmamba-solver/24.7.0 libmambapy/1.5.9
                UID:GID : 1000:6001
             netrc file : None
           offline mode : False
rzelle-lallemand commented 1 month ago

I identified another package (which works fine on our other server) that triggers this error:

(qa) $ fastqc
perl: error while loading shared libraries: libperl.so: cannot open shared object file: No such file or directory
(qa) $ conda list | grep fastqc
fastqc                    0.12.1               hdfd78af_0    bioconda
isuruf commented 1 month ago

Please open an issue in bioconda. This is not the place for such a bug.

rzelle-lallemand commented 1 month ago

@isuruf, thanks, I wasn't sure where to report this.

rzelle-lallemand commented 1 month ago

After troubleshooting it looks our use of "chmod 2775 -R" on the conda directory caused the issue. We had been using this command to give other users the ability to install packages and create new environments (otherwise they kept running into conda cache permission issues). This seems to work fine on our old server, but on the new server setting the SGID caused the issue we reported here. Using "chmod 775 -R" instead solved the issue.