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

GH actions failing after session this morning #60

Closed
hulsiejames opened this issue May 30, 2022 · 8 comments
Closed

GH actions failing after session this morning #60

hulsiejames opened this issue May 30, 2022 · 8 comments

Comments

@hulsiejames
Copy link
Collaborator

hulsiejames commented May 30, 2022

GH actions are failing after our coding session this morning @Robinlovelace on #56

Seems to be failing due to the following error within Run r-lib/actions/setup-r-dependencies@v1

  Error: Error: <callr_remote_error: Cannot install packages:
  * MASS: Needs R >= 4.3>
   in process 9022 
  -->
  <simpleError: Cannot install packages:
  * MASS: Needs R >= 4.3>

Full details on Run r-lib/actions/setup-r-dependencies@v1 below

Run r-lib/actions/setup-r-dependencies@v1
Run cat("::group::Install pak\n")
Install pak
Run cat("::set-output name=os-version::", sessionInfo()$running, "\n", sep = "")

Run actions/cache@v2
Received 121634816 of 248224025 (49.0%), 115.9 MBs/sec
Received 248224025 of 248224025 (100.0%), 117.7 MBs/sec
Cache Size: ~237 MB (248224025 B)
/usr/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/efc7ee09-1c0b-41b7-a1a6-06fabe7d74c2/cache.tzst -P -C /home/runner/work/openinfra/openinfra
Cache restored successfully

Cache restored from key: Ubuntu 20.04.4 LTS-R version 4.2.0 (2022-04-22)-1-3ee87c5ee5307601a2f33f13366ac29a59d84cffe7e8b1475daa459701f34202
Run cat("::group::Install dependencies\n")
Install dependencies
  ℹ Loading metadata database
  ✔ Loading metadata database ... done
  
  ℹ Executing `sudo apt-get install -y libcurl4-openssl-dev`
  ℹ Executing `sudo apt-get install -y libssl-dev`
  ℹ Executing `sudo apt-get install -y libudunits2-dev`
  ℹ Executing `sudo apt-get install -y libgdal-dev`
  ℹ Executing `sudo apt-get install -y gdal-bin`
  ℹ Executing `sudo apt-get install -y libgeos-dev`
  ℹ Executing `sudo apt-get install -y libproj-dev`
  ℹ Executing `sudo apt-get install -y zlib1g-dev`
  ℹ Executing `sudo apt-get install -y libicu-dev`
  ℹ Executing `sudo apt-get install -y make`
  ℹ Executing `sudo apt-get install -y libpng-dev`
  ℹ Executing `sudo apt-get install -y libxml2-dev`
  ℹ Executing `sudo apt-get install -y pandoc`
  ℹ Executing `sudo apt-get install -y libfontconfig1-dev`
  ℹ Executing `sudo apt-get install -y libfreetype6-dev`
  ℹ Executing `sudo apt-get install -y imagemagick`
  ℹ Executing `sudo apt-get install -y libmagick++-dev`
  ℹ Executing `sudo apt-get install -y gsfonts`
  ℹ Executing `sudo apt-get install -y libcurl4-openssl-dev`
  ℹ Executing `sudo apt-get install -y libssl-dev`
  
  Error: Error: <callr_remote_error: Cannot install packages:
  * MASS: Needs R >= 4.3>
   in process 9022 
  -->
  <simpleError: Cannot install packages:
  * MASS: Needs R >= 4.3>
  
   Stack trace:
  
   12. (function (...)  ...
   13. base:::withCallingHandlers(cli_message = function(msg) { ...
   14. get("pkg_install_make_plan", asNamespace("pak"))(...)
   15. prop$stop_for_solution_error()
   16. private$plan$stop_for_solve_error()
   17. pkgdepends:::pkgplan_stop_for_solve_error(self, private)
   18. base:::stop("Cannot install packages:\n", msg, call. = FALSE)
   19. base:::.handleSimpleError(function (e)  ...
   20. h(simpleError(msg, call))
   21. base:::stop(e)
   22. (function (e)  ...
  
   x Cannot install packages:
  * MASS: Needs R >= 4.3 
  
  Execution halted
  Error: Process completed with exit code 1.
@Robinlovelace
Copy link
Contributor

Should be a self fixing bug. I bet other people are seeing this.

@hulsiejames
Copy link
Collaborator Author

Good to hear! Was worried I might have been using a different R version and that could be the issue.

Will re-try these later on and then tomorrow and update.

@hulsiejames
Copy link
Collaborator Author

Updates:
I've been trying to re-run all failed jobs a number of times the last couple of days however have had no luck.

I went to our pkgdown.yaml and R-CMD-check.yaml and followed the link for debugging build failures and have noticed that
/setup-r@v2,
/setup-r-dependencies@v2,
/setup-pandoc@v2
all have v2 versions available which are used in examples on the linked documentation pages, whilst we still use v1 for these. (We already use checkout@v2)

I also notice that within the setup-r@v2 basic example, a version of R can be specified

steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
  with:
    r-version: '3.5.3' # The R version to download (if necessary) and use.
- run: Rscript -e 'print("hello")'

@Robinlovelace I'm not too sure if this is even relevant/helpful to the issue, I didn't want to go editing these files/configs not fully understanding what I'd be changing!

@Robinlovelace
Copy link
Contributor

Maybe try re-running usethis::use_github_actions() type functions and see what happens.

@hulsiejames
Copy link
Collaborator Author

hulsiejames commented Jun 1, 2022

Tried the follwoing after looking at the help documentation:

First I tried:

> use_github_action(name = "pkgdown.yaml")
✔ Saving 'r-lib/actions/examples/pkgdown.yaml@v1' to '.github/workflows/pkgdown.yaml'
• Learn more at <https://github.com/r-lib/actions/blob/v1/examples/README.md>.

but contrary to the documentation on use_github_action (below) it has used yaml@v1 rather than yaml@v2


name
For use_github_action(): Name of one of the example workflows from https://github.com/r-lib/actions/tree/v2/examples. Examples: "pkgdown", "check-standard.yaml"."


I then noticed that use_github_action also accepts a full url link to a valid .yaml file


url
The full URL to a .yaml file on GitHub.


As such, I re-tried using use_github_action specifying the full ulr to the raw pkgdown.yaml@v2 file

>  help("use_github_actions")

>  help("use_github_action")

>  use_github_action(name = "pkgdown.yaml", url="https://github.com/r-lib/actions/raw/v2-branch/examples/pkgdown.yaml")
Error: Can't parse the URL provided via `repo_spec`.

>  use_github_action(name = "pkgdown.yaml", repo_spec= "r-lib/actions", url="https://github.com/r-lib/actions/raw/v2-branch/examples/pkgdown.yaml")
Error in use_github_action(name = "pkgdown.yaml", repo_spec = "r-lib/actions",  : 
  unused argument (repo_spec = "r-lib/actions")

>  use_github_action(name = "pkgdown.yaml", repo_spec=r-lib/actions, url="https://github.com/r-lib/actions/raw/v2-branch/examples/pkgdown.yaml")
Error in use_github_action(name = "pkgdown.yaml", repo_spec = r - lib/actions,  : 
  unused argument (repo_spec = r - lib/actions)

>  use_github_action(name = "pkgdown.yaml", repo_spec=NULL, url="https://github.com/r-lib/actions/raw/v2-branch/examples/pkgdown.yaml")
Error in use_github_action(name = "pkgdown.yaml", repo_spec = NULL, url = "https://github.com/r-lib/actions/raw/v2-branch/examples/pkgdown.yaml") : 
  unused argument (repo_spec = NULL)

>  use_github_action(name = "pkgdown.yaml", url="https://github.com/r-lib/actions/raw/v2-branch/examples/pkgdown.yaml")
Error: Can't parse the URL provided via `repo_spec`.
>  use_github_action_check_release()
✔ Saving 'r-lib/actions/examples/check-release.yaml@v1' to '.github/workflows/R-CMD-check.yaml'
Overwrite pre-existing file '.github/workflows/R-CMD-check.yaml'?

1: No way
2: I agree
3: Absolutely not

> Selection: 2
• Learn more at <https://github.com/r-lib/actions/blob/v1/examples/README.md>.

However I kept getting errors about unused argument repo_spec which I could not understand or debug online.

Next I saw that use_github_action_check_releases seemed to install the latest version of R and ran the R-CMD-check, I ran this as can be seen in the code block above.

I created a backup of both of our existing workflow.yaml files incase anything went very wrong.

After running this the the R-CMD-check.yaml was modified and I pushed to the repo:

Again, the resulting workflows failed with the same error as before:

  Error: Error: <callr_remote_error: Cannot install packages:
  * MASS: Needs R >= 4.3>
   in process 8678 
  -->
  <simpleError: Cannot install packages:
  * MASS: Needs R >= 4.3>

Within the failed workflow run, under the Run r-lib/actions/setup-r@v1 section I noticed the following lines of interest.

809 - /usr/bin/sudo gdebi --non-interactive /home/runner/work/_temp/r-4.2.0_1_amd64.deb

*unimportant lines*

936 -  Selecting previously unselected package r-4.2.0.
937 -  (Reading database ... 247999 files and directories currently installed.)
938 -  Preparing to unpack .../work/_temp/r-4.2.0_1_amd64.deb ...
939 -  Unpacking r-4.2.0 (1) ...
940 -  Setting up r-4.2.0 (1) ...
941 - 
942 - 
943 - Reading state information... Done
944 - /usr/bin/sudo ln -sf /opt/R/4.2.0/bin/R /usr/local/bin/R
945 - /usr/bin/sudo ln -sf /opt/R/4.2.0/bin/Rscript /usr/local/bin/Rscript
946 - /usr/bin/lsb_release --short --codename
947 - focal

Suggesting that R 4.2 is being installed which explains the R >= 4.3 requirement for MASS that is failing the workflow.

I was going to try and specify an R>=4.3 using the approach (below) from my previous update, however searching for the latest version of R revealed that 4.2 is the most up-to-date 🤷‍♂️

steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
  with:
    r-version: '3.5.3' # The R version to download (if necessary) and use.

As this did not fix the issue, I reverted the R-CMD-check.yaml back to Robin's previous edit.

@Robinlovelace
Copy link
Contributor

Was worth a try! Not urgent I can take a look at some point but won't be until in a few weeks time but which point their may be upstream fixes.

@hulsiejames
Copy link
Collaborator Author

hulsiejames commented Jun 1, 2022

very short and final update:

from the CRAN package page for MASS:

MASS: Support Functions and Datasets for Venables and Ripley's MASS
Functions and datasets to support Venables and Ripley, "Modern Applied Statistics with S" (4th edition, 2002).

Version: | 7.3-57
-- | --
Priority: | recommended
**Depends: | R (≥ 3.3.0), grDevices, graphics, stats, utils**

There must be a typo or something somewhere listing MASS depending on 4.3, when it is actually 3.3.
I assume could be fixed within the coming days/weeks.

@hulsiejames
Copy link
Collaborator Author

Issue has been fixed!

Seemed to be that using v1 rather than v2 was the cause.

Tto fix this I simply manually bumped up the versions of r-lib/actions by changing pkgdown.yaml and R-CMD-check.yaml within the .github/workflows/ directory.

This fixed the MASS R >=4.3 error, but created a few more listed below.

For anyone else with this issue:

  1. I manually updated my pkgdown & R-CMD-check .yaml file uses prefixes from "v1" to "v2"
  2. This created the following error:
  Error: Error: <callr_remote_error: Cannot install packages:
  * pkgdown: dependencies must be TRUE, FALSE, NA or a list of dependency types>
   in process 8881 
  1. The error is fixable changing extra-packages:pkgdown to any::pkgdown. Shown here
  2. A new error was created after applying the above fix. Now:
  Error: Error: <callr_remote_error: Failed to build source package 'XML'>
   in process 8256 
  -->
  Failed to build source package 'XML', stdout + stderr:
  1. This is a known pak error, and like above is fixable by adding any::XML to the extra-packages field in your .yaml

Closing now as this seems to be fixed. Hope this helps if you have a similar issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants