I attempted to create conda env (not singularity+conda) in cheaha to see if the issue can be replicated there. Conda just stalled at this step - Invoking SAT with clause count even after 15mins of executing the command. Relevant parts of the stdout/stderr:
Solving environment...
When --verbose --verbose flag added to probe further,
DEBUG conda.resolve:solve(1340): Requested specs: - __archspec - __glibc - __linux - __unix - multiqc==1.9DEBUG conda.resolve:solve(1341): Optional specs:DEBUG conda.resolve:solve(1342): All other specs: - _libgcc_mutex - _openmp_mutex........................DEBUG conda.resolve:solve(1343): missing specs: - _libgcc_mutex - _openmp_mutex........................DEBUG conda.resolve:solve(1346): Solve: minimize removed packagesDEBUG conda.resolve:solve(1353): Solve: maximize versions of requested packagesDEBUG conda.common._logic:minimize(664): Empty objective, trivial solutionDEBUG conda.common._logic:minimize(664): Empty objective, trivial solutionDEBUG conda.resolve:solve(1357): Initial package channel/version metric: 0/0DEBUG conda.resolve:solve(1360): Solve: minimize track_feature countDEBUG conda.resolve:generate_feature_count(933): generate_feature_count returning with clause count: 128071DEBUG conda.common._logic:minimize(658): Clauses added, recomputing solutionDEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 128071DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 128083DEBUG conda.common._logic:minimize(745): Final sum objective: 0DEBUG conda.resolve:solve(1363): Track feature count: 0DEBUG conda.common._logic:minimize(658): Clauses added, recomputing solutionDEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 129436DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 129887DEBUG conda.common._logic:minimize(745): Final sum objective: 0DEBUG conda.resolve:solve(1374): Package misfeature count: 0DEBUG conda.resolve:solve(1377): Solve: maximize build numbers of requested packagesDEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 129888DEBUG conda.common._logic:minimize(745): Final sum objective: 0DEBUG conda.resolve:solve(1379): Initial package build metric: 0DEBUG conda.resolve:solve(1382): Solve: prefer arch over noarch for requested packagesDEBUG conda.common._logic:minimize(664): Empty objective, trivial solutionDEBUG conda.resolve:solve(1384): Noarch metric: 0DEBUG conda.resolve:solve(1388): Solve: minimize number of optional installationsDEBUG conda.common._logic:minimize(664): Empty objective, trivial solutionDEBUG conda.resolve:solve(1391): Optional package install metric: 0DEBUG conda.resolve:solve(1394): Solve: minimize number of necessary upgradesDEBUG conda.common._logic:minimize(664): Empty objective, trivial solutionDEBUG conda.resolve:solve(1397): Dependency update count: 0DEBUG conda.resolve:solve(1400): Solve: maximize versions and builds of indirect dependencies. Prefer arch over noarch where equivalent.DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 132814DEBUG conda.common._logic:minimize(745): Final peak objective: 0DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 142063DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 132989DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 133651DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 133169DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 133389DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 133270DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 133344DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 133296DEBUG conda.common._logic:minimize(745): Final peak objective: 39DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 13942923DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 7270918DEBUG conda.common._logic:_run_sat(607): Invoking SAT with clause count: 3923857
As per this stackoverflow answer, Invoking SAT with clause count: is known to be associated with stalling :(
conda can run into endless loops when trying to figure out a way to satisfy all the dependencies of the packages that are installed, along with the changes you want to apply. I've read somewhere that if it hasn't found a solution within two minutes, there's not much point in waiting any longer.
In general, you overcome such situations by being more specific about what you want. For example, specify exact versions instead of just package names. If you don't need conda-forge, avoid that channel, because it brings in a lot of metadata that the SAT resolver will try to consider.
Attempted to compare with the past logs to see how long this task took in the past, but I couldn't find the relevant log file. In case time-taken keeps increasing in future, we may have to define conda env configs with specific dependencies. Currently it lists only the major tools and not any of the underlying dependencies.
Some background info and some learnings. We were aware of this issue before but we may need to act on this issue soon.
Most (all?) conda env configs defined in Snakemake-wrapper are loosely defined; that is, they just simply specify the most high level dependencies. This practice is not uncommon in the conda env configs we create in-house as well.
This setup is favored presumably to work widely across various OS environments out in the wild
This means that conda envs created today using such config would not be quite same as the one created an year ago. Underlying dependencies may vary widely. They may work without resulting in any error but reproducibility is a concern here in terms of exact environment used.
Ideally most if not all underlying dependencies need to be defined in config file. At least the most important dependencies (python, perl, C, R for example) and their versions need to be specified, although what are deemed important can be subjective.
In light of this issues, it may be a good idea to better define conda env configs. This would allow better reproducibility and avoid conda env creation failing after some months or years.
Testing now. Instead of using local wrapper, just define conda: directive with wrapper: and see if snakemake would use locally defined conda env. Advantage here is to avoid use of local wrapper.
Rule multiqc_by_sample_initial_pass ran into following error. I suspect this has to do with something wrong with conda env created. This reported error might be a variation of what we are seeing here.
Traceback (most recent call last): File "quac/.snakemake/conda/9c3107da6d16b7941e8a8041bae2d495/bin/multiqc", line 6, in <module> from multiqc.__main__ import multiqc File "quac/.snakemake/conda/9c3107da6d16b7941e8a8041bae2d495/lib/python3.6/site-packages/multiqc/__init__.py", line 16, in <module> from .multiqc import run File "quac/.snakemake/conda/9c3107da6d16b7941e8a8041bae2d495/lib/python3.6/site-packages/multiqc/multiqc.py", line 38, in <module> from .plots import table File "quac/.snakemake/conda/9c3107da6d16b7941e8a8041bae2d495/lib/python3.6/site-packages/multiqc/plots/table.py", line 9, in <module> from multiqc.utils import config, report, util_functions, mqc_colour File "quac/.snakemake/conda/9c3107da6d16b7941e8a8041bae2d495/lib/python3.6/site-packages/multiqc/utils/mqc_colour.py", line 7, in <module> import spectra File "quac/.snakemake/conda/9c3107da6d16b7941e8a8041bae2d495/lib/python3.6/site-packages/spectra/__init__.py", line 1, in <module> from .core import COLOR_SPACES, Color, Scale File "quac/.snakemake/conda/9c3107da6d16b7941e8a8041bae2d495/lib/python3.6/site-packages/spectra/core.py", line 1, in <module> from colormath import color_objects, color_conversions File "quac/.snakemake/conda/9c3107da6d16b7941e8a8041bae2d495/lib/python3.6/site-packages/colormath/color_conversions.py", line 13, in <module> import networkx File "quac/.snakemake/conda/9c3107da6d16b7941e8a8041bae2d495/lib/python3.6/site-packages/networkx/__init__.py", line 81, in <module> from networkx import algorithms File "quac/.snakemake/conda/9c3107da6d16b7941e8a8041bae2d495/lib/python3.6/site-packages/networkx/algorithms/__init__.py", line 81, in <module> from networkx.algorithms import tree File "quac/.snakemake/conda/9c3107da6d16b7941e8a8041bae2d495/lib/python3.6/site-packages/networkx/algorithms/tree/__init__.py", line 1, in <module> from .branchings import * File "quac/.snakemake/conda/9c3107da6d16b7941e8a8041bae2d495/lib/python3.6/site-packages/networkx/algorithms/tree/branchings.py", line 30, in <module> from dataclasses import dataclass, fieldModuleNotFoundError: No module named 'dataclasses'Traceback (most recent call last): File "quac/.snakemake/scripts/tmp6z72phym.wrapper.py", line 24, in <module> "multiqc" File "/mnt/snakemake/snakemake/shell.py", line 231, in __new__ raise sp.CalledProcessError(retcode, cmd)
To circumvent this error, I exported the env definition of conda env created for multiqc (from v1.0 quac) using command:
cd quac/1.0/.snakemake/conda# identify env relevant to multiqc rulesgrep multiqc *yaml# now activate the corresponding conda envconda activate full_path_to_conda# export the env definitionconda env export> path_to_multiqc_env.yaml