-
Notifications
You must be signed in to change notification settings - Fork 264
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
opendap error with version 1.7.0 #1335
Comments
I can reproduce that error on Linux:
It is probably a regression b/c we are using the built-in curl library to build it. I'm working on a docker image that will have the same libraries as the previous wheels. |
same error when launch this inside a dockered API... thanks! |
Looks like we need these unreleased commits: and the previous wheel was built against latest code instead of a release: MacPython/netcdf4-python-wheels@b611fcd I'm modifying the new wheel config to do the same but it would be nice to get a new release of netcdf-c from upstream. |
@aragong can you confirm that it indeed fixes the problem when you used 1.6.5? Or give more context? I tried:
and then your URL
However, the URL used to test this regression in the wheels do pass:
Or maybe that URL is changes every hour and I should be using https://ihthredds.ihcantabria.com/thredds/dodsC/IBI_ANALYSISFORECAST_PHY_005_001/IBI/hourly/IBI_2024061400.nc now? |
We fix the problem only changing the netcdf version to the previous one. 1.6.5 Pip uninstall netcdf4 -y No idea about certs and wheels @ocefpaf ... Sorry |
@aragong, while there is a problem with the latest wheel, I do believe that the URL you provided above it no longer valid. Can you check? I can confirm that the new wheel will work for the previous URLs that had that issue but I cannot test against the URL you reported above. |
Ah yes - I completely forgot about this, sorry. Since 4.9.3 has not been released yet, we do need to build against github develop. |
@WardF is working hard to getting 4.9.3 across the finish line right now. |
Sorry for the delay, I was out of the office! Still having the same error I test the following code: pip uninstall netcdf4 -y
pip install netcdf4 --no-cache-dir import xarray as xr
xr.open_dataset('https://ihthredds.ihcantabria.com/thredds/dodsC/GLOBAL_ANALYSIS_FORECAST_PHY_001_024/global/hourly/global_2024061600.nc') Error:curl error: Problem with the SSL CA cert (path? access rights?)
curl error details:
Warning:oc_open: Could not read url
Traceback (most recent call last):
File "/home/aragong/miniconda3/envs/TESEO.Apiprocess/lib/python3.12/site-packages/xarray/backends/file_manager.py", line 211, in _acquire_with_cache_info
file = self._cache[self._key]
~~~~~~~~~~~^^^^^^^^^^^
File "/home/aragong/miniconda3/envs/TESEO.Apiprocess/lib/python3.12/site-packages/xarray/backends/lru_cache.py", line 56, in __getitem__
value = self._cache[key]
~~~~~~~~~~~^^^^^
KeyError: [<class 'netCDF4._netCDF4.Dataset'>, ('https://ihthredds.ihcantabria.com/thredds/dodsC/GLOBAL_ANALYSIS_FORECAST_PHY_001_024/global/hourly/global_2024061600.nc',), 'r', (('clobber', True), ('diskless', False), ('format', 'NETCDF4'), ('persist', False)), '392d7c27-b1ce-44e3-88e0-20555338cc3c']
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/aragong/miniconda3/envs/TESEO.Apiprocess/lib/python3.12/site-packages/xarray/backends/api.py", line 573, in open_dataset
backend_ds = backend.open_dataset(
^^^^^^^^^^^^^^^^^^^^^
File "/home/aragong/miniconda3/envs/TESEO.Apiprocess/lib/python3.12/site-packages/xarray/backends/netCDF4_.py", line 646, in open_dataset
store = NetCDF4DataStore.open(
^^^^^^^^^^^^^^^^^^^^^^
File "/home/aragong/miniconda3/envs/TESEO.Apiprocess/lib/python3.12/site-packages/xarray/backends/netCDF4_.py", line 409, in open
return cls(manager, group=group, mode=mode, lock=lock, autoclose=autoclose)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aragong/miniconda3/envs/TESEO.Apiprocess/lib/python3.12/site-packages/xarray/backends/netCDF4_.py", line 356, in __init__
self.format = self.ds.data_model
^^^^^^^
File "/home/aragong/miniconda3/envs/TESEO.Apiprocess/lib/python3.12/site-packages/xarray/backends/netCDF4_.py", line 418, in ds
return self._acquire()
^^^^^^^^^^^^^^^
File "/home/aragong/miniconda3/envs/TESEO.Apiprocess/lib/python3.12/site-packages/xarray/backends/netCDF4_.py", line 412, in _acquire
with self._manager.acquire_context(needs_lock) as root:
File "/home/aragong/miniconda3/envs/TESEO.Apiprocess/lib/python3.12/contextlib.py", line 137, in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
File "/home/aragong/miniconda3/envs/TESEO.Apiprocess/lib/python3.12/site-packages/xarray/backends/file_manager.py", line 199, in acquire_context
file, cached = self._acquire_with_cache_info(needs_lock)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aragong/miniconda3/envs/TESEO.Apiprocess/lib/python3.12/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 -68] NetCDF: I/O failure: 'https://ihthredds.ihcantabria.com/thredds/dodsC/GLOBAL_ANALYSIS_FORECAST_PHY_001_024/global/hourly/global_2024061600.nc' @ocefpaf @jswhit I do not see any recent patch version... Thank you for your time! |
It is operational data, you can check the catalag here: https://ihthredds.ihcantabria.com/thredds/catalog/IBI_ANALYSISFORECAST_PHY_005_001/IBI/hourly/catalog.html sorry for the delay in my response! |
It will be fixed when a new release, or post release, is issued.Ultimately, the problem is not with netcdf4-python but with the underlying netcdf-c. If you are in a hurry you can re-build the wheel with latest netcdf-c from git source, or wait for a new release that will have the fix in it. |
Thank you very much for the clarification! |
I have been working on getting the new netCDF-C release out; the sticking point has been gathering together some |
Awesome! @jswhit we can:
What do you think? |
Hello,
We are suffering this error when we read a netcfd throgh opendap with new version 1.7.0, with a netcdf4 version rollback to version 1.6.5 the error dissapeard, hope it helps!
The text was updated successfully, but these errors were encountered: