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

Timeout? #60

Closed
jhollist opened this issue Nov 21, 2017 · 9 comments
Closed

Timeout? #60

jhollist opened this issue Nov 21, 2017 · 9 comments

Comments

@jhollist
Copy link
Contributor

jhollist commented Nov 21, 2017

Trying to grab the latest with lagosne_get("1.087.1") and the request times out.

File downloads but then returns:

Error in curl::curl_fetch_memory(url, handle) : 
  Timeout was reached: Connection timed out after 10860 milliseconds

Throws that upon line 29 in get.R.

the curl_fetch_memory in get_file_names chokes. I haven't used that before so just grasping at straws, but perhaps httr::GET and httr::write_disk might be a good replacement so as to allow passing of configs such as timeout?

That is as far as I got on a fix, because I, amusingly, ran out of time! Placing this issue to record the problem and if I can, will try to work on a solution.

@jsta
Copy link
Member

jsta commented Nov 21, 2017

This error pops up in a number of other packages (see ropensci/neotoma#209 and jeroen/curl#72). I have seen it happen on a machine behind a strict firewall. I tried to fix by increasing the timeout but had no luck.

@jhollist
Copy link
Contributor Author

Hmm...

I am sure we don't have a permissive firewall! But it is odd that it works for the locus, but not for limno or geo. Suggests something else to me..

I'll see if I can carve out some time to look at it. If I can get it working on the EPA network it should work anywhere!

@limnoliver
Copy link
Collaborator

I get a lot of curl errors at the USGS. Does running the following work for you?

httr::set_config(config(ssl_verifypeer = 0L))

@jhollist
Copy link
Contributor Author

Thanks for that suggestion, @limnoliver. Unfortunately, didn't do the trick for me.

I might be able to carve out some time to dig into this to see if I can figure out a solution. Stay tuned.

@jhollist
Copy link
Contributor Author

Let me preface all of this with the fact that I know very little about the various data portals available for this. With that...

I did find this data also on https://portal.edirepository.org/nis/mapbrowse?packageid=edi.101.2. And that link works and you can use with the entityid to grab the filename. For instance:

headers <- curl::parse_headers(
+     curl::curl_fetch_memory("https://portal.edirepository.org/nis/dataviewer?packageid=edi.101.2&entityid=dea6da629bab1338a3d564ce3bd49fea", handle)$headers)

Is there a problem using the edirepository as opposed to (or as an option to) pasta.lternet.edu?

@jhollist
Copy link
Contributor Author

And, I think it is working from the edi repository in https://github.com/jhollist/LAGOSNE

I'll look a bit more after the holiday.

Happy Thanksgiving!

@jsta
Copy link
Member

jsta commented Nov 29, 2017

Looks great! I think that should work for everyone regardless of prior lack of timeout issues. You up for submitting a PR?

@jhollist
Copy link
Contributor Author

I am! Wanted to make sure you all were OK prior to doing that. Should be able to get to it sometime today.

@jhollist
Copy link
Contributor Author

Just submitted a PR (#61) Now to start playing with the data (we have a paper idea we are working on and hope to use LAGOSNE for it).

@jsta jsta closed this as completed Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants