h5netcdf: Regression: KeyError in h5py with h5netcdf 0.13.0

The CI of fluidsim was broken by the release of h5netcdf 0.13.0. I get a lot of KeyError: 'Unable to delete attribute (record is not in B-tree)' with tracebacks looking like

    gf_params.attrs["SAVE"] = 1
  File "/builds/fluiddyn/fluidsim/.tox/py37-fft/lib/python3.7/site-packages/h5netcdf/attrs.py", line 44, in __setitem__
    self._h5attrs[key] = value
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "/builds/fluiddyn/fluidsim/.tox/py37-fft/lib/python3.7/site-packages/h5py/_hl/attrs.py", line 103, in __setitem__
    self.create(name, data=value)
  File "/builds/fluiddyn/fluidsim/.tox/py37-fft/lib/python3.7/site-packages/h5py/_hl/attrs.py", line 208, in create
    h5a.delete(self._id, self._e(name))
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5a.pyx", line 145, in h5py.h5a.delete
KeyError: 'Unable to delete attribute (record is not in B-tree)'

By pinning h5netcdf to 0.12.0, the CI is green again.

Any idea of what can cause this issue ?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 25 (11 by maintainers)

Most upvoted comments

Good news, I can easily reproduce locally with the most recent versions of h5py (3.6.0) and h5netcdf (0.13.0).

There is no file created with older versions of these packages.

The error happens for example in this line https://foss.heptapod.net/fluiddyn/fluidsim/-/blob/branch/default/fluidsim/util/output.py#L121 for the (simplest) case for which mpi.nb_proc == 1 and not cfg_h5py.mpi. Basically a file a created, data is added and groups are created with attributes.

I will try to provide a minimal example reproducing the bug soon.

Oh I forgot to say thank you @hmaarrfk and @kmuehlbauer for your work on this issue and on h5netcdf in general! It’s really a very useful and nice package.