Skip to content

ExtractionError when running taxopy on several samples in parallel with specified dmp files and keep_files=True #1

@dawnmy

Description

@dawnmy

I use taxopy to find the LCA of taxids from a sample.

cd = path.dirname(path.abspath(__file__))

nodes_dmp_file = path.join(cd, "../data/nodes.dmp")
names_dmp_file = path.join(cd, "../data/names.dmp")

taxdb = taxopy.TaxDb(nodes_dmp=nodes_dmp_file,
                     names_dmp=names_dmp_file,
                     keep_files=True)

This is how I create the DB. Running the script sample by sample was fine without any error. But when I try to run it on several samples in parallel, I got the error below:

Traceback (most recent call last):
  File "/home/user/miniconda3/lib/python3.7/tarfile.py", line 2163, in makefile
    copyfileobj(source, target, tarinfo.size, ReadError, bufsize)
  File "/home/user/miniconda3/lib/python3.7/tarfile.py", line 250, in copyfileobj
    dst.write(buf)
OSError: [Errno 116] Stale file handle

During handling of the above exception, another exception occurred:

OSError: [Errno 116] Stale file handle

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/miniconda3/lib/python3.7/site-packages/taxopy/core.py", line 108, in _download_taxonomy
    tf.extract("nodes.dmp", path=self._taxdb_dir)
  File "/home/user/miniconda3/lib/python3.7/tarfile.py", line 2044, in extract
    numeric_owner=numeric_owner)
  File "/home/user/miniconda3/lib/python3.7/tarfile.py", line 2114, in _extract_member
    self.makefile(tarinfo, targetpath)
  File "/home/user/miniconda3/lib/python3.7/tarfile.py", line 2163, in makefile
    copyfileobj(source, target, tarinfo.size, ReadError, bufsize)
OSError: [Errno 116] Stale file handle

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/vol/projects/user/projects/tax.py", line 22, in <module>
    taxdb = taxopy.TaxDb()
  File "/home/user/miniconda3/lib/python3.7/site-packages/taxopy/core.py", line 87, in __init__
    self._nodes_dmp, self._names_dmp = self._download_taxonomy()
  File "/home/user/miniconda3/lib/python3.7/site-packages/taxopy/core.py", line 112, in _download_taxonomy
    "Something went wrong while extracting the taxonomy files."
taxopy.exceptions.ExtractionError: Something went wrong while extracting the taxonomy files.

It seems trying to download and extract the dmp files even the dmp files are specified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions