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

Conda hangs when solving package specifications #5536

Closed
daler opened this issue Jun 15, 2017 · 31 comments
Closed

Conda hangs when solving package specifications #5536

daler opened this issue Jun 15, 2017 · 31 comments
Labels
locked [bot] locked due to inactivity priority-high [deprecated] use severity::* solver::performance pertains to the solver's performance solver pertains to the solver source::community catch-all for issues filed by community members stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity type::bug describes erroneous operation, use severity::* to classify the type

Comments

@daler
Copy link

daler commented Jun 15, 2017

Hi, here is another data point related to #5219, #4077, #4467 where the solver hangs on particular combos of dependencies. Pinging @mcg1969 since you're mentioned in those other issues.

After trying different combinations trying to pin down the culprit, the best I could figure out is that it seems to be a critical mass of R packages across bioconda and conda-forge that cause the issue. Here's an example:

# Works
channels:
  - bioconda
  - conda-forge
dependencies:
  - bioconductor-tximport
  - r-rmarkdown
  - pandoc
  - r-readr
  - r-dt
# Works
channels:
  - bioconda
  - conda-forge
dependencies:
  - bioconductor-tximport
  - r-rmarkdown
  - pandoc
  - r-readr
  - r-dt

  # added r-knitr
  - r-knitr
# Hangs on "Solving package specifications: .", killed after 6 min
channels:
  - bioconda
  - conda-forge
dependencies:
  - bioconductor-tximport
  - r-rmarkdown
  - pandoc
  - r-readr
  - r-dt
  - r-knitr

  # added r-pheatmap
  - r-pheatmap

From that last one, the output from conda env create -n tmp --file env.yml -vv is here. And my conda info is:

Current conda install:

               platform : linux-64
          conda version : 4.3.21
       conda is private : False
      conda-env version : 4.3.21
    conda-build version : 2.0.7
         python version : 3.5.2.final.0
       requests version : 2.17.3
       root environment : /home/ryan/miniconda3  (writable)
    default environment : /home/ryan/miniconda3
       envs directories : /home/ryan/miniconda3/envs
                          /home/ryan/.conda/envs
          package cache : /home/ryan/miniconda3/pkgs
                          /home/ryan/.conda/pkgs
           channel URLs : https://conda.anaconda.org/bioconda/linux-64
                          https://conda.anaconda.org/bioconda/noarch
                          https://conda.anaconda.org/r/linux-64
                          https://conda.anaconda.org/r/noarch
                          https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
                          https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://conda.anaconda.org/lcdb/linux-64
                          https://conda.anaconda.org/lcdb/noarch
            config file : /home/ryan/.condarc
             netrc file : /home/ryan/.netrc
           offline mode : False
             user-agent : conda/4.3.21 requests/2.17.3 CPython/3.5.2 Linux/3.13.0-119-generic debian/jessie/sid glibc/2.19
                UID:GID : 1000:1000
@daler
Copy link
Author

daler commented Jun 15, 2017

More info . . .

I tried again and was able build the above previously-hanging environment in about 2.5 mins. So to make things harder it may be non-deterministic.

However as part of this additional troubleshooting I removed the r channel from my .condarc. Upon double-checking conda info I noticed that the r channel was still there. I now see from the 4.3.0 changelog that the r channel is now added to defaults.

This may be causing the problem because there was recently a big push to migrate from the r channel to conda-forge and I suspect a large number of duplicated packages across the two channels are making the solver's life difficult. This could even be why #4467 and #5219 failed -- they both depend on R packages.

If I downgrade to conda==4.2.16 and verify that the r channel is not present, it completely solves the issue. If I re-add the r channel using conda==4.2.16, it hangs again.

(ping @bgruening & @johanneskoester)

@johanneskoester
Copy link
Contributor

Ok, @kalefranz @msarahan with many duplicated R packages between the r channel and conda-forge, the solver seems to run into problems (see above). Is this something you are already working on?

@kalefranz kalefranz added solver pertains to the solver type::bug describes erroneous operation, use severity::* to classify the type source::community catch-all for issues filed by community members labels Jun 21, 2017
@kalefranz
Copy link
Contributor

Thanks for all the details. I'll work with @mcg1969. I'm not sure what the solution will be just yet. He's the one with the optimization PhD :) Although @mcg1969 is on a much-deserved vacation for the next week, so we'll have to look into this next week.

@kalefranz kalefranz added the priority-high [deprecated] use severity::* label Jun 21, 2017
@kalefranz
Copy link
Contributor

In the meantime, if you want to remove the r channel from the defaults list, in your ~/.condarc file add

default_channels:
  - https://repo.continuum.io/pkgs/free
  - https://repo.continuum.io/pkgs/pro
  - https://repo.continuum.io/pkgs/msys2  # if on Windows

or at this point even just

default_channels:
  - https://repo.continuum.io/pkgs/free
  - https://repo.continuum.io/pkgs/msys2  # if on Windows

@johanneskoester
Copy link
Contributor

Thanks! We look forward to the solution! Can you keep us posted here?

@kalefranz
Copy link
Contributor

kalefranz commented Jun 21, 2017 via email

@eredekop
Copy link

Hi all! New conda user here. I'm trying to install a second python environment with
conda create -n py27 python=2.7 anaconda
but it gets stuck solving packages.

Here is my .condarc

`channels:

  • conda-forge
  • defaults
    ssl_verify: true`

Here is the output of conda info

`Current conda install:

           platform : linux-64
      conda version : 4.3.22
   conda is private : False
  conda-env version : 4.3.22
conda-build version : not installed
     python version : 3.6.1.final.0
   requests version : 2.14.2
   root environment : /home/eredekop/anaconda3  (writable)
default environment : /home/eredekop/anaconda3
   envs directories : /home/eredekop/anaconda3/envs
                      /home/eredekop/.conda/envs
      package cache : /home/eredekop/anaconda3/pkgs
                      /home/eredekop/.conda/pkgs
       channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                      https://conda.anaconda.org/conda-forge/noarch
                      https://repo.continuum.io/pkgs/free/linux-64
                      https://repo.continuum.io/pkgs/free/noarch
                      https://repo.continuum.io/pkgs/r/linux-64
                      https://repo.continuum.io/pkgs/r/noarch
                      https://repo.continuum.io/pkgs/pro/linux-64
                      https://repo.continuum.io/pkgs/pro/noarch
        config file : /home/eredekop/.condarc
         netrc file : None
       offline mode : False
         user-agent : conda/4.3.22 requests/2.14.2 CPython/3.6.1 Linux/4.10.0-33-generic debian/stretch/sid glibc/2.24    
            UID:GID : 1000:1000

`
Please help!

@lhoss
Copy link

lhoss commented Sep 18, 2017

@eredekop can you try to set the default channels without the r channels, as shown in #5536 (comment)

Myself fought also with 'hang' issues (but having a quite long list of dependencies, too long to post here, incl. a 'pip' section) .. here's some learnings and notes:
The 'hang' issues originally appeared in 2 cases (on an already upgraded conda v4.3.25):

later, since I downgraded the initial install to Miniconda 4.2.12 (latest 4.2.x binaries that I found in the repos, for linux x64):

  • deploying miniconda from a scratch, now worked without issue (multiple times tested)
  • despite that during the 'conda-env update' step, miniconda was also updated to latest again (4.3.25) (which also brought back the default 'r' channels)
    ** wondering why is that? can I avoid conda updating itself (I assume none of my deps is depending on a more recent conda?!)

ref: command used todo the update (generated by our ansible role):
bin/conda env update -n "root" -f "/tmp/root-environment.yml"

@johanneskoester
Copy link
Contributor

@kalefranz, any updates on this? I am occasionally seeing users complaining about hangs. Is this already resolved, and is there a minimum conda version we can point to?

@eredekop
Copy link

eredekop commented Sep 20, 2017

@lhoss I tried setting default channels as in #5536, but it did not change anything. I only needed to add extra lines at the end of .condarc, correct? The file now looks like this:

channels:
  - conda-forge
  - defaults
ssl_verify: true
default_channels:
  - https://repo.continuum.io/pkgs/free

Without quick solution, I actually ended up translating my python2 scripts into python3 with 2to3 command. However, it would still be good to know the solution to the hang problem with creating new environments.

@lhoss
Copy link

lhoss commented Sep 21, 2017

did you check the final channels with conda info (that really no r channels) , or could the extraconda-forge be a problem too ??
I used following:

default_channels:
  - https://repo.continuum.io/pkgs/free
  - https://repo.continuum.io/pkgs/pro

@bgruening
Copy link

@kalefranz we see this more and more often. Any information we can collect to help resolving this?
Can we remove the r-default channel easily via a command line switch in a future version?

@bgruening
Copy link

@kalefranz you can reproduce the error with

 % conda create -y --override-channels --channel iuc --channel bioconda --channel conda-forge --channel defaults --channel r --name __busco@3.0.2 busco=3.0.2 
% conda info 
Current conda install:

               platform : linux-64
          conda version : 4.3.23
       conda is private : False
      conda-env version : 4.3.23
    conda-build version : 2.1.17
         python version : 3.5.2.final.0
       requests version : 2.13.0
       root environment : /home/bag/miniconda3  (writable)
    default environment : /home/bag/miniconda3
       envs directories : /home/bag/miniconda3/envs
                          /home/bag/.conda/envs
          package cache : /home/bag/miniconda3/pkgs
                          /home/bag/.conda/pkgs
           channel URLs : https://conda.anaconda.org/bioconda/linux-64
                          https://conda.anaconda.org/bioconda/noarch
                          https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
            config file : /home/bag/.condarc
             netrc file : /home/bag/.netrc
           offline mode : False
             user-agent : conda/4.3.23 requests/2.13.0 CPython/3.5.2 Linux/4.13.0-12-generic debian/stretch/sid glibc/2.26    
                UID:GID : 1001:1001

@bernt-matthias
Copy link

Another example here:

conda create -v -v -v -y --override-channels --channel iuc --channel bioconda --channel conda-forge --channel defaults --channel r --name mulled-v1-0ac87b39a40f44c0fe078d45b44a75214d4cdc24e1ddfc494e56a9ef42628a17 bioconductor-dexseq=1.20.1 r-getopt=1.20.0 r-rjson=0.2.15

stopped it after a weekend without progress.

When some of the channels are removed it works:

conda create -v -v -v -y --override-channels --channel bioconda --channel defaults --name mulled-v1-0ac87b39a40f44c0fe078d45b44a75214d4cdc24e1ddfc494e56a9ef42628a17 bioconductor-dexseq=1.20.1 r-getopt=1.20.0 r-rjson=0.2.15

conda info

Current conda install:

               platform : linux-64
          conda version : 4.3.27
       conda is private : False
      conda-env version : 4.3.27
    conda-build version : not installed
         python version : 3.5.2.final.0
       requests version : 2.14.2
       root environment : /gpfs1/data/galaxy_server/galaxy-dev/database/dependencies/_conda  (writable)
    default environment : /gpfs1/data/galaxy_server/galaxy-dev/database/dependencies/_conda
       envs directories : /gpfs1/data/galaxy_server/galaxy-dev/database/dependencies/_conda/envs
                          /home/songalax/.conda/envs
          package cache : /gpfs1/data/galaxy_server/galaxy-dev/database/dependencies/_conda/pkgs
                          /home/songalax/.conda/pkgs
           channel URLs : https://repo.continuum.io/pkgs/main/linux-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
            config file : None
             netrc file : None
           offline mode : False
             user-agent : conda/4.3.27 requests/2.14.2 CPython/3.5.2 Linux/2.6.32-696.6.3.el6.x86_64 CentOS/6.9 glibc/2.12    
                UID:GID : 61715:4533

@bgruening
Copy link

And a new one in bioconda/bioconda-recipes#6365 :(

@nsoranzo
Copy link

nsoranzo commented Dec 7, 2017

Another, super-simple example to replicate: conda create -n rsem rsem=1.3.0 . Removing the r channel from ~/.condarc fixes it.

@jdblischak
Copy link

jdblischak commented Apr 24, 2018

It would be ideal if default_channels could be set in the environment file just like the other channels. Having to edit ~/.condarc diminishes the portability of an environment.yml file. I know setting --explicit is one option, but that is not cross-platform (one of the great advantages of using conda).

Update: A colleague showed me how to use the option -nodefaults to modify the default channels without having to modify ~/.condarc. In the environment.yaml file:

channels:
  - bioconda
  - conda-forge
  - https://repo.anaconda.com/pkgs/free/linux-64
  - https://repo.anaconda.com/pkgs/free/noarch
  - https://repo.anaconda.com/pkgs/pro/linux-64
  - https://repo.anaconda.com/pkgs/pro/noarch
  - nodefaults

This ignores the r channel regardless of what channels the user has set in ~/.condarc.

@daler
Copy link
Author

daler commented May 7, 2018

For anyone else still following this, you may want to also include the main channel, which has the new compiler packages used by conda-build 3:

default_channels:
- https://repo.continuum.io/pkgs/free
- https://repo.continuum.io/pkgs/main


EDIT by @mbargull: If you opt to change default_channels, be sure to use

default_channels:
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/free

(note the order; pkgs/main should take precedence over the old pkgs/free)

@mbargull
Copy link
Member

mbargull commented May 7, 2018

For some cases this was improved with conda >=4.4, but there are still other cases where the pkgs/r+conda-forge combo causes seemingly endless solving phases.
Apart from thedefault_channels modification workaround, a simple

conda config --add pinned_packages 'r-base >=3.4'

might also do the trick.

EDIT: If you opt to change default_channels, be sure to use

default_channels:
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/free

(note the order; pkgs/main should take precedence over the old pkgs/free)

@kalefranz
Copy link
Contributor

kalefranz commented May 7, 2018 via email

@mbargull
Copy link
Member

mbargull commented May 7, 2018

@kalefranz, I just copied the edit I made to my post earlier to @daler's (hope you don't mind @daler!)

@johanneskoester
Copy link
Contributor

@kalefranz are you still working on a fix?

@mukteshkrmishra
Copy link

mukteshkrmishra commented Jun 25, 2018

I am still facing the same issue. It hangs forever. conda info :

active environment : None user config file : /home/.condarc populated config files : /home/.condarc conda version : 4.5.4 conda-build version : 3.10.9 python version : 3.5.5.final.0 base environment : /home/anaconda3 (writable) channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/free/linux-64 https://repo.anaconda.com/pkgs/free/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch https://repo.anaconda.com/pkgs/pro/linux-64 https://repo.anaconda.com/pkgs/pro/noarch package cache : /home/anaconda3/pkgs /home/.conda/pkgs envs directories : /home/anaconda3/envs /home/.conda/envs platform : linux-64 user-agent : conda/4.5.4 requests/2.19.1 CPython/3.5.5 Linux/4.4.0-1061-aws ubuntu/16.04 glibc/2.23 UID:GID : 0:0 netrc file : None offline mode : False

@dyoungasc
Copy link

The work around that worked for me was deleting the ~/.condarc then specifying what channel to use, like this
conda install -c bioconda roary
I'm not sure deleting .condarc was wise, but it worked.

@mbargull
Copy link
Member

xref: gh-7700

@randomgambit
Copy link

same thing for me. what can be done?

@gabefair
Copy link

gabefair commented Jan 8, 2019

I was wondering if anyone has found any stopgaps or quick and dirty fixes to get this working temporarily?

EDIT:
I found that specifying the channel directly allows for a quick install without the entire environment to be hung upon finding duplicates or when conda prunes python to 0.
DEBUG conda.resolve:filter_group(277): python: pruned from 17 -> 0

conda install --debug --override-channels -c main -c conda-forge package_in_forge

or

conda install --debug --override-channels -c main package_in_main

@msarahan
Copy link
Contributor

msarahan commented Jan 8, 2019

You can try conda 4.6.0's pre-release:

conda update -c conda-canary conda

It has several optimizations that might help.

@kalefranz kalefranz added the solver::performance pertains to the solver's performance label Apr 28, 2020
mgopez pushed a commit to phac-nml/galaxy_tools that referenced this issue May 28, 2020
ericenns pushed a commit to phac-nml/galaxy_tools that referenced this issue May 29, 2020
* #190, #95, #94, #93, #191

* Rewrote Python script for Python 3 compatibility
* Renamed README to README.rst
* Bumped version to 1.1.0
* Returns error code from .pl file, and reason
* Update to gnuplot 5.2.7

* Address linting errors

* Add Python 3 to dependencies, fix formatting

* Argument ordering

* Downgrade to python 3.7.6

* Add strict channel priority

* Conda Solving Env Fix

conda/conda#5536

* Add travis wait for 30 minutes for planemo

* Remove travis wait, re-order channels

* Use python 3.7.3

* Revert .travis.yml, remove Python 3 as dep

* bump bioperl to work on travis

* Add python 3.7.6 to requirements

Co-authored-by: Matt <matthew.gopez@canada.ca>
Co-authored-by: Darian <46600008+DarianHole@users.noreply.github.com>
Co-authored-by: Darian Hole <darian.hole@canada.ca>
@bcell
Copy link

bcell commented Dec 24, 2020

Years later and this is still happening. The question should really be, why the hell is this a problem (still)? Installing a package is among the most basic operations in python, which comes at the beginning of every script. R has a single command to do it that does not have these issues (not that it has none). Conda install, pip install, and easy_install fail like this with vague, useless error messages - thus the length of this and many other threads.

@hackalog
Copy link

This still happens a year later, too. Workaround is to use mamba to do the resolution. Is mamba working around the bug, or somehow handling my channels "differently"? Don't know.

@github-actions
Copy link

Hi there, thank you for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include:
    - What OS and version you reproduced the issue on
    - What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label Dec 12, 2022
@github-actions github-actions bot added the stale::closed [bot] closed after being marked as stale label Jan 11, 2023
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Jan 11, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity priority-high [deprecated] use severity::* solver::performance pertains to the solver's performance solver pertains to the solver source::community catch-all for issues filed by community members stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity type::bug describes erroneous operation, use severity::* to classify the type
Projects
None yet
Development

No branches or pull requests