-
Notifications
You must be signed in to change notification settings - Fork 26
get_historical_weather does not respond #130
Comments
To further add to the confusion, the first example does appear to fetch the data. get_historical_weather(stationid = "023000", type = "max") |
Checking the first URL for a response indicates that it's OK. So we can't just check first and then stop. > curl -Is http://www.bom.gov.au/jsp/ncc/cdio/weatherData/av\?p_display_type\=dailyZippedDataFile\&p_stn_num\=070351\&p_c\=-989854804\&p_nccObsCode\=123 | head -1
> HTTP/1.1 200 OK |
Now the first example is failing too. BOM servers seem to have issues right now. |
Further access issues today. Call is:
Returns:
Accessing via curl ok:
Accessing from web browser loads the file. |
Sorry for the silence, I have been lurking. I get no issues from readLines("http://www.bom.gov.au/climate/data/lists_by_element/alphaAUS_136.txt") and expected data returned from
so maybe this is an intermittent issue (fun). The only thing I can think of is that while |
Hmm, it might be a client system thing. I tried some readLines() calls with mixed results. I had Restarted R so no explicit libraries loaded. The call to the BOM server failed again for me:
I then called w3.org (just another text file out there) and it worked:
My sessionInfo():
Note that I had upgraded BOMRang to the latest version:
I found a work around for my script, but like most of these things, it would be nice to work out what is going on at some stage! |
I'm also having the same issues, R 4.0.2 in RStudio 1.4.1103:
But its working fine directly through the R console... Both are without the bomrang package loaded, just checking access to BoM. Rstudio Session info: `sessionInfo() Matrix products: default locale: attached base packages: loaded via a namespace (and not attached): |
I should have mentioned that I tested in a terminal. I can reproduce the error from RStudio 1.4.1623 on Mac. I don't see any prominent discussions about it, so maybe reach out to Twitter or RStudio directly? |
For reference, this can be traced slightly upstream to |
Okay, it looks like the RStudio op <- options()
getOption("HTTPUserAgent")
#> [1] "RStudio Desktop (1.4.1623); R (3.6.2 x86_64-apple-darwin15.6.0 x86_64 darwin15.6.0)"
options(HTTPUserAgent = "")
readLines("http://www.bom.gov.au/climate/data/lists_by_element/alphaAUS_136.txt")
options(op) with success. My suggestion would be to add the following to op <- options()
on.exit(options(op))
options(HTTPUserAgent = "{bomrang} R package (0.7.4) https://github.com/ropensci/bomrang")
readLines(<file>) Maybe someone from BOM will file an issue... maybe they're deliberately blocking RStudio as a way to limit what bomrang does. |
@jonocarroll can confirm this is working for me too now. Thanks! |
Agree with @mattecologist, @jonocarroll, blanking the UserAgent works for me. In the interim, I just updated my script to put a wrapper around calls to get_historical() and the script worked. The wrapper is:
Thanks again! |
Thanks for teasing this out, @jonocarroll. We just moved into new offices and our network firewalls are causing some issues here so I wasn't going to be a good test case for this. That said, it does work. BOM's file serving seems to have been unstable lately. I was having issues in RStudio and the base console last week as noted that it didn't respond in R or the browser. Last week we were in the old offices, so I didn't have the same firewall issues I've had here since Monday. |
I'll try to make a PR to add this new user agent. It may end up being blocked specifically, in which case I'd say opening a line of communication to BOM may be prudent. |
update tests to use 0-padding on stationID closes #130
I’ve got it covered. I’m working on the package right now anyway. Thanks for the offer, @jonocarroll
…Sent from my iPad
On 19 Mar 2021, at 5:08 pm, Jonathan Carroll ***@***.***> wrote:
I'll try to make a PR to add this new user agent. It may end up being blocked specifically, in which case I'd say opening a line of communication to BOM may be prudent.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Oh, snap, neat timing. Check out my PR, it looks like this specific issue was the tip of the iceberg. |
I can confirm that on |
For a few weeks or up to a month or two now the CI tests have been failing on every OS tested.
So far I've updated the internal databases to reflect the latest metadata on stations and locations BOM has.
Here is an example URL not responding that's generated by the second example.
http://www.bom.gov.au/jsp/ncc/cdio/weatherData/av?p_display_type=dailyZippedDataFile&p_stn_num=070351&p_c=-989854804&p_nccObsCode=123
When attempting to fetch the zip file the URL does not respond in R or in the browser, but I am able to browse to the data and display a table in my browser window. But using this method provided by the BOM website, http://www.bom.gov.au/climate/data/stations/, and requesting the same station and trying to download any data fails. Presumably, there's an issue with the BOM server.
The text was updated successfully, but these errors were encountered: