atlas icon indicating copy to clipboard operation
atlas copied to clipboard

Error in rule run_dram

Open bcpd opened this issue 2 years ago • 17 comments

  • [x] I checked and didn't found a related issue,e.g. while typing the title
  • [x] ** I got an error in the following rule(s):** run_dram

dlopen: cannot load any more object with static TLS

  • [x] I checked the log files indicated indicated in the error message (and the cluster logs if submitted to a cluster)

Here is the relevant log output, from logs/dram/run_dram/MAG1.log

ImportError: dlopen: cannot load any more object with static TLS


** Atlas version** 2.9.0

Additional context Add any other context about the problem here.

bcpd avatar Apr 06 '22 06:04 bcpd

Is there any more information about where in the code this issue arises.

In the snakemake log when it's written, that the rule fails. it should print the path to the conda environment. Can you check this.

To ignore the error and finish atlas you can run atlas run genomes --omit-from run_dram

SilasK avatar Apr 06 '22 12:04 SilasK

Maybe we should update dram there is now a version 1.3.

SilasK avatar Apr 06 '22 12:04 SilasK

Thank you for quick reply. To add further context:

    jobid: 188
    output: genomes/annotations/dram/intermediate_files/MAG1
    log: logs/dram/run_dram/MAG1.log (check log file(s) for error message)
    conda-env: /home/mixtures/databases/atlas/atlas/conda_envs/ec544f1ca9b568a9e21c7d47c59fd3d6
    shell:
         DRAM.py annotate  --input_fasta genomes/genomes/MAG1.fasta --output_dir genomes/annotations/dram/intermediate_$        (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

That's where the issue arises.

Running atlas run genomes --omit-from run_dram threw the same error.

bcpd avatar Apr 06 '22 16:04 bcpd

Hack:

In the config file you can comment out the following two lines, wich allows to finish the rest of atlas.

annotations:
  - gtdb_tree
  - gtdb_taxonomy
  - genes
#  - kegg_modules
#  - dram

You could test what happens when using the up to date DRAM with #507

Question the error message is in the log file or related to the snakemake?

SilasK avatar Apr 08 '22 11:04 SilasK

I had indeed tried that "hack" but the error remained the same.

The error in the snakemake log is the following:

Error in rule DRAM_annotate:
    jobid: 191
    output: genomes/annotations/dram/intermediate_files/MAG1
    log: logs/dram/run_dram/MAG1.log (check log file(s) for error message)
    conda-env: /home/mixtures/databases/atlas/atlas/conda_envs/ec544f1ca9b568a9e21c7d47c59fd3d6
    shell:
         DRAM.py annotate  --input_fasta genomes/genomes/MAG1.fasta --output_dir genomes/annotations/dram/intermediate_files/MAG1  $        (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

The error message in the log file is the following:

Traceback (most recent call last):
  File "/home/mixtures/databases/atlas/atlas/conda_envs/ec544f1ca9b568a9e21c7d47c59fd3d6/bin/DRAM.py", line 5, in <module>
    from mag_annotator.annotate_bins import annotate_bins_cmd, annotate_called_genes_cmd, merge_annotations_cmd
  File "/home/mixtures/databases/atlas/atlas/conda_envs/ec544f1ca9b568a9e21c7d47c59fd3d6/lib/python3.10/site-packages/mag_annotator$    from skbio.io import read as read_sequence
  File "/home/mixtures/databases/atlas/atlas/conda_envs/ec544f1ca9b568a9e21c7d47c59fd3d6/lib/python3.10/site-packages/skbio/__init_$    import skbio.diversity  # noqa
  File "/home/mixtures/databases/atlas/atlas/conda_envs/ec544f1ca9b568a9e21c7d47c59fd3d6/lib/python3.10/site-packages/skbio/diversi$    from ._driver import (alpha_diversity, beta_diversity, partial_beta_diversity,
  File "/home/mixtures/databases/atlas/atlas/conda_envs/ec544f1ca9b568a9e21c7d47c59fd3d6/lib/python3.10/site-packages/skbio/diversi$    import sklearn.metrics
  File "/home/mixtures/databases/atlas/atlas/conda_envs/ec544f1ca9b568a9e21c7d47c59fd3d6/lib/python3.10/site-packages/sklearn/__ini$    from .utils._show_versions import show_versions
  File "/home/mixtures/databases/atlas/atlas/conda_envs/ec544f1ca9b568a9e21c7d47c59fd3d6/lib/python3.10/site-packages/sklearn/utils$    from ._openmp_helpers import _openmp_parallelism_enabled
ImportError: dlopen: cannot load any more object with static TLS

Additional context which may or may not be relevant: when I try SemiBin instead of DAStool, the snakemake run simply stalls without error. The atlas env was created on anaconda2. The --max-mem parameter was set to 128.

I will try your suggestion and get back to you -- thank you!

bcpd avatar Apr 08 '22 16:04 bcpd

All good until the pip part:

ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/mixtures/atlas-dev/atlas/setup.py'"'"'; __file__='"'"'/home/mixtures/atlas-dev/atlas/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info
         cwd: /home/mixtures/atlas-dev/atlas/
    Complete output (8 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/mixtures/atlas-dev/atlas/setup.py", line 4, in <module>
        import versioneer  # script in directory
      File "/home/mixtures/atlas-dev/atlas/versioneer.py", line 372
        LONG_VERSION_PY: Dict[str, str] = {}
                       ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

bcpd avatar Apr 08 '22 17:04 bcpd

Interesting, could it be pulling the wrong python version, somehow? Something below 3.5 I have not studied the code base enough, so take this with a grain of salt.

rmFlynn avatar Apr 12 '22 14:04 rmFlynn

Also, for the sklearn problem, you could add the latest sklearn as a dependency in the dram environment. DRAM does not use sklearn it uses skbio, and it may have its own dependency requirements, pulling in an old version of sklearn.

rmFlynn avatar Apr 13 '22 00:04 rmFlynn

Yes skitbio uses sklearn which raises an error. So the problem is probably in skit bio. I think the python version is too recent.

SilasK avatar Apr 13 '22 12:04 SilasK

Updating to dram 1.3 following #507 yields the same importError: dlopen: cannot load any more object with static TLS error. It goes away if I comment out DRAM from the config file, as you suggest above, but that defeats the purpose.

bcpd avatar Apr 15 '22 00:04 bcpd

Thank you for the feedback @bcpd . I think the error is related to the too new version of python.

On my side @507 worked on a test run

I have

# Name                    Version                   Build  Channel
python                    3.10.4
scikit-bio                0.5.7                    pypi_0    pypi
scikit-learn              1.0.2                    pypi_0    pypi
scipy                     1.8.0                    pypi_0    pypi

```

Could you check your version with the following 2 commands:
````
conda list python -p <dram_conda_env>
conda list sci -p <dram_conda_env>
```

You see the `<dram_conda_env>` in the error message. Initially it was
`/home/mixtures/databases/atlas/atlas/conda_envs/ec544f1ca9b568a9e21c7d47c59fd3d6` but I don't know in your version with dram 1.3


SilasK avatar Apr 17 '22 21:04 SilasK

Thank you for your reply. Here's the output of those commands:

# Name                    Version                   Build  Channel
ipython                   8.2.0           py310hff52083_0    conda-forge
msgpack-python            1.0.3           py310hbf28c38_1    conda-forge
python                    3.10.4          h2660328_0_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python_abi                3.10                    2_cp310    conda-forge
# Name                    Version                   Build  Channel
scikit-bio                0.5.7           py310h96516ba_0    conda-forge
scikit-learn              1.0.2           py310h1246948_0    conda-forge
scipy                     1.8.0           py310hea5193d_1    conda-forge

bcpd avatar Apr 19 '22 19:04 bcpd

I encountered this error:

ImportError: cannot import name 'PearsonRConstantInputWarning' from 'scipy.stats' (/home/nwezejus/Peat_metagenome2022/ATLAS/databases/conda_envs/140c117b8fe5c17c29da39e6b9fb5794/lib/python3.10/site-packages/scipy/stats/init.py)

Justan6 avatar Sep 29 '22 11:09 Justan6

I also encountered this error. I try to solved it derectly in scikit bio but it is not solved.

You can do:

conda activate /home/nwezejus/Peat_metagenome2022/ATLAS/databases/conda_envs/140c117b8fe5c17c29da39e6b9fb5794
conda install -y scipy=1.8
conda deactivate

SilasK avatar Sep 29 '22 13:09 SilasK

Yes this is correct, it should be fixed in the new release of DRAM, but the later versions still get in there sometimes.

rmFlynn avatar Sep 29 '22 13:09 rmFlynn

I also encountered this error. I try to solved it derectly in scikit bio but it is not solved.

You can do:

conda activate /home/nwezejus/Peat_metagenome2022/ATLAS/databases/conda_envs/140c117b8fe5c17c29da39e6b9fb5794
conda install -y scipy=1.8
conda deactivate

It solved the problem. Thank you for your prompt reply.

Justan6 avatar Sep 29 '22 14:09 Justan6

Yes this is correct, it should be fixed in the new release, but the later versions still get in there sometimes.

It solved the problem. Thank you for your prompt reply.

Justan6 avatar Sep 29 '22 14:09 Justan6

There was no activity since some time. I hope your issue is solved in the mean time. This issue will automatically close soon if no further activity occurs.

Thank you for your contributions.

github-actions[bot] avatar Mar 18 '23 13:03 github-actions[bot]

It was fixed in the dram requirements, sorry for not updating here.

rmFlynn avatar Mar 20 '23 22:03 rmFlynn

There was no activity since some time. I hope your issue is solved in the mean time. This issue will automatically close soon if no further activity occurs.

Thank you for your contributions.

github-actions[bot] avatar May 20 '23 13:05 github-actions[bot]