-
Notifications
You must be signed in to change notification settings - Fork 9
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
Error: parse error: premature EOF #117
Comments
I think this might happen because cloudflare returns a 404 or 403 or whatever they return when you make many requests, and pkgsearch does not handle that. |
My typical use case is three or fewer packages with a loop like: lapply(packages, pkgsearch::cran_package_history) Had not seen it before. More frequent in the last few months (maybe 2023?). Especially this month. |
|
To make resolve more determinstic
Hopefully it helps with #117. I have no clue why CloudFlare returns 400 for the repeated requests for the other endpoint, and with their free tier I can't seem to be able to dig deeper in the logs. Nevertheless this entpoint seems to work better. We can't easily turn off Cloudflare right now, we would need to update the crandb server for that.
Can you please try with the dev version of pkgsearch? |
Initial tests look good. |
Relates to r-hub/pkgsearch#117 and intermittent "build and deploy" failures we're seeing due to an attempt to get a package's CRAN history. Example log: https://github.com/hadley/r-pkgs/actions/runs/5711724736/job/15473842892 The failure I'm talking about: ``` Quitting from lines 59-67 [tbl-usethis-versions] (lifecycle.Rmd) Error: ! parse error: premature EOF (right here) ------^ Backtrace: ▆ 1. ├─knitr::kable(...) 2. ├─dplyr::select(cran_package_history("usethis"), Version, Date = `Date/Publication`) 3. └─pkgsearch::cran_package_history("usethis") 4. └─pkgsearch:::do_crandb_query(...) 5. └─pkgsearch:::crandb_query(ept) 6. └─jsonlite::fromJSON(cnt, ...) 7. └─jsonlite:::parse_and_simplify(...) 8. └─jsonlite:::parseJSON(txt, bigint_as_char) 9. └─jsonlite:::parse_string(txt, bigint_as_char) ```
Also, so far so good in the GHA workflow that renders the R Packages book. But the experiment hasn't been running very long ... |
Recently and with greater frequency, pkgsearch::cran_package_history() fails and returns:
This happens occasionally and often just re-running the function will be successful. To reproduce the error, you do the same: just re-run the function till it fails.
The text was updated successfully, but these errors were encountered: