KarchinLab / open-cravat

A modular annotation tool for genomic variants
MIT License
110 stars 27 forks source link

Error retrieving file system type on SLURM compute node #150

Closed nathandloria closed 1 year ago

nathandloria commented 1 year ago

OC version: 2.3.0 Python version: 3.9.16 (miniconda3) OS: RHEL 7.9

I am executing the oc run command on a SLURM compute node, and receiving the following error:

Traceback (most recent call last):
  File "/scratch/prothber_lab/genexus/.src/software/miniconda3/py39_23.1.0-1/envs/gnx-dev/lib/python3.9/site-packages/cravat/cravat_class.py", line 336, in __init__
    self.metricObj = metrics.cravatMetrics()
  File "/scratch/prothber_lab/genexus/.src/software/miniconda3/py39_23.1.0-1/envs/gnx-dev/lib/python3.9/site-packages/cravat/cravat_metrics.py", line 27, in __init__
    self.gather_machine_data()
  File "/scratch/prothber_lab/genexus/.src/software/miniconda3/py39_23.1.0-1/envs/gnx-dev/lib/python3.9/site-packages/cravat/cravat_metrics.py", line 38, in gather_machine_data
    self.machinedata['fileSystem'] = psutil.disk_partitions()[0].fstype
IndexError: list index out of range

I was able to remedy the issue by inserting the code snippet below into cravat_metrics.py, replacing line 38:

try:
    self.machinedata['fileSystem'] = psutil.disk_partitions()[0].fstype
except IndexError:
    self.machinedata['fileSystem'] = psutil.disk_partitions(all=True)[0].fstype

When I run this on the default file system (not submitting a SLURM job) I do not get the error with the original code (without the modification to line 38).

Any ideas on upgrading certain packages (psutil, creating a new environment with a new Python version) to accommodate the original release code for OC?

kmoad commented 1 year ago

We'll get this fixed. In the meantime, does running oc config metrics n fix the problem?

nathandloria commented 1 year ago

Yeah, @kmoad, that worked great. I appreciate the help!