-
Notifications
You must be signed in to change notification settings - Fork 5
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
curl error with readNWMdata #7
Comments
Hi @psavoy-usgs, I am not seeing this here: library(nwmTools)
xx = readNWMdata(comid = 17595383)
plot(xx$dateTime, xx$flow_cms_v2.1, type = "l") Created on 2023-07-12 by the reprex package (v2.0.1) Are you still getting this error? Thanks! |
@mikejohnson51 Yes I am still having this issue and have since updated R, Rtools, and Rstudio again but the issue remains. I am honestly not sure what might be causing the issue unless there is a versioning issue with some dependencies. I could see if I can replicate this error on my personal computer to perhaps isolate what is causing the issue on my work computer if that would be helpful. Here is my output from sessionInfo() , and I will clarify that I am also running Rtools 4.3. R version 4.3.0 (2023-04-21 ucrt) Matrix products: default locale: time zone: America/New_York attached base packages: other attached packages: loaded via a namespace (and not attached): |
I have asked several colleagues to run the code you provided and I think I am quite certain that the issue originated once I switched to R version 4.2. I am not sure of the root issue, but everyone on prior installations was able to run the code and everyone on 4.2 or later encountered the same error as myself. |
Interesting! Are they all on Windows systems? I am on 4.2.1 with a Mac and things are working. |
So I think that may be the issue, I have encountered other issues with curl and OS. We were all on windows machines but several of us have run into this kind of issue where it could not be reproduced on Mac/linux due to some interaction with how systems use curl. I can do some more digging to see if I can find similar examples. |
If it is useful I just checked my machine from the command line and have curl 8.0.1 and libcurl 8.0.1. I think there are instances that demonstrate curl behaves differently on Windows and Mac OS, but also just trying to rule out more obvious things like different system versions of curl. |
@program--, do you have any thoughts on this Windows/R Version/curl issue? |
@psavoy-usgs Are you by chance using a proxy or VPN? The error:
This error can happen if a proxy/VPN is handling SSL/TLS termination. One thing you could try is setting the environment variable In R you can do that like this: Sys.setenv(CURLOPT_SSL_VERIFYPEER = 0)
Additionally, R 4.2.2 introduced a bug fix for curl revocation checks that might give some info:
(from R release notes) If that doesn't give an indication to the issue, then could you try enabling curl verbosity with: Sys.setenv(CURLOPT_VERBOSE = 1) and appending the output of the code after enabling that to this thread? |
@program-- Thanks for the useful information. Since I am working from a government computer I do not want to mess with anything that results in less secure connections and draw the ire of the IT department. Your point about the 4.2.2 bugfix makes sense with the timing when this issue arose for me and agrees with other colleagues that were or were not able to run the code. I tried running things again with the verbose settings and this is what I have:
I consistently pull a lot of data so I am not sure specifically what the culprit is for this issue with this package. I tried this both on and off a VPN and get the same error regardless. |
The verbose message:
implies (but doesn't necessarily confirm) there is something responding with a certificate that shadows the SSL cert of My best guess is that this is something you'd need to inquire your IT department about, since if your GFE is configured with a proxy, then IT should've ensured that it's responding certificates are trusted on the client. One more test you could do, if you're able to, is try the same code on a non-government computer, since if that works then the issue isn't GFE-specific. Alternatively, reverting to R 4.2.1 might work? From an IT perspective as well: I think that enabling EDIT: I do agree that it is weird though that it seems to manifest primarily when using this package. If you try to do a GET request on a different thredds server being hosted somewhere else, I wonder if it would give the same issue. |
@psavoy-usgs Did you ever get this issue solved? I'm running into the same issue running this from a USGS machine. |
I've previously used the package to download >10,000 reaches of data without issue. However, now readNWMdata gives me the following error.
readNWMdata(comid = 17595383)
Note:Caching=1
Error:curl error: SSL peer certificate or SSH remote key was not OK
curl error details:
Warning:oc_open: Could not read url
Error in open.nc(call.meta$url[1]) : NetCDF: I/O failure
I suspected it was perhaps an issue with my R version so just updated R, Rstudio, and all packages but the issue persists. The only other thing I could think of is that the thredds url has changed again.
System details
R version: 4.2.3
Rtools version 4.2
curl version 5.0.0
The text was updated successfully, but these errors were encountered: