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

[BUGZILLA #17543] available.packages attempts to parse 404 response to request for PACKAGES.gz #6717

Open
MichaelChirico opened this issue May 19, 2020 · 0 comments

Comments

@MichaelChirico
Copy link
Owner

If

(1) available.packages is given a non-file repository URL, and
(2) that repository responds to requests for /src/contrib/PACKAGES.rds or /src/contrib/PACKAGES.gz with 404, but /src/contrib/PACKAGES responds normally
(3) method is 'curl', 'libcurl', or not provided on an R with capabilities('libcurl') == TRUE (i.e. defaults to 'libcurl')

then the expected fallback to src/contrib/PACKAGES at src/library/utils/R/packages.R#L113 is skipped, and read.dcf at src/library/utils/R/packages.R#L123 attempts to parse the 404 response to the request for /src/contrib/PACKAGES.gz from the repository, which raises a warning, and skips over that repo entirely.

This is due to curl/libcurl returning a status code of 0 for 4xx responses. At src/library/utils/R/packages.R#L113 z is then 0 and does not inherit from 'error', so the attempt to grab /src/contrib/PACKAGES, which would have succeeded is skipped.

The issue can be resolved by setting options(download.file.extra=c('-f')), which instructs curl to return non-zero status for HTTP response codes >=400.

However, this is unexpected, and appears to run counter to the documented behavior in the Admin manual (https://cran.r-project.org/doc/manuals/R-admin.html#Setting-up-a-package-repository) which implies that the .gz/.rds PACKAGES variants are optional.

Happy to submit a patch as well, if this is indeed a bug.


METADATA

  • Bug author - Andrew Christianson
  • Creation time - 2019-03-21 22:46:46 UTC
  • Bugzilla link
  • Status - UNCONFIRMED
  • Alias - None
  • Component - Add-ons
  • Version - R 3.5.2
  • Hardware - x86_64/x64/amd64 (64-bit) OS X El Capitan
  • Importance - P5 minor
  • Assignee - R-core
  • URL -
  • Modification time - 2019-03-21 22:47 UTC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant