GEOparse icon indicating copy to clipboard operation
GEOparse copied to clipboard

Missing File Error when GEO is Down

Open Miserlou opened this issue 6 years ago • 1 comments

When NCBI/GEO is down, I'd expect a custom exception or some kind of graceful handling, instead you get:

  File "/home/user/data_refinery_foreman/surveyor/geo.py", line 222, in create_experiment_and_samples_from_api
    gse = GEOparse.get_GEO(experiment_accession_code, destdir=self.get_temp_path(), how="brief", silent=True)
  File "/usr/local/lib/python3.5/dist-packages/GEOparse/GEOparse.py", line 84, in get_GEO
    return parse_GSE(filepath)
  File "/usr/local/lib/python3.5/dist-packages/GEOparse/GEOparse.py", line 502, in parse_GSE
    with utils.smart_open(filepath) as soft:
  File "/usr/lib/python3.5/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/usr/local/lib/python3.5/dist-packages/GEOparse/utils.py", line 156, in smart_open
    fh = fopen(filepath, mode, errors="ignore")
  File "/usr/lib/python3.5/gzip.py", line 53, in open
    binary_file = GzipFile(filename, gz_mode, compresslevel)
  File "/usr/lib/python3.5/gzip.py", line 163, in __init__
    fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/1/GSE11915_family.soft.gz'

which looks like it's a local disk error, which it isn't, it's a GEO-is-down-error.

Miserlou avatar Jan 29 '19 21:01 Miserlou

Hi, thanks for pointing this out. I never had this issue but you are right. It should be checked for timeout or any other http error and the exception should tell it.

guma44 avatar Jan 30 '19 07:01 guma44