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

XML error when querying or downloading MACAv2MetData downscaled daily climate data via geoknife #434

Open
flakesw opened this issue Jun 5, 2023 · 3 comments

Comments

@flakesw
Copy link

flakesw commented Jun 5, 2023

I'm looking to use geoknife to access the University of Idaho MACAv2MetData product. I've done so in the past without any issues, but I've recently encountered an error that, as far as I can tell, is only affecting the daily future MACAv2MetData product (https://cida.usgs.gov/thredds/dodsC/macav2metdata_daily_future). I was able to download it using the GeoData Portal, so I think it's not an issue with the data itself. The other MACAv2MetData products are working as expected (i.e., the daily historical product and monthly products), and so are all the other products I've tested.

> webdatasets = query('webdata')
> webdatasets[58]
An object of class "datagroup":
[1] Daily Future Multivariate Adaptive Constructed Analogs (MACA) CMIP5 Statistically Downscaled Data for Coterminous USA 
  url: https://cida.usgs.gov/thredds/dodsC/macav2metdata_daily_future 
> fabric <- webdata(webdatasets[58])
> query(fabric, 'variables')
Error in read_xml.raw(charToRaw(enc2utf8(x)), "UTF-8", ..., as_html = as_html,  : 
  Opening and ending tag mismatch: META line 2 and HEAD [76]

Here's the traceback:

13: read_xml.raw(charToRaw(enc2utf8(x)), "UTF-8", ..., as_html = as_html, 
        options = options)
12: read_xml.character(iconv(readBin(response$content, character()), 
        from = "UTF-8", to = "UTF-8"))
11: xml2::read_xml(iconv(readBin(response$content, character()), 
        from = "UTF-8", to = "UTF-8"))
10: gcontent(response)
9: xml2::xml_find_all(gcontent(response), "//gdp:shortname")
8: xml2::xml_text(xml2::xml_find_all(gcontent(response), "//gdp:shortname"), 
       )
7: variables_query(fabric, knife)
6: variables_query(fabric, knife)
5: variables_query(fabric = new("webdata", times = structure(c(NA_real_, 
   NA_real_), class = c("POSIXct", "POSIXt"), tzone = "UTC"), url = "https://cida.usgs.gov/thredds/dodsC/macav2metdata_daily_future", 
       variables = NA_character_, dataList = "gov.usgs.cida.gdp.wps.algorithm.discovery.ListOpendapGrids", 
       timeList = "gov.usgs.cida.gdp.wps.algorithm.discovery.GetGridTimeRange"))
4: variables_query(fabric = new("webdata", times = structure(c(NA_real_, 
   NA_real_), class = c("POSIXct", "POSIXt"), tzone = "UTC"), url = "https://cida.usgs.gov/thredds/dodsC/macav2metdata_daily_future", 
       variables = NA_character_, dataList = "gov.usgs.cida.gdp.wps.algorithm.discovery.ListOpendapGrids", 
       timeList = "gov.usgs.cida.gdp.wps.algorithm.discovery.GetGridTimeRange"))
3: do.call(paste0(field, "_query"), args)
2: query(fabric, "variables")
1: query(fabric, "variables")

I did recently update R, so perhaps it's an issue with a change in R or my local state, but I was able to replicate the error in both versions 4.2 and 4.3, and before and after cleaning my RStudio environment. I'm using geoknife 1.6.10. R version info below.

Thank for any advice on troubleshooting this error!

Sam

> R.Version()
$platform
[1] "x86_64-w64-mingw32"

$arch
[1] "x86_64"

$os
[1] "mingw32"

$crt
[1] "ucrt"

$system
[1] "x86_64, mingw32"

$status
[1] ""

$major
[1] "4"

$minor
[1] "3.0"

$year
[1] "2023"

$month
[1] "04"

$day
[1] "21"

$`svn rev`
[1] "84292"

$language
[1] "R"

$version.string
[1] "R version 4.3.0 (2023-04-21 ucrt)"

$nickname
[1] "Already Tomorrow"
@dblodgett-usgs
Copy link
Collaborator

Thanks for the report. I'm able to reproduce this.

Looking in a little further, something is timing out and failing. I'll need to do a bit more digging to see what might be causing the issue.

@flakesw
Copy link
Author

flakesw commented Jun 6, 2023

Thanks for looking into it. No hurry on my end -- I was able to get everything I needed from the GeoData Portal.

@dblodgett-usgs
Copy link
Collaborator

dblodgett-usgs commented Jun 6, 2023 via email

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

2 participants