Open paulkitt opened 8 months ago
I tried to figure out how to fix the script but failed with lacking the knowledge about R and RScript. Would be amazing if anybody could write a fix/submit a mr. Its a great role and we are happy that we found it.
I'll have a look when I find some time. What's the OS / version you are using?
Amazing thanks a lot! We are deploying the role to Ubuntu 22.04
Can you attach te "configuration" you're using? Otherwise it is a bit difficult to replicate your results :-)
Yes sure. I replicated the problem inside the molecule test:
---
- name: Converge
hosts: all
become: true
vars:
r_packages:
- name: yaml
state: updated
roles:
- ../../../
molecule login
R
packageurl <- "https://cran.r-project.org/src/contrib/Archive/yaml/yaml_2.3.7.tar.gz"
install.packages(packageurl, repos=NULL, type="source")
Error:
TASK [../../../ : packages | update] *******************************************
failed: [instance] (item={'name': 'yaml', 'state': 'updated'}) => {"ansible_loop_var": "item", "changed": false, "cmd": ["/usr/local/bin/R-update-package", "yaml", "cran", "/usr/local/lib/R/site-library"], "delta": "0:00:02.106649", "end": "2024-04-11 12:58:32.121181", "item": {"name": "yaml", "state": "updated"}, "msg": "non-zero return code", "rc": 1, "start": "2024-04-11 12:58:30.014532", "stderr": "Error in download.file(url = paste0(repos, \"/PACKAGES.rds\"), destfile = dest, : \n cannot open URL 'https://cran.rstudio.com/PACKAGES.rds': HTTP status was '404 Not Found'\nCalls: withCallingHandlers ... tryCatchList -> tryCatchOne -> doTryCatch -> download.file\nExecution halted", "stderr_lines": ["Error in download.file(url = paste0(repos, \"/PACKAGES.rds\"), destfile = dest, : ", " cannot open URL 'https://cran.rstudio.com/PACKAGES.rds': HTTP status was '404 Not Found'", "Calls: withCallingHandlers ... tryCatchList -> tryCatchOne -> doTryCatch -> download.file", "Execution halted"], "stdout": "", "stdout_lines": []}
The output already reveals the issue:
cannot open URL 'https://cran.rstudio.com/PACKAGES.rds': HTTP status was '404 Not Found'
Can you try configuring it like this?
---
- name: Converge
hosts: all
become: true
vars:
r_cran_mirror: https://cloud.r-project.org/
r_packages:
- name: yaml
state: updated
roles:
- ../../../
Changing the r_cran_mirror results in the same problem:
failed: [instance] (item={'name': 'yaml', 'state': 'updated'}) => {"ansible_loop_var": "item", "changed": false, "cmd": ["/usr/local/bin/R-update-package", "yaml", "cran", "/usr/local/lib/R/site-library"], "delta": "0:00:01.149067", "end": "2024-04-18 13:16:36.394198", "item": {"name": "yaml", "state": "updated"}, "msg": "non-zero return code", "rc": 1, "start": "2024-04-18 13:16:35.245131", "stderr": "Error in download.file(url = paste0(repos, \"/PACKAGES.rds\"), destfile = dest, : \n cannot open URL 'https://cloud.r-project.org/PACKAGES.rds': HTTP status was '404 Not Found'\nCalls: withCallingHandlers ... tryCatchList -> tryCatchOne -> doTryCatch -> download.file\nExecution halted", "stderr_lines": ["Error in download.file(url = paste0(repos, \"/PACKAGES.rds\"), destfile = dest, : ", " cannot open URL 'https://cloud.r-project.org/PACKAGES.rds': HTTP status was '404 Not Found'", "Calls: withCallingHandlers ... tryCatchList -> tryCatchOne -> doTryCatch -> download.file", "Execution halted"], "stdout": "", "stdout_lines": []}
I tried to make sense of the R-update-package
r-script but didnt understand why there this url is called and why it is brocken. I really like the approach to install the packages directly via R and via apt. Would be great to find a fix.
Are the Rscripts included in the role part of a lager project where I could ask for support to fix the issue?
@paulkitt No, unfortunately not
When updating packages via the role the 'R-update-package' results in this error:
I tried to use the R update script directly resulting in the same problem: