-
Notifications
You must be signed in to change notification settings - Fork 263
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 access crash only with pip installation in ubuntu-latest SO #1246
Comments
Does ncdump work on that URL? If so, then it's a python interface issue, if not it's a netcdf-c lib issue. |
I tried this in a google colab script 1 - I intalled netcdf4 using pip --> OK I am totally lost! thank you in advance! Is it something wrong with the installation of the ubuntu-latests? or when pip installs netcdf4 some requirement is lost? |
I think it is the same issue. The problem seems to be with the openssl used in the Linux wheel. (It does not happen in both macOS and Windows wheels.) |
I rebuilt the linux wheels with a newer version of openssl (1.1.1l instead of 1.0.2). The wheels are at https://github.com/MacPython/netcdf4-python-wheels/releases/tag/v1.6.3rel - @aragong could you give one of these a try? |
I tested them locally and no luck. I guess that Unidata/netcdf-c#2459 was closed prematurely. Something in the SSL CA cert is not OK. |
I gave it a try in google colab and it is still crashing, same error (-68), I let you the link to the script here Also I have one extra doubt: Edit: Now installing your wheel I do NOT have to install netcdf-bin with apt... This behavior change again! I am nor even more confused! 😅 |
I added a test using the URL https://icdc.cen.uni-hamburg.de/thredds/dodsC/ftpthredds/hamtide//m2.hamtide11a.nc to the wheel building workflow, and I get failures on Ubuntu. However, adding the same test to the github actions workflow in the netcdf4-python repo, I don't get failures. Must be either be something in the Ubuntu environment, or the versions of the lib dependencies (most likely ssl or curl). |
updating openssl to 3.0.1 and curl to 8.0.1 doesn't help. As @ocefpaf suggested it's most likely something to do with the CA cert process happening in libcurl (discussion at Unidata/netcdf-c#2459). |
would really like to solve this, but I'm out of ideas right now. I'm tempted to blame a netcdf-c bug, save for the fact that it does work with curl installed via conda or apt-get on Ubuntu. This makes me think it still might be an issue with the way we are building ssl and/or curl. |
Maybe we could try to reduce the scope of ocefpaf/netcdf4-win-wheels#6 (no macOS, ppc, and aarch) and build the Linux wheels that way too. |
Try the following to get more info:
|
Thanks @DennisHeimbigner that suggestion helped. I was able to confirm that running ncdump with that URL right after the library is built works. Somehow after the libs are copied into the wheel and installed on another system the CA cert stuff no longer works. Maybe an environment variable needs to be set to point to the location of the certificates? this is the error:
/etc/pki/tls/certs is the location of the certificates on the manylinux distro, I think on Ubuntu they live in /etc/ssl/certs |
I do not know how curl finds that certs location; you might do some googling to see if you can find out.
|
I notice the following options for building libcurl using Automake; I presume that CMake has similar options.
|
this seems relevent OSGeo/PROJ#2320 |
setting HTTP.SSL.CAPATH in .ncrc does not work - it's still looking for the certs in /etc/pki/tls/certs/ca-bundle.crt |
Oops, there are two possibilities:
|
netcdf-c doesn't seem to be using ~/.ncrc.
|
I had trouble setting all env vars and rc files with the previous wheels. I think this should be patched at netcdf-c, like proj did. |
@aragong so far the only workaround that I can suggest is to copy or link the certs on your system to /etc/pki/tls/certs. On Ubuntu, I think this should work:
|
What version of netcdf-c are you using? |
4.9.1 |
re: Issue Unidata/netcdf4-python#1246 This provides a **partial** solution to the above PR. The underlying problem is with libcurl, but at least a workaround should be possible by creating a "~/.ncrc" file containing the line "HTTP.SSL_CAINFO=\<path to the cert (.crt) file\>". This was not working for obscure reasons. This PR should fix it. ## Misc. Other Changes * Update/fix configure.ac to properly test for libcurl version >= 7.66.0 * Update include/netcdf_json.h * Remove use of strlcat from plugins. * Fix applicability of .rc file entries
Put up a partial fix (PR Unidata/netcdf-c#2690) to at least |
Using the fix in PR Unidata/netcdf-c#2690, plus the nc_rc_set function added in version 4.9.1 to set the cert path provided by certifi (see PR #1247), the tests now pass for the wheels. Once the PRs are merged, I can rebuilt the wheels with netcdf-c master and https opendap URLs should work with the linux wheels. |
Hi again, I success to run the example downgrading netcdf4 to v1.5.8 in a google collaboratory machine. I think this is the easiest workaround so far for inexperienced people like myself. So far today for any version higher to netcdf4 v1.5.8 I suffer the same error. google colab example The drawback of this downgrade is that pip can't manage my requirements installation for python 3.11. (see installation log) `Run pip install "." × Getting requirements to build wheel did not run successfully.
note: This error originates from a subprocess, and is likely not a problem with pip. × Getting requirements to build wheel did not run successfully. note: This error originates from a subprocess, and is likely not a problem with pip. Notice: A new release of pip is available: 22.3.1 -> 23.1.2 |
fix for https OpenDAP URLs with linux wheels (issue #1246)
@aragong new 1.6.4 linux wheels are now on pypi that should fix this problem. Can you try and verify that it indeed does work now? |
Now runs properly but still, there is an error with one xarray dependency. I needed to install h5pyd before installing xarray [complete].
I suppose that there is some change in this dependency that is not implemented in xarray, is it possible? (xarray[complete] should install all the dependencies including the necessary ones to access opendap) I mention xarray original issue to be informed pydata/xarray#7773 |
Hi, I am suffering crashes in my github action tests only when I use netCDF4 opendap access (I tried several datasets in different urls/servers) installed with
pip install netCDF4
andubuntu-latest
machines.I supposse that could be an xarray related error but seems to be a problem in the installation related with netCDF4. view issue in xarray repository: pydata/xarray#7773
I also obtain this error if I use google colab platform that I suppose that use the same environment in ubunutu-latest SO.
I think that is related to this other opened issue... not sure! #1179
Thank you in advance!
To report a non-security related issue, please provide:
If you have a general question about the software, please view our Suggested Support Process.
The text was updated successfully, but these errors were encountered: