SeismicData / pyasdf

Python Interface to ASDF based on ObsPy
http://seismicdata.github.io/pyasdf/
BSD 3-Clause "New" or "Revised" License
53 stars 30 forks source link

Error @opening after copying pyasdf-archive #70

Closed gfz-chw closed 3 years ago

gfz-chw commented 3 years ago

Hi there, hi Lion,

I have an issue opening an asdf-archive with pyasdf. It works perfectly on one system/server. But after copying it to another I obtain the error message below. Has this to do with an erroneous copying, permission or with differences in the installation of pyasdf? I am afraid I do not understand the error message regarding "missing locks" and would appreciate your educated guess on my mistake and your help.

Some more general details on my procedure:

Looking forward to hearing from you.

With best regards, Christopher

Error message at attempting to load asdf dataset

In [2]: ds = pyasdf.ASDFDataSet('cube_waveforms.h5')

OSError Traceback (most recent call last)

in ----> 1 ds = pyasdf.ASDFDataSet('cube_waveforms.h5') ~/miniforge3/envs/obspy/lib/python3.7/site-packages/pyasdf/asdf_data_set.py in __init__(self, filename, compression, shuffle, debug, mpi, mode, single_item_read_limit_in_mb, format_version) 205 # Open file or take an already open HDF5 file object. 206 if not self.mpi: --> 207 self.__file = h5py.File(filename, mode=mode) 208 else: 209 self.__file = h5py.File( ~/miniforge3/envs/obspy/lib/python3.7/site-packages/h5py/_hl/files.py in __init__(self, name, mode, driver, libver, userblock_size, swmr, rdcc_nslots, rdcc_nbytes, rdcc_w0, track_order, fs_strategy, fs_persist, fs_threshold, **kwds) 445 fapl, fcpl=make_fcpl(track_order=track_order, fs_strategy=fs_strategy, 446 fs_persist=fs_persist, fs_threshold=fs_threshold), --> 447 swmr=swmr) 448 449 if isinstance(libver, tuple): ~/miniforge3/envs/obspy/lib/python3.7/site-packages/h5py/_hl/files.py in make_fid(name, mode, userblock_size, fapl, fcpl, swmr) 209 # existing one (ACC_EXCL) 210 try: --> 211 fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl) 212 except FileNotFoundError: 213 fid = h5f.create(name, h5f.ACC_EXCL, fapl=fapl, fcpl=fcpl) h5py/_objects.pyx in h5py._objects.with_phil.wrapper() h5py/_objects.pyx in h5py._objects.with_phil.wrapper() h5py/h5f.pyx in h5py.h5f.open() OSError: [Errno 37] Unable to open file (unable to lock file, errno = 37, error message = 'No locks available')
gfz-chw commented 3 years ago

Hi There, Hi Lion,

after some superficial research (this is not my field of expertise), I have the feeling, that the issue is likely due to some erroneous filesystem/mount or so on the destination server. I have contacted the responsible admins and would come back to you only if the issue prevails or the admins come back with questions.

Thanks for listening. Best, Christopher

krischer commented 3 years ago

Hi Christopher,

yes this is likely due to the filesystem. There might be a few workarounds here: https://github.com/h5py/h5py/issues/1101

You can also try to open in read only mode with pyasdf.ASDFDataSet(..., mode="r"). HDF5 is general somewhat reliant on the features of the underlying filesystem.