ropensci-archive / bomrang

:warning: ARCHIVED :warning: Australian government Bureau of Meteorology (BOM) data client for R
Other
109 stars 26 forks source link

get_weather_bulletins() fails #133

Closed adamhsparks closed 3 years ago

adamhsparks commented 3 years ago

@mpadge, do you have any ideas? I've poked around a bit in the functionality here. I can't really determine what's going wrong with it.

I'd post a reprex, but I can't get that to work either. My network connection has issues finding the BOM website and right now it's not finding it. I'll update when I can.

adamhsparks commented 3 years ago

This is using the development version of bomrang where I've used @jonocarroll's USERAGENT switch to be able to access the BOM website through RStudio.

qld_weather <- get_weather_bulletin(state = "QLD", morning = FALSE)
Error: Assigned data `0.1` must be compatible with existing data.
ℹ Error occurred for column `rain_mm`.
x Can't convert <double> to <character>.
Run `rlang::last_error()` to see where the error occurred.
In addition: Warning messages:
1: In r2 == r1 :
  longer object length is not a multiple of shorter object length
2: In r2 == r1 :

 Error: Assigned data `0.1` must be compatible with existing data.
ℹ Error occurred for column `rain_mm`.
x Can't convert <double> to <character>.
Run `rlang::last_error()` to see where the error occurred. 
jonocarroll commented 3 years ago

This looks to be the same as #130 -- 403 blocked due to RStudio UserAgent.

> xml2::read_html("https://www.bom.gov.au")
Error in open.connection(x, "rb") : HTTP error 403.

> op <- options()
> options(HTTPUserAgent = "")
> xml2::read_html("https://www.bom.gov.au")
{html_document}
<html class="no-js">
[1] <head>\n<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n<title>HTTPS not supported - Bureau of Meteorology</title>\n<script language="Javas ...
[2] <body onload="start();">\n    <section class="page__container"><header class="header"><div class="header__logo">\n          <svg xmlns="http://www.w3.org/2000/s ...
> options(op)
adamhsparks commented 3 years ago

@jonocarroll, what's the same here? I've used your custom USERAGENT and it accesses the site but I get the error above about longer objects.

Even using your custom string, our network has serious issues finding websites. Using RStudio or a browser, hence my initial post problems.

jonocarroll commented 3 years ago

Sorry, I was debugging as you posted your update - I initially just got the 403 and thought that might have been the only problem. I haven't looked into the remaining issue.

adamhsparks commented 3 years ago

Our network here is rubbish. I can't get here to GitHub half the time.

mpadge commented 3 years ago

I can confirm something is up:

library (bomrang)
x <- get_weather_bulletin (state = "qld")
#> Warning in r2 == r1: longer object length is not a multiple of shorter object
#> length

#> Warning in r2 == r1: longer object length is not a multiple of shorter object
#> length
#> Error: Assigned data `0.1` must be compatible with existing data.
#> ℹ Error occurred for column `rain_mm`.
#> ✖ Can't convert <double> to <character>.

Created on 2021-03-25 by the reprex package (v1.0.0)

I'll check it out now