-
Notifications
You must be signed in to change notification settings - Fork 155
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
Installing old package versions generates invalid URLs #1996
Comments
Thanks for the bug report -- I was able to reproduce this as well. Oddly, the issue doesn't seem to occur if |
I'm a bit confused from the provided example... the lockfile depends on Matrix 1.7-0, which requires R 4.4.0 or newer -- however, the image uses R 4.3.3. Is this expected? In addition, the version of Matrix provided by R-Forge is now 1.8-0, and since that repository doesn't maintain an archive, I wouldn't expect it to be available there. https://r-forge.r-project.org/R/?group_id=61 This seems unrelated to the error message provided, but even so, it seems like attempts to restore this lockfile would fail either way. |
Hi @kevinushey, Thank you for the quick response! I'm afraid that upgrading Click to reveal output
I also experimented with removing Changing the Matrix repository from R-forge to CRAN doesn't seem to help. However, your comment about R v4.3.3 being incompatible with the Matrix package made me change to R v4.4.0 in both There still seem to be some download issues (example below), but the downloads eventually work again at least! Click to reveal
I'm not really sure why changing the R version fixes the download URL, but all I can think is that the incompatibility in the R versions that you spotted is causing Many thanks for your help with this, |
Great, glad to hear it! The issue ultimately comes down to R reporting that Matrix is not available for older versions of R. For example: > install.packages("Matrix", type = "source")
Installing package into '/Users/kevin/Library/R/arm64/4.3/library'
(as 'lib' is unspecified)
Warning: package 'Matrix' is not available for this version of R
'Matrix' version 1.7-0 is in the repositories but depends on R (>= 4.4.0)
'Matrix' version 1.7-0 is in the repositories but depends on R (>= 4.5)
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages It would certainly be helpful if |
Hi @kevinushey, I currently run into a very similar issue. All archived packages from my our company repo are not available because the url is invalid. Here's on example. renv tries to download Basically, it's always |
@AlbertRapp -- are you still seeing this with renv 1.0.10? If so, can you share more information about the R package repository you're using -- are you using a public CRAN instance, or PPM, or something else? |
We're using renv 1.0.10 and this issue still persists. And we use a private Artifactory CRAN repository. Does this help or do you need more specific information? 🤔 |
It does! Do you have the
The most recent release of If you need a more immediate workaround, you should be able to set:
where |
A more direct test might be:
|
Hi Kevin, thanks for the quick reply! I ran your suggested test url <- file.path(getOption("repos")[[1]], "src/contrib/PACKAGES")
str(renv:::renv_download_headers(url)) and found the options(renv.repos.formatters = list(
<url> = "artifactory"
)) still generated invalid URLs. Any idea of how the erroneous path |
Looking back a bit more ... I wonder if this changed recently? There's an old renv issue here: #602. @brianrepko, is this something that changed recently on the Artifactory side? |
In any event, if Artifactory is now using a regular CRAN-style archive layout, then something like:
should then be an appropriate workaround for now, I believe. |
Hi Kevin, fantastic workaround 👍 Thank you. (Although I almost didn't think it worked but after putting the options in front of the activate call in Also, I investigated a bit more and switched to a previous version. With |
Btw where could I have found out about |
It's not currently documented; I had added it just as an escape hatch in case of an issue like this. |
yes - Artifactory support for CRAN repositories allows for multiple layouts - I'm just on an older one that doesn't have that. See https://jfrog.com/help/r/jfrog-artifactory-documentation/apply-the-cran-official-specification-to-local-cran-repositories |
Do you know if the CRAN layout for archived packages is now the default? It sounds like these older installations of Artifactory are no longer supported, at least from https://jfrog.com/help/r/jfrog-release-information/artifactory-end-of-life?tocId=aaNnCiuFIelrQusjfAFfpw, so I wonder if I should start assuming CRAN layout by default in |
I would guess that is the case but I don’t know for sure |
Hi, thanks for the very useful software!
I'm currently using
renv
to restore an R environment during the docker build process. I've done this in a couple of projects without any problems, but this time it is not working... The issue seems to be that if a version of a package is not from the most recent release and must be installed from source from the CRAN archive, then the package URL generated byrenv
is invalid.Here is an example, with files collapsed for brevity. The
renv.lock
is available here.Click to reveal Dockerfile
When I build the docker image with
docker build -t renv_mwe .
(which installsrenv
v1.0.9), the process crashes atrenv::restore()
with:Click to reveal error message
So, it is trying to download an old version of
renv
fromhttps://cloud.r-project.org/src/contrib/renv_1.0.7.tar.gz
, which doesn't exist. Note that it is (I think) just an unfortunate coincidence that it is the installation ofrenv
that is causing the problem in this particular example -- I've seen it crash with other packages too (e.g.nlme
), but in this case it happens to crash atrenv
as you have recently released an update, making it install v1.0.7 from the CRAN archive.I think this is an issue with this specific
renv.lock
file, as I am able to generate other ones which are able to install old versions of software completely fine. Like I say, I've used this workflow in several projects without any problems.I'm at a bit of a dead end about how to fix this, so any insights would be greatly appreciated please!
Many thanks,
George
The text was updated successfully, but these errors were encountered: