Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate upstream issue with netcdf4==1.7.1 on Linux. Pin netcdf4 for now #213

Open
3 of 5 tasks
blakeNaccarato opened this issue Jun 21, 2024 · 0 comments · Fixed by #215
Open
3 of 5 tasks

Investigate upstream issue with netcdf4==1.7.1 on Linux. Pin netcdf4 for now #213

blakeNaccarato opened this issue Jun 21, 2024 · 0 comments · Fixed by #215
Labels
bug Something isn't working

Comments

@blakeNaccarato
Copy link
Member

blakeNaccarato commented Jun 21, 2024

Progress

Please check that this bug hasn't been reported before

  • I searched here or here and couldn't find a similar issue.

Please confirm that this bug affects the latest version

  • This bug affects version 0.0.1 of boilercv.

Please indicate which operating system(s) you are using

  • Linux
  • macOS
  • Windows

Expected behavior

NetCDF files should be readable via xarray.open_dataset on all operating systems, including Linux.

Current behaviour

Receiving OSError: [Errno -101]. Some NetCDF files are failing to read in Linux CI. This also happens when tested locally in WSL2 Ubuntu. See the full traceback below.

Full traceback
Traceback (most recent call last):
  File "/home/user/code/mine/boilercv/.venv/lib/python3.11/site-packages/xarray/backends/file_manager.py", line 211, in _acquire_with_cache_info
    file = self._cache[self._key]
           ~~~~~~~~~~~^^^^^^^^^^^
  File "/home/user/code/mine/boilercv/.venv/lib/python3.11/site-packages/xarray/backends/lru_cache.py", line 56, in __getitem__
    value = self._cache[key]
            ~~~~~~~~~~~^^^^^
KeyError: [<class 'netCDF4._netCDF4.Dataset'>, ('/home/user/code/mine/boilercv/docs/data/uncompressed_filled/2023-09-20T17-14-18.nc',), 'r', (('clobber', True), ('diskless', False), ('format', 'NETCDF4'), ('persist', False)), '1a3953ac-3186-4b75-ad73-e4c909dfb9bd']

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/user/code/mine/boilercv/.venv/lib/python3.11/site-packages/xarray/backends/api.py", line 570, in open_dataset
    backend_ds = backend.open_dataset(
                 ^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/code/mine/boilercv/.venv/lib/python3.11/site-packages/xarray/backends/netCDF4_.py", line 602, in open_dataset
    store = NetCDF4DataStore.open(
            ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/code/mine/boilercv/.venv/lib/python3.11/site-packages/xarray/backends/netCDF4_.py", line 400, in open
    return cls(manager, group=group, mode=mode, lock=lock, autoclose=autoclose)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/code/mine/boilercv/.venv/lib/python3.11/site-packages/xarray/backends/netCDF4_.py", line 347, in __init__
    self.format = self.ds.data_model
                  ^^^^^^^
  File "/home/user/code/mine/boilercv/.venv/lib/python3.11/site-packages/xarray/backends/netCDF4_.py", line 409, in ds
    return self._acquire()
           ^^^^^^^^^^^^^^^
  File "/home/user/code/mine/boilercv/.venv/lib/python3.11/site-packages/xarray/backends/netCDF4_.py", line 403, in _acquire
    with self._manager.acquire_context(needs_lock) as root:
  File "/home/user/code/mine/boilercv/bin/python3.11/lib/python3.11/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "/home/user/code/mine/boilercv/.venv/lib/python3.11/site-packages/xarray/backends/file_manager.py", line 199, in acquire_context
    file, cached = self._acquire_with_cache_info(needs_lock)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/code/mine/boilercv/.venv/lib/python3.11/site-packages/xarray/backends/file_manager.py", line 217, in _acquire_with_cache_info
    file = self._opener(*self._args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "src/netCDF4/_netCDF4.pyx", line 2470, in netCDF4._netCDF4.Dataset.__init__
  File "src/netCDF4/_netCDF4.pyx", line 2107, in netCDF4._netCDF4._ensure_nc_success
OSError: [Errno -101] NetCDF: HDF error: '/home/user/code/mine/boilercv/docs/data/uncompressed_filled/2023-09-20T17-14-18.nc'

Steps to reproduce

Install netcdf4==1.7.1 on Linux and run an affected notebook, e.g. docs/experiments/e230920_subcool/find_centers.ipynb.

Possible solution

Should visit upstream at xarray and netcdf4 to see what might be causing it.

@blakeNaccarato blakeNaccarato added the bug Something isn't working label Jun 21, 2024
@github-project-automation github-project-automation bot moved this from Do to Done in boilercv Jun 26, 2024
@github-project-automation github-project-automation bot moved this from Done to Doing in boilercv Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Doing
Development

Successfully merging a pull request may close this issue.

1 participant