carpentries / actions

GitHub Actions for use in Carpentries-style lessons
1 stars 9 forks source link

Setup Package fail #74

Closed lguy closed 1 year ago

lguy commented 1 year ago

Hi there,

I really like the Workbench and am very thankful for all the work done around facilitating learning coding. I've used your template to build my own lecture, but am running into issues. I'm not 100% familiar with the inner workings of the Workbench, so please bear with me. My lecture is available here: https://github.com/lguy/course-microbial-genomics When pushing the last two commits, I've got errors while building the website: https://github.com/lguy/course-microbial-genomics/actions/runs/5049823304/jobs/9059765686 (see also log copied below). As far as I can tell, it happens during the Setup Package Cache part: .github/workflows/sandpaper-main.yaml This, as far as I can tell, is using the following action of the carpentries: https://github.com/carpentries/actions/blob/main/setup-lesson-deps/action.yaml

I believe that in that file, the address of the RSPM: https://github.com/carpentries/actions/blob/646f8b8801847f832091d5abd2ff64e31792f2f4/setup-lesson-deps/action.yaml#LL35C4-L35C4

which in my log translates to "https://packagemanager.posit.co/cran/__linux__/jammy/latest", which returns an error message: Invalid request, you can test this source by navigating to: /cran/latest/src/contrib/PACKAGES

I believe this might be related to the following issue: https://github.com/r-lib/remotes/issues/494

That's about where my understanding of the error stops. Can you help me? I'd be happy to provide more details if need be.

Best regards,

Lionel

Register Repositories
Using github PAT from envvar GITHUB_PAT
Skipping install of 'vise' from a github remote, the SHA1 (ee479870) has not changed since last install.
  Use `force = TRUE` to force installation
Package: {{ Package }}
Title: {{ Title }}
Version: 1.0.0
Authors@R: 
    c(person(given = "Jo", family = "Doe", email = "jodoe@dom.ain",
      role = c("aut", "cre")))
Maintainer: {{ Maintainer }}
Description: {{ Description }}
License: {{ License }}
URL: {{ URL }}
BugReports: {{ BugReports }}
Encoding: UTF-8
Imports: 
    R6 (== 2.5.1),
    Rcpp (== 1.0.10),
    ape (== 5.7-1),
    askpass (== 1.1),
    assertthat (== 0.2.1),
    base64enc (== 0.1-3),
    brio (== 1.1.3),
    bslib (== 0.4.2),
    cachem (== 1.0.8),
    callr (== 3.7.3),
    cli (== 3.6.1),
    clipr (== 0.8.0),
    commonmark (== 1.9.0),
    cpp11 (== 0.4.3),
    crayon (== 1.5.2),
    credentials (== 1.3.2),
    curl (== 5.0.0),
    desc (== 1.4.2),
    digest (== 0.6.31),
    downlit (== 0.4.2),
    ellipsis (== 0.3.2),
    evaluate (== 0.20),
    fansi (== 1.0.4),
    fastmap (== 1.1.1),
    fontawesome (== 0.5.1),
    fs (== 1.6.2),
    gert (== 1.9.2),
    gh (== 1.4.0),
    gitcreds (== 0.1.2),
    glue (== 1.6.2),
    highr (== 0.10),
    htmltools (== 0.5.5),
    httpuv (== 1.6.9),
    httr (== 1.4.5),
    httr2 (== 0.2.2),
    ini (== 0.3.1),
    jquerylib (== 0.1.4),
    jsonlite (== 1.8.4),
    knitr (== 1.42),
    later (== 1.3.1),
    lattice (== 0.21-8),
    lifecycle (== 1.0.3),
    magrittr (== 2.0.3),
    memoise (== 2.0.1),
    mime (== 0.12),
    nlme (== 3.1),
    openssl (== 2.0.6),
    pegboard (== 0.5.2),
    pillar (== 1.9.0),
    pkgconfig (== 2.0.3),
    pkgdown (== 2.0.7),
    processx (== 3.8.1),
    promises (== 1.2.0.1),
    ps (== 1.7.5),
    purrr (== 1.0.1),
    ragg (== 1.2.5),
    rappdirs (== 0.3.3),
    renv (== 0.17.3),
    rlang (== 1.1.1),
    rmarkdown (== 2.21),
    rprojroot (== 2.0.3),
    rstudioapi (== 0.14),
    sandpaper (== 0.11.16),
    sass (== 0.4.5),
    servr (== 0.27),
    stringi (== 1.7.12),
    stringr (== 1.5.0),
    sys (== 3.4.1),
    systemfonts (== 1.0.4),
    textshaping (== 0.3.6),
    tibble (== 3.2.1),
    tinkr (== 0.2.0),
    tinytex (== 0.45),
    usethis (== 2.1.6),
    utf8 (== 1.2.3),
    vctrs (== 0.6.2),
    whisker (== 0.4.1),
    withr (== 2.5.0),
    xfun (== 0.39),
    xml2 (== 1.3.4),
    xslt (== 1.4.4),
    yaml (== 2.3.7),
    zip (== 2.3.0)
[1] "ubuntu" "22.04" 
Error: Error: JSON: EXPECTED value GOT <
Execution halted
Error: Process completed with exit code 1.
lguy commented 1 year ago

After some frantic fiddling around (the lesson starts tomorrow), I managed to find a workaround, by forking the carpentries/actions and commenting out the call to vise::ci_sysreqs

https://github.com/lguy/carpentries-actions/blob/main/setup-lesson-deps/action.yaml#L81

            #vise::ci_sysreqs(renv::paths$lockfile(), execute = TRUE)

That temporarily solved the issue: https://github.com/lguy/course-microbial-genomics/actions/runs/5050333901/jobs/9062179427 and I can now the site can be built. I'm guessing it's only a temporary workaround.

milanmlft commented 1 year ago

Encountering the same issue here: https://github.com/LearnToDiscover/Basic_Python/actions/runs/5051687090/jobs/9063779599#step:9:203

The issue seems to be caused by RStudio/Posit changing its URLs to the new Posit name. It seems to have just been fixed in remotes: https://github.com/r-lib/remotes/commit/e199c1bdda3858600bbef8e4bbc3f5868b899587 but there might still be some old URLs lying around in the carpentries actions, e.g. https://github.com/carpentries/actions/blob/646f8b8801847f832091d5abd2ff64e31792f2f4/setup-lesson-deps/action.yaml#LL35C45-L35C45

milanmlft commented 1 year ago

Can confirm that updating the URLs (rstudio -> posit) and setting Sys.setenv("RSPM_ROOT" = "https://packagemanager.posit.co") fixes the problem: https://github.com/milanmlft/toy-sandpaper-python/actions/runs/5051988388/jobs/9073451713

tobyhodges commented 1 year ago

A note to say that this was fixed with #76 (and would have been by #75 if we could have merged it!)

lguy commented 1 year ago

Thanks @milanmlft @tobyhodges and @froggleston for a swift solution! I can also confirm that my lesson now compiles correctly when calling carptentries/actions.

zkamvar commented 1 year ago

Thank you @lguy for reporting this issue, for @milanmlft for finding a solution, and @tobyhodges and @froggleston for implementing the fix and interpreting my implied contributing guidelines 😅

zkamvar commented 1 year ago

Just a little update,

It turned out there was one more thing that needed to be updated in the workflows, in that the RSPM_ROOT environment variable needed to be set (see https://github.com/r-lib/remotes/issues/757#issuecomment-1558885826, fixed in 312309e1106ed138df5349c2114ff6529a2204dc and e9405d9b8f2f99a2a7fd16a31194fd8563af95c9).

We will eventually move away from the {remotes} package in favour of {pak} as it will be better supported going forward, but the last time we attempted it, {pak} would take up to 10 minutes to bootstrap before downloading packages, so development of this would take some time.