EPATADA icon indicating copy to clipboard operation
EPATADA copied to clipboard

'NHDPlus_HR.MapServer' not found

Open cristinamullin opened this issue 1 year ago • 5 comments

Describe the bug

TADA_GetATTAINS runs fetchNHD within it. See line 511 in GeospatialFunctions.R

nhd_plus_hr_url <- "https://hydro.nationalmap.gov/arcgis/rest/services/NHDPlus_HR/MapServer"

This causes a breaking check error if the service is not available.

See check errors:

  • https://github.com/USEPA/EPATADA/actions/runs/11842695612/job/33001900764
  • https://github.com/USEPA/EPATADA/actions/runs/11842695612/job/33001901162
  --- re-building ‘TADAModule2.Rmd’ using rmarkdown
  
  Quitting from lines 299-300 [unnamed-chunk-8] (TADAModule2.Rmd)
  Error: processing vignette 'TADAModule2.Rmd' failed with diagnostics:
  Status code: 500
  Error: Error handling service request :Service configuration
      'NHDPlus_HR.MapServer' not found.
  --- failed re-building ‘TADAModule2.Rmd’

Expected behavior

Can we develop a solution that makes it possible for TADA_GetATTAINS to run even if this service is temporarily unavailable or if a user is offline? Or maybe if it fails initially it can be setup to retry at least once.

cristinamullin avatar Nov 14 '24 18:11 cristinamullin

@kathryn-willi do you have any ideas about how to best handle this scenario?

cristinamullin avatar Nov 14 '24 18:11 cristinamullin

For a short term fix, to address just the issue of the checks failing related to vignettes requiring the NHDPlus_HR.MapServer, switching the vignette to an article (which is still displayed on the pkgdown site, but not included in the package) because this adds it to .Rbuildignore may work.

I set up a few demos as articles over the summer to prevent some intermittent issues with ATTAINS webservices from causing checks to fail when I was working on unrelated updates.

hillarymarler avatar Nov 14 '24 18:11 hillarymarler

https://r-pkgs.org/vignettes.html#sec-vignettes-article " An article will be less accessible than a vignette, for certain users, such as those with limited internet access, because it is not present in the local installation. But that might be an acceptable compromise, for example, for a package that wraps a web API."

hillarymarler avatar Nov 14 '24 18:11 hillarymarler

I like that idea. Let's do that for any vignettes (switch them to articles) that require any services (WQP, ATTAINS, NHD, etc.). If the vignette only requires example data and no service calls, then they can stay in the package.

cristinamullin avatar Nov 14 '24 18:11 cristinamullin

That option makes sense to me, and seems totally justifiable!

kathryn-willi avatar Nov 14 '24 18:11 kathryn-willi