NEXUS R Repository does not download from POSIT Packagemanager

I’ve confiugred a r-proxy repository to provide R-Packages from POSIT Packagemanager using the following URL [https://packagemanager.posit.co/cran/__linux__/rhel9/latest].


Unfortunately the r-proxy repository didn’t sync the packages from the POSIT Packagemanager above.

Attached I’ve a couple of screenshots describing the configuration.


At this point, we assume from the request log files that the NEXUS R repository r-proxy has not yet accessed the URL [https://packagemanager.posit.co/cran/__linux__/rhel9/latest]

How can we force the download.

Their help page suggests:

https://packagemanager.posit.co/cran/latest

This does appear correct as https://packagemanager.posit.co/cran/latest/src/contrib/PACKAGES is nested under and contains the R repository metadata

the advantage of the POSIT repo is that there are precompiled R packages for LINUX environments. For this you have to choose the LINUX distribution, in my case RHEL9. Then the repo URL changes to the URL below.

https://packagemanager.posit.co/cran/__linux__/rhel9/latest

Does anyone have an idea why the packages are not loaded from the URL? Can I somehow debug this further?

looking at your question again, when you say “did not sync” - are you expecting that Nexus will do something automatically? If so, that isn’t how our proxy repositories are intended to work, Nexus acts as a format aware caching proxy, for caching to occur you’ll need to configure an R client to use Nexus as the remote and download components through it.

OK, I wasn’t aware of that, I had the information from a colleague that the NEXUS downloads the packages and makes them available.
When I try to access from my R client via the NEXUS I get the following error message when downloading an example package A3.

$ /usr/bin/Rscript --slave --no-save --no-restore-history -e 'install.packages("A3", lib="<PATH_TO_USER_LIB>", repos="https://<NEXUS_HOST>/repository/r-proxy")'
Warning: unable to access index for repository https://<NEXUS_HOST>/repository/r-proxy/src/contrib:
  cannot open URL 'https://<NEXUS_HOST>/repository/r-proxy/src/contrib/PACKAGES'
Warning message:
package ‘A3’ is not available for this version of R

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

The Package is still available in the POSIT Repo

Any idea whats wrong?

I think this is your issue, the error suggests you’re using a version of R which is unsupported by the package. Your screenshot suggests R >= 2.15

I don’t think this is the error, as it occurs for any package. I am using R version 4.4.0 (2024-04-24) – “Puppy Cup”

I have no idea how to debug the issue further. Does anyone have an idea?

$ R --version
R version 4.4.0 (2024-04-24) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.

$ /usr/bin/Rscript --slave --no-save --no-restore-history -e 'install.packages("AalenJohansen", lib="<PATH_TO_USER_LIB>", repos="https://<NEXUS_HOST>/repository/r-proxy")'
Warning: unable to access index for repository https://<NEXUS_HOST>/repository/r-proxy/src/contrib:
  cannot open URL 'https://<NEXUS_HOST>/repository/r-proxy/src/contrib/PACKAGES'
Warning message:
package ‘AalenJohansen’ is not available for this version of R

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

$ /usr/bin/Rscript --slave --no-save --no-restore-history -e 'install.packages("AATtools", lib="<PATH_TO_USER_LIB>", repos="https://<NEXUS_HOST>/repository/r-proxy")'
Warning: unable to access index for repository https://<NEXUS_HOST>/repository/r-proxy/src/contrib:
  cannot open URL 'https://<NEXUS_HOST>/repository/r-proxy/src/contrib/PACKAGES'
Warning message:
package ‘AATtools’ is not available for this version of R

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

$ /usr/bin/Rscript --slave --no-save --no-restore-history -e 'install.packages("ABACUS", lib="<PATH_TO_USER_LIB>", repos="https://<NEXUS_HOST>/repository/r-proxy")'
Warning: unable to access index for repository https://<NEXUS_HOST>/repository/r-proxy/src/contrib:
  cannot open URL 'https://<NEXUS_HOST>/repository/r-proxy/src/contrib/PACKAGES'
Warning message:
package ‘ABACUS’ is not available for this version of R

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

If you use the remote repository without Nexus do you encounter the same error?

You may also wish to compare the metadata when retrieved through Nexus against the metadata served by the remote to see if there are differences.

We had another problem with a proxy exception. This has now been corrected and /src/contrib/PACKAGES is now available in the NEXUS.

I can also access it via CURL

$ curl https://<NEXUS_HOST>/repository/r-proxy/src/contrib/PACKAGES | head -n 20

Package: A3
Version: 1.0.0
Depends: R (>= 2.15.0), xtable, pbapply
Suggests: randomForest, e1071
NeedsCompilation: no
License: GPL (>= 2)

Package: AalenJohansen
Version: 1.0
Suggests: knitr, rmarkdown
NeedsCompilation: no
License: GPL (>= 2)

Package: AATtools
Version: 0.0.3
Depends: R (>= 3.6.0)
Imports: magrittr, dplyr, doParallel, foreach
NeedsCompilation: no
License: GPL-3

Via Rscript I still get the error message that the URL cannot be accessed.

$ /usr/bin/Rscript --slave --no-save --no-restore-history -e 'install.packages("A3", lib="<PATH_TO_USER_LIB>", repos="https://<NEXUS_HOST>/repository/r-proxy")'
Warning: unable to access index for repository https://<NEXUS_HOST>/repository/r-proxy/src/contrib:
  cannot open URL 'https://<NEXUS_HOST>/repository/r-proxy/src/contrib/PACKAGES'
Warning message:
package ‘A3’ is not available for this version of R

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

I could imagine that I need to tell Rscript that the correct certificate is being used. But I’m not sure how to tell Rscript to use a specific certificate.

Have you tried adding the certificate to your system’s trust store?

Is it a java application, so is the java cacerts the correct trust store?
The certificate is already added to the cacerts.

Sorry I meant certificates for Rscript (which appears to be C)