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.
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
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
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.
I have now managed to download packages via the NEXUS. The cause of the error was a missing proxy activation.
To get compiled binaries from the POSIT Package Manager the User-Agent header must be set correctly. For this I used the user-agent customization on the repo.
Is there also a way to tell the NEXUS to forward the User-Agent header of the R client to the POSIT Package Manager?
This would save having to maintain the header manually with every OS or R upgrade.
@christopher.gies Our R proxy doesn’t forward the user agent upstream, but that would only be a partial solution. If you recall, Repository caches the components that it pulls down from remote registries, so it essentially needs to be enhanced so that the user agent is part of the package coordinates. Imagine if the first request has one user agent, then the second request has a different user agent. Repository has to know that the user agent means that the cached component can’t be served to satisfy the second request.
We have an enhancement request on file here, but for now unfortunately it doesn’t work smoothly against upstream repositories that use User Agent in this way.
Do I have access to the enhancement request in any way, or is there another way to be informed as soon as a corresponding feature has been implemented?