[R-pkg-devel] Rmarkdown package vignette that reference online images: how to fail gracefully?

Vinh Nguyen v|nhd|zzo @end|ng |rom gm@||@com
Tue Oct 3 23:52:26 CEST 2023


Dear members of R-package-devel,

CRAN has the following policy: Packages which use Internet resources
should fail gracefully with an informative message if the resource is
not available or has changed (and not give a check warning nor error).

I have a CRAN-accepted package with vignettes that use Rmarkdown. One
of the vignettes involves a lot of images, so rather than embed the
raw images in the vignette, I reference the images on Flickr (to keep
the package size small enough to be hosted on CRAN). Every half year
or so, I'll get a message from CRAN maintainers that the package is
not failing gracefully on one of their servers due to their build and
testing processes.  The error message looks as follows:

Could not fetch
https://live.staticflickr.com/65535/52281215570_5f9cc90a12_o.png
     HttpExceptionRequest Request {
      host = "live.staticflickr.com"
      port = 443
      secure = True
      requestHeaders = []
      path = "/65535/52281215570_5f9cc90a12_o.png"
      queryString = ""
      method = "GET"
      proxy = Nothing
      rawBody = False
      redirectCount = 10
      responseTimeout = ResponseTimeoutDefault
      requestVersion = HTTP/1.1
     }
      (ConnectionFailure Network.Socket.getAddrInfo (called with
preferred socket type/protocol: AddrInfo {addrFlags = [AI_ADDRCONFIG],
addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0,
addrAddress = <assumed to be undefined>, addrCanonName = <assumed to be
undefined>}, host name: Just "live.staticflickr.com", service name: Just
"443"): does not exist (Name or service not known))
     Error: processing vignette
'Ex-04-Webscraping-Online-Data-Files.Rmd' failed with diagnostics:
     pandoc document conversion failed with error 61

What's the recommended way for making this fail gracefully?  Again, I
am pointing to the images online.  I am aware of .Rbuildignore, but
using this would make the vignettes not hosted on the CRAN package
page.

Thanks in advance for your help.

-- Vinh




More information about the R-package-devel mailing list