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

build_site() returning an error : Error in readRDS(path) : error reading from connection #2713

Closed
xtimbeau opened this issue Jul 12, 2024 · 7 comments

Comments

@xtimbeau
Copy link

I am building vignettes using quarto as the vignette builder.

When building site, I have an error. It occurs in build_home_index() more specifically in the function cran_link().
When commenting out line 209 of build_home_index.R, the error goes away and the building process completes.

No idea why it is occuring, nor why it is not occuring anymore.

I can try to build a reprex, but that was not systematic in the last days, I suspect it started after some packages update.

cran_link <- function(pkg) {
  if (!has_internet()) {
    return(NULL)
  }

  cran_url <- paste0("https://cloud.r-project.org/package=", pkg)
  req <- httr2::request(cran_url)
  req <- req_pkgdown_cache(req)
  req <- httr2::req_error(req, function(resp) FALSE)
  resp <- httr2::req_perform(req)
  if (!httr2::resp_is_error(resp)) {
    return(list(repo = "CRAN", url = cran_url))
  }

  # bioconductor always returns a 200 status, redirecting to /removed-packages/
  bioc_url <- paste0("https://www.bioconductor.org/packages/", pkg)
  req <- httr2::request(bioc_url)
  # req <- req_pkgdown_cache(req)
  req <- httr2::req_error(req, function(resp) FALSE)
  req <- httr2::req_retry(req, max_tries = 3)
  resp <- httr2::req_perform(req)

  if (!httr2::resp_is_error(resp) && !grepl("removed-packages", httr2::resp_url(resp))) {
    return(list(repo = "Bioconductor", url = bioc_url))
  }

  NULL
}
@jayhesselberth
Copy link
Collaborator

jayhesselberth commented Jul 12, 2024

Likely a dup of #2696

You might try installing the dev httr2. This commit tried to address the above issue, but the error itself is a little hard to pin down.

@jayhesselberth
Copy link
Collaborator

This is also happening in the r-devel-linux automated CRAN checks.

@remlapmot
Copy link

This has also happened to me. I am also not sure why it happened, but I noted https://zenodo.org/ was down the day it happened and I use a README badge from them. As noted in #2676 (comment) I had to delete my pkgdown cache before I could successfully build a site again.

fs::dir_delete(fs::path(tools::R_user_dir("pkgdown", "cache"), "http"))

@xtimbeau
Copy link
Author

xtimbeau commented Jul 13, 2024 via email

@jayhesselberth
Copy link
Collaborator

jayhesselberth commented Jul 13, 2024

Can you try installing this branch and the re-build your site?

pak::pak("r-lib/pkgdown@cache-path")

EDIT: Oh nm, I see httr2 dev solved it.

@jayhesselberth
Copy link
Collaborator

Addressed in #2715

@xtimbeau
Copy link
Author

xtimbeau commented Jul 13, 2024 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

3 participants