-
Notifications
You must be signed in to change notification settings - Fork 335
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()
fails if http user dir cache is present but empty.
#2731
Comments
build_site()
fails if http user dir cache is present but empty.
Do you have the latest httr2 installed? |
The dev version has |
Ahh, I'd installed httr2 a few weeks ago, and hadn't seen 1.0.2 come out last week. Installing that fixes the problem at its root. Also missed #2696 which mentioned this same issue. Thank you both! |
@hadley Weirdly, this is still happening occasionally on httr2 version 1.0.2! It is inconsistent though as a re-run shortly after fixed the problem. Not precisely sure where this should go as it's not quite a pkgdown issue, but figured it was best to still document the issue as I saw it.
Backtrace
|
Try cleaning your cache, then re-build. # install.pakcages("pak")
pak::pak("r-lib/pkgdown")
pkgdown::clean_cache()
pkgdown::build_site() |
Ah alas I had already fixed it by deleting that same cache manually, otherwise I would have tested this route. Not entirely sure why this continues to happen, should probably shift to an httr2 issue if it happens further. Thank you! |
Cache clearance also fixed the same issue for me |
This bug is definitively fixed in httr2 1.0.3. |
This is a very strange one, and I'm not precisely sure how my installation got into this state. For context I am using windows, so can't confirm that this is reproducible on OSX/Linux.
However in the case where the
http
cache attools::R_user_dir("pkgdown", "cache"), "http")
is present but contains no data,build_site()
fails.The root cause of this failure is in the function
cran_link()
.see build-home-index.R@L192
It seems that
httr2
is reading the cache as present, and trying to load data from it, however given that there is no data, the underlyingreadRDS()
call fails.Whilst at its root this is possibly overall an httr2 issue more than a pkgdown issue, it'd be useful to either have mitigation for a corrupted httr2 cache hit, or at least a warning to the user to try deleting the http cache file.
Deleting the http cache file fixes the error and the build succeeds.
Steps to reproduce
*.rds
located at the directory specified bytools::R_user_dir("pkgdown", "cache"), "http")
in a text editor.build_site()
as usual.Full stack traces
Console output
Full stack trace (from .Last.error)
The text was updated successfully, but these errors were encountered: