cov-lineages / pangolin

Software package for assigning SARS-CoV-2 genome sequences to global lineages.
GNU General Public License v3.0
427 stars 107 forks source link

How to stop writing to read-only home directory #533

Closed erinyoung closed 10 months ago

erinyoung commented 10 months ago

I am unsure why pangolin is trying to write to my home directory, but I need it to NOT write there (it's read only).

This is my command (I'm using tempdir here because I thought it would help) :

pangolin        --threads 4       --outdir pangolin       --tempdir temp    ultimate_fasta.fasta 

The error I got:

  Traceback (most recent call last):
    File "/opt/conda/envs/pangolin/lib/python3.8/site-packages/snakemake/__init__.py", line 587, in snakemake
      workflow = Workflow(
    File "/opt/conda/envs/pangolin/lib/python3.8/site-packages/snakemake/workflow.py", line 242, in __init__
      self.sourcecache = SourceCache()
    File "/opt/conda/envs/pangolin/lib/python3.8/site-packages/snakemake/sourcecache.py", line 358, in __init__
      os.makedirs(self.cache, exist_ok=True)
    File "/opt/conda/envs/pangolin/lib/python3.8/os.py", line 213, in makedirs
      makedirs(head, exist_ok=exist_ok)
    File "/opt/conda/envs/pangolin/lib/python3.8/os.py", line 213, in makedirs
      makedirs(head, exist_ok=exist_ok)
    File "/opt/conda/envs/pangolin/lib/python3.8/os.py", line 213, in makedirs
      makedirs(head, exist_ok=exist_ok)
    [Previous line repeated 1 more time]
    File "/opt/conda/envs/pangolin/lib/python3.8/os.py", line 223, in makedirs
      mkdir(name, mode)
  OSError: [Errno 30] Read-only file system: '/home/eriny'
aineniamh commented 10 months ago

Hi @erinyoung, I'm not sure why this is happening- what's your current working directory when running pangolin?

erinyoung commented 10 months ago

/Volumes/IDGenomics_Nas/testing

(A mounted directory)

aineniamh commented 10 months ago

Hmm, what happens if you give full paths for the temp and outdir? Those should be the only two places written to, so i think something is happening with them. It could be to do with the mounting, I've not tested really on mounted directories!

theosanderson commented 10 months ago

Looking over this log (sorry, randomly watching this repo. not a pangolin dev!) it looks like this might be a built in Snakemake feature to cache source code. Try setting the XDG_CACHE_HOME environmental variable e.g. export XDG_CACHE_HOME=/tmp/mycache, or maybe refer to https://github.com/snakemake/snakemake/issues/1593

erinyoung commented 10 months ago

Thank you @theosanderson ! XDG_CACHE_HOME=/tmp appears to have fixed things.